Documentation ¶
Index ¶
- Variables
- func BlockHeightFromContext(ctx context.Context) (uint64, error)
- func ChainIDFromContext(ctx context.Context) (string, error)
- func InProgressSnapshotRestore(ctx context.Context) bool
- func InProgressUpgrade(ctx context.Context) bool
- func InProgressUpgradeFrom(ctx context.Context, from string) bool
- func InProgressUpgradeFromMultiple(ctx context.Context, versions ...string) bool
- func RemoteIPAddrFromContext(ctx context.Context) (string, bool)
- func TraceIDFromContext(ctx context.Context) (context.Context, string)
- func TxHashFromContext(ctx context.Context) (string, error)
- func WithBlockHeight(ctx context.Context, h uint64) context.Context
- func WithChainID(ctx context.Context, chainID string) context.Context
- func WithRemoteIPAddr(ctx context.Context, addr string) context.Context
- func WithSnapshotInfo(ctx context.Context, version string, upgrade bool) context.Context
- func WithTraceID(ctx context.Context, tID string) context.Context
- func WithTxHash(ctx context.Context, txHash string) context.Context
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func InProgressSnapshotRestore ¶ added in v0.74.0
InProgressSnapshotRestore returns whether the data in the contexts tells us that a snapshot restore is in progress.
func InProgressUpgrade ¶ added in v0.76.0
InProgressUpgrade returns whether the data in the contexts tells us that the node is restoring from a snapshot taken for a protocol-upgrade.
func InProgressUpgradeFrom ¶ added in v0.73.0
InProgressUpgradeFrom returns whether the data in the contexts tells us that the node is restoring from a snapshot taken for a protocol-upgrade by the given version.
func InProgressUpgradeFromMultiple ¶ added in v0.76.0
InProgressUpgradeFromMultiple returns whether the data in the contexts tells us that the node is restoring from a snapshot taken for a protocol-upgrade by one of the given versions. This can be useful in situations where mainnet and fairground are running different versions.
func RemoteIPAddrFromContext ¶
RemoteIPAddrFromContext returns the remote IP addr value stored in ctx, if any.
func TraceIDFromContext ¶
TraceIDFromContext get traceID from context (add one if none is set).
func WithRemoteIPAddr ¶
WithRemoteIPAddr wrap the context into a new context and embed the ip addr as a key.
func WithSnapshotInfo ¶ added in v0.73.0
func WithTraceID ¶
WithTraceID returns a context with a traceID value.
Types ¶
This section is empty.