Skip to content

Commit

Permalink
Merge pull request #9 from WenYongqi/main
Browse files Browse the repository at this point in the history
minor improve: log time & avoid duplicate file name
  • Loading branch information
jsign authored Feb 9, 2023
2 parents e70c082 + 41ddf08 commit 99a7ab2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/kzgcli/contribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ func contributeToCeremony(ctx context.Context, client *sequencerclient.Client, s
fmt.Printf("Waiting for our turn to contribute...\n")
cb, ok, err := client.TryContribute(ctx, sessionID)
if err != nil {
fmt.Printf("Waiting for our turn failed (err: %s), retrying in %v...\n", err, tryContributeAttemptDelay)
fmt.Printf("%v Waiting for our turn failed (err: %s), retrying in %v...\n", time.Now().Format("2006-01-02 15:04:05"), err, tryContributeAttemptDelay)

This comment has been minimized.

Copy link
@SAEED2ALAHMARI

SAEED2ALAHMARI Feb 24, 2024

time.Now().Format("2024-02-24 5:16:08")

time.Sleep(tryContributeAttemptDelay)
continue
}
if !ok {
fmt.Printf("Still isn't our turn, waiting %v for retrying...\n", tryContributeAttemptDelay)
fmt.Printf("%v Still isn't our turn, waiting %v for retrying...\n", time.Now().Format("2006-01-02 15:04:05"), tryContributeAttemptDelay)
time.Sleep(tryContributeAttemptDelay)
continue
}
Expand Down Expand Up @@ -117,11 +117,11 @@ func contributeToCeremony(ctx context.Context, client *sequencerclient.Client, s

// Persist the receipt and contribution.
receiptJSON, _ := json.Marshal(contributionReceipt)
if err := os.WriteFile("contribution_receipt.json", receiptJSON, os.ModePerm); err != nil {
if err := os.WriteFile(fmt.Sprintf("contribution_receipt_%s.json", sessionID), receiptJSON, os.ModePerm); err != nil {
log.Fatalf("failed to save the contribution receipt (err: %s), printing to stdout as last resort: %s", err, receiptJSON)
}
ourContributionBatchJSON, _ := contribution.Encode(contributionBatch, true)
if err := os.WriteFile("my_contribution.json", ourContributionBatchJSON, os.ModePerm); err != nil {
if err := os.WriteFile(fmt.Sprintf("my_contribution_%s.json", sessionID), ourContributionBatchJSON, os.ModePerm); err != nil {
log.Fatalf("failed to save the contribution (err: %s), printing to stdout as last resort: %s", err, ourContributionBatchJSON)
}

Expand Down

2 comments on commit 99a7ab2

@jordanwoods8
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good

@SAEED2ALAHMARI
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Please sign in to comment.