Portal Community

chainInfo

Reads chain identity and the current head block, using five sequential Substrate RPC calls: system_chain, system_version, state_getRuntimeVersion, chain_getHeader / chain_getBlockHash, and a state_getStorage read of the Timestamp.Now storage item at the head block.

FieldTypeRequiredDescription
networkselect✓ Yescentrifuge | altair | development. No default — see Networks.

Example response:

{
  "chainName": "Centrifuge",
  "nodeVersion": "1.x.x-...",
  "specName": "centrifuge",
  "specVersion": 1234,
  "currentBlock": 9799037,
  "currentBlockHash": "0x...",
  "headBlockTimeUtc": "2026-06-28T11:42:07Z",
  "headBlockAgeSeconds": 1987200,
  "status": "success"
}
Response FieldMeaning
chainNameDisplay name reported by system_chain.
nodeVersionNode client implementation version.
specName / specVersionRuntime spec identity — the number any pallet-layout assumption (like the account-storage decode in Account Operations) should be validated against.
currentBlock / currentBlockHashHead block number and hash at query time.
headBlockTimeUtcUTC timestamp of the head block, decoded from the Timestamp pallet.
headBlockAgeSecondsSeconds between the head block's timestamp and now.
A chain can stop producing blocks and still answer every RPC call happily. headBlockAgeSeconds is surfaced specifically so callers can detect this — Centrifuge mainnet has been halted since 2026-06-28, and a naive success check on chainInfo (or on account.getBalance) would read the frozen state as current. Compare headBlockAgeSeconds against your own staleness threshold rather than trusting "success" alone. See Examples for a worked pattern.
headBlockTimeUtc/headBlockAgeSeconds can be null. If the Timestamp.Now storage read returns fewer than 8 bytes (unexpected runtime layout), the node still returns the rest of the chain info successfully, just without an age reading.