Skip to main content

miniblocks

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

_id

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

Fields

FieldDescription
senderShardThe senderShard field represents the shard ID of the source block.
receiverShardThe receiverShard field represents the shard ID of the destination block.
senderBlockHashThe senderBlockHash field represents the hash (hex encoded) of the source block in which the miniblock was included.
receiverBlockHashThe receiverBlockHash field represents the hash (hex encoded) of the destination block in which the miniblock was included.
typeThe type field represents the type of the miniblock. It can be TxBlock (if it contains transactions) or SmartContractResultBlock (if it contains smart contracts results).
procTypeSThe procTypeS field represents the processing type at the source shard. It can be Normal or Scheduled.
procTypeDThe procTypeD field represents the processing type at the destination shard. It can be Normal or Scheduled.
timestampThe timestamp field represents the timestamp of the block in which the miniblock was executed.
reservedThe reserved field ensures the possibility to extend the mini block.

Query examples

Fetch all the miniblocks of a block

curl --request GET \
--url ${ES_URL}/miniblocks/_search \
--header 'Content-Type: application/json' \
--data '{
"query": {
"bool": {
"should": [
{
"match": {
"senderBlockHash": "ddc..."
}
},
{
"match": {
"receiverBlockHash": "ddc..."
}
}
]
}
}
}'