sync_blocks - Bitcoin Cash

Example code for the sync_blocks json-rpc method. Сomplete guide on how to use sync_blocks json-rpc in GetBlock.io Web3 documentation.

Parameters

sparse_chain - array of string

A specific sequence of local block hashes.

Sparse_chain is a sequence of blocks hashes from the last known block to genesis block. It goes backward into blockchain like this: last ten blocks, then block in 2 blocks, block in 4 blocks, block in 8 blocks, ..., genesis block.

first_block_timestamp - timestamp

Optional.

bytecoind won't return blocks earlier than this point in time.

max_count - uint32

Optional.

Maximum number of blocks to return.

Request

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' 
--header 'Content-Type: application/json' 
--data-raw '{"jsonrpc": "2.0",
"method": "sync_blocks",
"params": {"sparse_chain": ["856c8547ad1864cc08664df8b41ebdd6ab8a01dd7ba04cbc06a428d64cd7e844"], "max_count": 2},
"id": "getblock.io"}'

Response

Last updated

Was this helpful?