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
tnoff validatorsValidators should not expose the
tnnamespace 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
tnfrom the validator’s--http.apiand--ws.apiand 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.
| Method | Description |
|---|---|
| Node | |
| tn_info | The node’s publicly available identity and connection information: name, ids, public keys and network addresses |
| tn_nodeMode | The node’s current consensus participation mode, read live at call time |
| Consensus | |
| tn_latestConsensusHeader | The latest consensus header |
| tn_latestHeader | Deprecated alias for tn_latestConsensusHeader |
| tn_epochRecord | The epoch record and its certificate for an epoch number, from the node’s database |
| tn_epochRecordByHash | The epoch record and its certificate for an epoch record hash, from the node’s database |
| tn_getBlockTimestampMillis | The consensus commit time, in milliseconds, of an execution block |
| tn_genesis | The chain genesis |
| Epoch and registry | |
| tn_getCurrentEpoch | The current epoch number from the ConsensusRegistry |
| tn_getCurrentEpochInfo | The current epoch’s on-chain info from the ConsensusRegistry: committee, issuance, start block height and duration |
| tn_getEpochInfo | On-chain info for an epoch the ConsensusRegistry still holds in its window of recent epochs |
| tn_getNextCommitteeSize | The committee size for the next epoch |
| Validators | |
| tn_getValidators | All validators with the requested status; "Any" returns validators of every status |
| tn_getCommitteeValidators | The committee validators for an epoch |
| tn_getValidator | The ValidatorInfo record for a validator address |
| tn_getBlsPubkey | The BLS public key for a validator address |
| tn_getCommitteeBlsPubkeys | The BLS public keys for the committee of an epoch |
| tn_isValidator | Whether a BLS public key belongs to a known validator |
| tn_isDelegated | Whether a validator’s stake originates from a delegator |
| tn_isRetired | Whether a validator is permanently retired |
| Staking | |
| tn_getRewards | The claimable rewards accrued for a validator address |
| tn_getBalanceBreakdown | A validator’s outstanding balance, initial stake and rewards |
| tn_getCurrentStakeVersion | The current stake config version |
| tn_undistributedIssuance | The issuance not yet distributed to validators |
| tn_delegationDigest | The EIP-712 digest a validator signs to accept a delegation |
| tn_proofOfPossessionMessage | The BLS12-381 proof-of-possession message a validator signs |