Skip to content

Commit 895f999

Browse files
authored
Merge pull request #1190 from multiversx/execution-results-index
Execution results index
2 parents 49f89b2 + c479e02 commit 895f999

5 files changed

Lines changed: 84 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ In order to ensure that the newly added content is correctly aligned and every M
2323

2424
- clone the repository
2525
- run `npm install` (only for the first usage)
26+
- run `npm run build`
2627
- run `npm start`
2728
- access `http://localhost:3000` to view your local version of the docs
2829

docs/sdk-and-tools/elastic-search.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ Each entry in an Elasticsearch index will have a format similar to this:
148148
| [events](/sdk-and-tools/indices/es-index-events) | Contains all the events generated by transactions and smart contract results. |
149149
| [delegators](/sdk-and-tools/indices/es-index-delegators) | Contains details about all the delegators. |
150150
| [operations](/sdk-and-tools/indices/es-index-operations) | Contains all transactions and smart contract results. |
151+
| [executionresults](/sdk-and-tools/indices/es-index-executionresults) | Contains all execution results generated by blocks execution. |
151152

152153
[comment]: # (mx-context-auto)
153154

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
id: es-index-executionresults
3+
title: execution results
4+
description: "Elasticsearch executionresults index: execution result block hash, header fields and example queries."
5+
---
6+
7+
[comment]: # (mx-abstract)
8+
9+
This page describes the structure of the `executionresults` index (Elasticsearch), and also depicts a few examples of how to query it.
10+
11+
[comment]: # (mx-context-auto)
12+
13+
## _id
14+
15+
The _id field of this index is the block hash associated with the execution result, in a hexadecimal encoding.
16+
17+
[comment]: # (mx-context-auto)
18+
19+
## Fields
20+
21+
[comment]: # (table:blocks)
22+
23+
| Field | Description |
24+
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|
25+
| nonce | The nonce field represents the sequence number of the block (block height) associated with the execution result. |
26+
| round | The round field represents the round of the block associated with the execution result. |
27+
| epoch | The epoch field represents the epoch of the block associated with the execution result. |
28+
| miniBlocksHashes | The miniBlocksHashes field contains an array of the miniblock hashes (hexadecimal encoded) that were included in the block. |
29+
| miniBlocksDetails | The miniBlocksDetails field contains an array of structures indicating processing details of the miniblocks, such as the index of the first processed transaction. |
30+
| timestampMs | The timestampMs field represents the timestamp of the block associated with the execution result. |
31+
| rootHash | The rootHash field represents the trie's state root hash when of the block associated with the execution result. |
32+
| shardId | The shardId field represents the shard this block belongs to. |
33+
| txCount | The txCount field represents the number of transactions from the block associated with the execution result. |
34+
| gasUsed | The gasUsed field represents the total gas that was used in the block associated with the execution result. |
35+
| accumulatedFees | The accumulatedFees field represents the accumulated fees that were paid in the block associated with the execution result. |
36+
| developerFees | The developerFees field represents the developer fees that were accumulated in the block. |
37+
| epochStartInfo | The epochStartInfo field is a structure that contains economic data, such as total supply. |
38+
| notarizedInBlockHash | The notarizedInBlockHash field represents the hash of the block in which the execution result was notarized. |
39+
40+
[comment]: # (mx-context-auto)
41+
42+
### Fetch blocks for a shard
43+
In order to fetch the latest execution results from a shard, one has to do a query that matches the field `shardId`.
44+
```
45+
curl --request GET \
46+
--url ${ES_URL}/executionresults/_search \
47+
--header 'Content-Type: application/json' \
48+
--data '{
49+
"query": {
50+
"match": {
51+
"shardId": "1"
52+
}
53+
},
54+
"sort": [
55+
{
56+
"timestamp": {
57+
"order": "desc"
58+
}
59+
}
60+
]
61+
}'
62+
```
63+
64+
### Fetch the latest 10 execution results for all shards
65+
66+
```
67+
curl --request GET \
68+
--url ${ES_URL}/executionresults/_search \
69+
--header 'Content-Type: application/json' \
70+
--data '{
71+
"sort": [
72+
{
73+
"timestamp": {
74+
"order": "desc"
75+
}
76+
}
77+
],
78+
"size":10
79+
}'
80+
```

static/llms-full.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14656,6 +14656,7 @@ Each entry in an Elasticsearch index will have a format similar to this:
1465614656
| [events](/sdk-and-tools/indices/es-index-events) | Contains all the events generated by transactions and smart contract results. |
1465714657
| [delegators](/sdk-and-tools/indices/es-index-delegators) | Contains details about all the delegators. |
1465814658
| [operations](/sdk-and-tools/indices/es-index-operations) | Contains all transactions and smart contract results. |
14659+
| [executionresults](/sdk-and-tools/indices/es-index-executionresults) | Contains all execution results generated by blocks execution. |
1465914660

1466014661

1466114662
## Troubleshooting

static/llms.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ This documentation is organized into major sections. Each section includes tutor
238238
- [Architecture](https://docs.multiversx.com/bridge/architecture): High-level architecture of the Ad‑Astra Bridge: core contracts on MultiversX and EVM chains, relayer quorum, and how cross‑chain transfers are coordinated.
239239
- [Axelar Amplifier Setup](https://docs.multiversx.com/bridge/axelar): Set up an Axelar Amplifier verifier for MultiversX: prerequisites, tofnd and ampd services, configuration, and verification steps.
240240
- [Bitcoin L2](https://docs.multiversx.com/sovereign/bitcoin-l2): Concept and architecture for a Bitcoin‑compatible Sovereign L2 and VM integration.
241-
- [Concept](https://docs.multiversx.com/sovereign/concept): Concept and rationale for Sovereign Chains: performance, configurability, VM options and built‑in cross‑chain mechanism.
241+
- [Concept](https://docs.multiversx.com/sovereign/concept): Learn about MultiversX Sovereign Chain architecture, cross-chain mechanisms, and smart contracts.
242242
- [Cross Chain Execution](https://docs.multiversx.com/sovereign/cross-chain-execution): Concept and flow of cross‑chain execution between MultiversX and Sovereign Chains: contracts, bridge service and fees.
243243
- [Custom Configurations](https://docs.multiversx.com/sovereign/custom-configurations): Configuration options to tailor a Sovereign network: chain ID, economics, ratings and system smart‑contract parameters.
244244
- [Disclaimer](https://docs.multiversx.com/sovereign/disclaimer): Disclaimer on scope: MultiversX provides core chain SDK and scripts; full production infrastructure and some components may require separate integration.

0 commit comments

Comments
 (0)