Skip to content

Blocks API

Used to retrieve blocks and shard chunks from the chain.

API

Method NameRequest TypeResponse TypeDescription
GetBlocksBlocksRequeststream BlockReturns a stream of blocks for a given shard
GetShardChunksShardChunksRequestShardChunksResponseReturns chunks of serialized block data

BlocksRequest

FieldTypeLabelDescription
shard_iduint32ID of the shard to get blocks from
start_block_numberuint64Block number to start from (inclusive)
stop_block_numberuint64optionalBlock number to stop at (inclusive)

ShardChunksRequest

FieldTypeLabelDescription
shard_iduint32ID of the shard to get chunks from
start_block_numberuint64Block number to start from (inclusive)
stop_block_numberuint64optionalBlock number to stop at (inclusive)

ShardChunksResponse

FieldTypeLabelDescription
shard_chunksShardChunkrepeatedArray of shard chunks

Block

FieldTypeLabelDescription
headerBlockHeaderHeader info for the block
messagesMessagerepeatedArray of messages in the block