Skip to main content

Module node_context

Module node_context 

Source
Expand description

The nodeโ€™s position on the chain, which telemetry backends attach to the signals they send.

The sync progress task records it in every build, whichever backends are compiled in.

Structsยง

ChainPosition ๐Ÿ”’
The nodeโ€™s position on the chain when the progress task last checked.

Constantsยง

UNKNOWN_TIP_HEIGHT ๐Ÿ”’
Above Height::MAX, so it is never a real height.

Staticsยง

NEAR_TIP ๐Ÿ”’
Whether the syncer was close to the chain tip when the progress task last checked.
NETWORK ๐Ÿ”’
The network this node runs on, once zebrad start or the progress task records it.
TIP_HEIGHT ๐Ÿ”’
The best chain tip height, or UNKNOWN_TIP_HEIGHT until the progress task records one.

Functionsยง

chain_position ๐Ÿ”’
Returns the nodeโ€™s position on the chain, once the progress task has recorded one.
network ๐Ÿ”’
Returns the network this node runs on, once it has been recorded.
record ๐Ÿ”’
Records the best chain tip height on network, and whether the syncer is close to the tip.
set_network ๐Ÿ”’
Records the network this node runs on. A node only runs on one network, so later calls keep the first one.