getchaintips
Returns all known tips in the block tree, including the main chain and orphaned branches. This method uses 80 credits from your daily balance.
Parameters
None
Returns
result: (array) - Chain tips. Each tip contains:
height: (integer) - Height of the tip.hash: (string) - Block hash of the tip.branchlen: (integer) - Length of the branch connecting the tip to the main chain.0for the main chain.status: (string) - Status of the branch. One of:active- The tip of the main chain.valid-fork- A fully validated branch that isn't part of the main chain.valid-headers- All blocks are available but haven't been fully validated.headers-only- Not all blocks are available, but the headers are valid.invalid- The branch contains at least one invalid block.
Request
- curl
curl https://bitcoin-mainnet.infura.io/v3/<YOUR-API-KEY> \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "id": 1, "method": "getchaintips", "params": []}'
Response
- JSON
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"height": 971402,
"hash": "00000000000000000000d5e7a6f1b2c39484a5b6c7d8e9f0a1b2c3d4e5f60718",
"branchlen": 0,
"status": "active"
},
{
"height": 968215,
"hash": "0000000000000000000127c4e9b3a8f5d2c1e0b9a8f7e6d5c4b3a29180716253",
"branchlen": 1,
"status": "valid-fork"
}
]
}