Skip to main content

blocks

This page describes the structure of the blocks index (Elasticsearch), and also depicts a few examples of how to query it.

_id

The _id field of this index is represented by the block hash, in a hexadecimal encoding.

Fields

FieldDescription
nonceThe nonce field represents the sequence number of the block (block height).
roundThe round field represents the round when the block was proposed and executed.
epochThe epoch field represents the epoch when the block was proposed and executed.
miniBlocksHashesThe miniBlocksHashes field contains an array of the miniblock hashes (hexadecimal encoded) that were included in the block.
miniBlocksDetailsThe miniBlocksDetails field contains an array of structures indicating processing details of the miniblocks, such as the index of the first processed transaction.
notarizedBlocksHashesThe notarizedBlocksHashes field represents the hashes of the blocks that were notarized in the current block.
proposerThe proposer field represents the index of the validator that proposed the block.
validatorsThe validators field is an array that contains the indices of the validators that signed the block.
pubKeyBitmapThe pubKeyBitmap field represents the pub key bitmap.
sizeThe size field represents the size of the block in bytes.
sizeTxsThe sizeTxs field holds the size of the block's transactions in bytes.
timestampThe timestamp field represents the timestamp when the block was proposed and executed.
stateRootHashThe stateRootHash field represents the trie's state root hash when the block was proposed and executed.
prevHashThe prevHash field represents the hash of the previous block.
shardIdThe shardId field represents the shard this block belongs to.
txCountThe txCount field represents the number of transactions that were executed in the block.
notarizedTxsCountThe notarizedTxsCount field represents the number of transactions that were notarized in the block.
accumulatedFeesThe accumulatedFees field represents the accumulated fees that were paid in the block.
developerFeesThe developerFees field represents the developer fees that were accumulated in the block.
epochStartBlockThe epochStartBlock field is true if the current block is an epoch-start block.
epochStartInfoThe epochStartInfo field is a structure that contains economic data, such as total supply.
gasProvidedThe gasProvided field represents the total gas that was provided in the block.
gasRefundedThe gasRefunded field represents the total gas that was refunded in the block.
gasPenalizedThe gasPenalized field represents the total gas that was penalized in the block.
maxGasLimitThe maxGasLimit field represents the total gas that can be provided in the block.
scheduledDataThe scheduledData field is a structure that contains data about the scheduled execution.
epochStartShardsDataThe epochStartShardsData field is an array of structures that contains epoch-start data for each shard, such as pending miniblocks.

A metachain block (shardId:4294967295) with field epochStartBlock:true will have the field epochStartInfo field populated with the next data:

epochStartInfo fieldsDescription
totalSupplyThe totalSupply field represents the EGLD supply.
totalToDistributeThe totalToDistribute field represents the amount of EGLD that will be distributed to validators/delegators.
totalNewlyMintedThe totalNewlyMinted field represents the amount of the newly minted EGLD.
rewardsPerBlockThe rewardsPerBlock field represents the amount of EGLD rewards per block.
rewardsForProtocolSustainabilityThe rewardsForProtocolSustainability field represents the amount of rewards for the protocol sustainability address.
nodePriceThe nodePrice field represents EGLD amount required to run a validator.
prevEpochStartRoundThe prevEpochStartRound field represents the round of the previous epoch start block.
prevEpochStartHashThe prevEpochStartHash field represents the hash of the previous epoch start block.

Query examples

Fetch blocks for a shard

In order to fetch the latest blocks from a shard, one has to do a query that matches the field shardId.

curl --request GET \
--url ${ES_URL}/blocks/_search \
--header 'Content-Type: application/json' \
--data '{
"query": {
"match": {
"shardId": "1"
}
},
"sort": [
{
"timestamp": {
"order": "desc"
}
}
]
}'

Fetch the latest 10 blocks for all shards

curl --request GET \
--url ${ES_URL}/blocks/_search \
--header 'Content-Type: application/json' \
--data '{
"sort": [
{
"timestamp": {
"order": "desc"
}
}
],
"size":10
}'