Get ledger info

Get the latest ledger information, including data such as chain ID, role type, ledger versions, epoch, etc.

If the duration_secs param is provided, this endpoint will return a 200 if the following condition is true:

server_latest_ledger_info_timestamp >= server_current_time_timestamp - duration_secs

Path Parameters:

None

Query Parameters๏ผš

None

Response Header:

X-APTOS-BLOCK-HEIGHT integer

Current block height of the chain

X-APTOS-CHAIN-ID integer

Chain ID of the current chain

X-APTOS-EPOCH integer

Current epoch of the chain

X-APTOS-LEDGER-OLDEST-VERSION integer

Oldest non-pruned ledger version of the chain

X-APTOS-LEDGER-TIMESTAMPUSEC integer

Current timestamp of the chain

X-APTOS-LEDGER-VERSION integer

Current ledger version of the chain

X-APTOS-OLDEST-BLOCK-HEIGHT integer

Oldest non-pruned block height of the chain

Response Body:

The struct holding all data returned to the client by the index endpoint (i.e., GET "/"). Only for responding in JSON

chain_id integer

Chain ID of the current chain

epoch string<uint64>

A string containing a 64-bit unsigned integer.

ledger_version string<uint64>

A string containing a 64-bit unsigned integer.

oldest_ledger_version string<uint64>

A string containing a 64-bit unsigned integer.

ledger_timestamp string<uint64>

A string containing a 64-bit unsigned integer.

node_role string

Allowed values: validator full_node

oldest_block_height string<uint64>

A string containing a 64-bit unsigned integer.

block_height string<uint64>

A string containing a 64-bit unsigned integer.

git_hash string

Example:

// Request
curl -X GET -H 'Content-Type: application/json' https://aptos.blockpi.network/aptos/v1/your_api_key/v1/

// Result
{
    "chain_id": 1,
    "epoch": "487",
    "ledger_version": "36258508",
    "oldest_ledger_version": "0",
    "ledger_timestamp": "1669096800308226",
    "node_role": "full_node",
    "oldest_block_height": "0",
    "block_height": "11667199",
    "git_hash": "3b12b747b53a0dc610b0ea960459bb834a940852"
}

Last updated