Skip to content

Commit

Permalink
document GetSnapshotAtEpochAndPhase arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
kc1116 committed Apr 2, 2024
1 parent 263974e commit c6a1989
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/util/cmd/common/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ func GetSnapshot(ctx context.Context, client *grpc.Client) (*inmem.Snapshot, err
// GetSnapshotAtEpochAndPhase will get the latest finalized protocol snapshot and check the current epoch and epoch phase.
// If we are past the target epoch and epoch phase we exit the retry mechanism immediately.
// If not check the snapshot at the specified interval until we reach the target epoch and phase.
// Args:
// - ctx: context used when getting the snapshot from the network.
// - log: the logger
// - startupEpoch: the desired epoch in which to take a snapshot for startup.
// - startupEpochPhase: the desired epoch phase in which to take a snapshot for startup.
// - retryInterval: sleep interval used to retry getting the snapshot from the network in our desired epoch and epoch phase.
// - getSnapshot: func used to get the snapshot.
// Returns:
// - protocol.Snapshot: the protocol snapshot.
// - error: if any error occurs. Any error returned from this function is irrecoverable.
func GetSnapshotAtEpochAndPhase(ctx context.Context, log zerolog.Logger, startupEpoch uint64, startupEpochPhase flow.EpochPhase, retryInterval time.Duration, getSnapshot GetProtocolSnapshot) (protocol.Snapshot, error) {
start := time.Now()

Expand Down

0 comments on commit c6a1989

Please sign in to comment.