Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

tn

The tn namespace serves Telcoin Network data that has no eth equivalent: the node’s identity and consensus participation mode, consensus headers and signed epoch records, the millisecond commit time of execution blocks, and validator, committee and staking state from the ConsensusRegistry system contract at 0x07E17e17E17e17E17e17E17E17E17e17e17E17e1. Registry methods read the contract at the node’s canonical tip and take no block parameter.

tn is on by default: a node serves it unless --http.api or --ws.api names a list without it. The cost to serve it is low to moderate. Most methods answer from memory or the node’s database; registry methods run a read-only contract call against the latest state. The blocking work behind these methods is capped at 64 concurrent requests per RPC server, and requests beyond that queue rather than fail. Public RPC nodes (observers) should serve it; see Enabling Namespaces.

Warning

Keep tn off validators

Validators should not expose the tn namespace publicly. A tn_getBlockTimestampMillis request for a block from a sealed epoch can open that epoch’s consensus pack, and the node opens packs into a small cache it shares with state sync and peer epoch serving. The lookup runs under a tight concurrency bound, but public callers can still churn that cache.

Omit tn from the validator’s --http.api and --ws.api and serve the namespace from non-validating nodes instead; see Enabling Namespaces.

Errors use these codes: a registry call that reverts is reported as eth_call reports one, with code 3, a message that starts with execution reverted, and the ABI-encoded revert data in data; -32001 (Not Found.) means the node does not have the requested record; -32602 is an invalid parameter; -32603 (internal error) is a failure inside the node, whose detail is only logged on the node.

Example values are illustrative; field names and types match what the node returns.

MethodDescription
Node
tn_infoThe node’s publicly available identity and connection information: name, ids, public keys and network addresses
tn_nodeModeThe node’s current consensus participation mode, read live at call time
Consensus
tn_latestConsensusHeaderThe latest consensus header
tn_latestHeaderDeprecated alias for tn_latestConsensusHeader
tn_epochRecordThe epoch record and its certificate for an epoch number, from the node’s database
tn_epochRecordByHashThe epoch record and its certificate for an epoch record hash, from the node’s database
tn_getBlockTimestampMillisThe consensus commit time, in milliseconds, of an execution block
tn_genesisThe chain genesis
Epoch and registry
tn_getCurrentEpochThe current epoch number from the ConsensusRegistry
tn_getCurrentEpochInfoThe current epoch’s on-chain info from the ConsensusRegistry: committee, issuance, start block height and duration
tn_getEpochInfoOn-chain info for an epoch the ConsensusRegistry still holds in its window of recent epochs
tn_getNextCommitteeSizeThe committee size for the next epoch
Validators
tn_getValidatorsAll validators with the requested status; "Any" returns validators of every status
tn_getCommitteeValidatorsThe committee validators for an epoch
tn_getValidatorThe ValidatorInfo record for a validator address
tn_getBlsPubkeyThe BLS public key for a validator address
tn_getCommitteeBlsPubkeysThe BLS public keys for the committee of an epoch
tn_isValidatorWhether a BLS public key belongs to a known validator
tn_isDelegatedWhether a validator’s stake originates from a delegator
tn_isRetiredWhether a validator is permanently retired
Staking
tn_getRewardsThe claimable rewards accrued for a validator address
tn_getBalanceBreakdownA validator’s outstanding balance, initial stake and rewards
tn_getCurrentStakeVersionThe current stake config version
tn_undistributedIssuanceThe issuance not yet distributed to validators
tn_delegationDigestThe EIP-712 digest a validator signs to accept a delegation
tn_proofOfPossessionMessageThe BLS12-381 proof-of-possession message a validator signs