Documentation ¶
Index ¶
- Variables
- func BlockHeightFromContext(ctx context.Context) (uint64, error)
- func ChainIDFromContext(ctx context.Context) (string, error)
- func InProgressSnapshotRestore(ctx context.Context) bool
- func InProgressUpgradeFrom(ctx context.Context, from 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 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 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.
Click to show internal directories.
Click to hide internal directories.