Skip to content

Commit d4aea76

Browse files
authored
Merge pull request #1064 from multiversx/ag/ask-ai
Ag/ask ai
2 parents ec1cf7e + 6eb2fee commit d4aea76

File tree

31 files changed

+1138
-24
lines changed

31 files changed

+1138
-24
lines changed

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

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -125,27 +125,28 @@ Each entry in an Elasticsearch index will have a format similar to this:
125125
}
126126
```
127127

128-
| Name | Description |
129-
| -------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
130-
| [transactions](/sdk-and-tools/indices/es-index-transactions) | Contains all transactions. |
131-
| [blocks](/sdk-and-tools/indices/es-index-blocks) | Contains all executed blocks. |
132-
| [validators](/sdk-and-tools/indices/es-index-validators) | Contains the public keys of the validators grouped by epoch and shard. |
133-
| [rating](/sdk-and-tools/indices/es-index-rating) | Contains the validators' rating for every epoch. |
134-
| [miniblocks](/sdk-and-tools/indices/es-index-miniblocks) | Contains all executed minblocks. |
135-
| [rounds](/sdk-and-tools/indices/es-index-rounds) | Contains details of each round that has passed. |
136-
| [accounts](/sdk-and-tools/indices/es-index-accounts) | Contains the addresses' balances and the timestamp when they were modified. |
137-
| [accountshistory](/sdk-and-tools/indices/es-index-accountshistory) | Contains historical information about the address balances. |
138-
| [receipts](/sdk-and-tools/indices/es-index-receipts) | Contains all generated receipts. |
139-
| [scresults](/sdk-and-tools/indices/es-index-scresults) | Contains all generated smart contract results. |
140-
| [accountsesdt](/sdk-and-tools/indices/es-index-accountsesdt) | Contains the addresses' ESDT balances. |
141-
| [accountsesdthistory](/sdk-and-tools/indices/es-index-accountsesdthistory) | Contains historical information about the address ESDT balances. |
142-
| [epochinfo](/sdk-and-tools/indices/es-index-epochinfo) | Contains the accumulated fees and the developer fees grouped by epochs. |
143-
| [scdeploys](/sdk-and-tools/indices/es-index-scdeploys) | Contains details about all the deployed smart contracts. |
144-
| [tokens](/sdk-and-tools/indices/es-index-tokens) | Contains all created ESDT tokens. |
145-
| [tags](/sdk-and-tools/indices/es-index-tags) | Contains the NFTs' tags. |
146-
| [logs](/sdk-and-tools/indices/es-index-logs) | Contains all the logs generated by transactions and smart contract results. |
147-
| [delegators](/sdk-and-tools/indices/es-index-delegators) | Contains details about all the delegators. |
148-
| [operations](/sdk-and-tools/indices/es-index-operations) | Contains all transactions and smart contract results. |
128+
| Name | Description |
129+
|----------------------------------------------------------------------------|-------------------------------------------------------------------------------|
130+
| [transactions](/sdk-and-tools/indices/es-index-transactions) | Contains all transactions. |
131+
| [blocks](/sdk-and-tools/indices/es-index-blocks) | Contains all executed blocks. |
132+
| [validators](/sdk-and-tools/indices/es-index-validators) | Contains the public keys of the validators grouped by epoch and shard. |
133+
| [rating](/sdk-and-tools/indices/es-index-rating) | Contains the validators' rating for every epoch. |
134+
| [miniblocks](/sdk-and-tools/indices/es-index-miniblocks) | Contains all executed minblocks. |
135+
| [rounds](/sdk-and-tools/indices/es-index-rounds) | Contains details of each round that has passed. |
136+
| [accounts](/sdk-and-tools/indices/es-index-accounts) | Contains the addresses' balances and the timestamp when they were modified. |
137+
| [accountshistory](/sdk-and-tools/indices/es-index-accountshistory) | Contains historical information about the address balances. |
138+
| [receipts](/sdk-and-tools/indices/es-index-receipts) | Contains all generated receipts. |
139+
| [scresults](/sdk-and-tools/indices/es-index-scresults) | Contains all generated smart contract results. |
140+
| [accountsesdt](/sdk-and-tools/indices/es-index-accountsesdt) | Contains the addresses' ESDT balances. |
141+
| [accountsesdthistory](/sdk-and-tools/indices/es-index-accountsesdthistory) | Contains historical information about the address ESDT balances. |
142+
| [epochinfo](/sdk-and-tools/indices/es-index-epochinfo) | Contains the accumulated fees and the developer fees grouped by epochs. |
143+
| [scdeploys](/sdk-and-tools/indices/es-index-scdeploys) | Contains details about all the deployed smart contracts. |
144+
| [tokens](/sdk-and-tools/indices/es-index-tokens) | Contains all created ESDT tokens. |
145+
| [tags](/sdk-and-tools/indices/es-index-tags) | Contains the NFTs' tags. |
146+
| [logs](/sdk-and-tools/indices/es-index-logs) | Contains all the logs generated by transactions and smart contract results. |
147+
| [events](/sdk-and-tools/indices/es-index-events) | Contains all the events generated by transactions and smart contract results. |
148+
| [delegators](/sdk-and-tools/indices/es-index-delegators) | Contains details about all the delegators. |
149+
| [operations](/sdk-and-tools/indices/es-index-operations) | Contains all transactions and smart contract results. |
149150

150151
[comment]: # (mx-context-auto)
151152

docs/sdk-and-tools/indices/blocks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The `_id` field of this index is represented by the block hash, in a hexadecimal
3838
| shardId | The shardId field represents the shard this block belongs to. |
3939
| txCount | The txCount field represents the number of transactions that were executed in the block. |
4040
| notarizedTxsCount | The notarizedTxsCount field represents the number of transactions that were notarized in the block. |
41-
| accumulatedFees | The accumulatedFees field represents the accumulated fees that were paid in the block. |
41+
| accumulatedFees | The accumulatedFees field represents the accumulated fees that were paid in the block. |
4242
| developerFees | The developerFees field represents the developer fees that were accumulated in the block. |
4343
| epochStartBlock | The epochStartBlock field is true if the current block is an epoch-start block. |
4444
| epochStartInfo | The epochStartInfo field is a structure that contains economic data, such as total supply. |
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
id: es-index-events
3+
title: events
4+
---
5+
6+
[comment]: # (mx-abstract)
7+
8+
This page describes the structure of the `events` index (Elasticsearch), and also depicts a few examples of how to query it.
9+
10+
[comment]: # (mx-context-auto)
11+
12+
## _id
13+
14+
The `_id` field for this index is composed of hex-encoded hash of the transaction or the smart contract result that generated the log plus shard ID and order of event
15+
16+
example: `{hash}-{shardID}-{order}` (example: `abcd-2-1`).
17+
18+
[comment]: # (mx-context-auto)
19+
20+
## Fields
21+
22+
| Field | Description |
23+
|----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
24+
| logAddress | The address field holds the address in bech32 encoding. It can be the address of the smart contract that generated the log or the address of the receiver of the transaction. |
25+
| address | The address field holds the address in bech32 encoding. It can be the address of the smart contract that generated the event or the address of the receiver of the transaction. |
26+
| txHash | The txHash field field for this index is composed of hex-encoded hash of the transaction or the smart contract result that generated the log. |
27+
| originalTxHash | The originalTxHash field holds the hex-encoded hash of the initial transaction. When this field is not empty the log is generated by a smart contract result and this field represents the hash of the initial transaction. |
28+
| timestamp | The timestamp field represents the timestamp of the block in which the log was generated. |
29+
| identifier | This field represents the identifier of the event. |
30+
| topics | The topics field holds a list with extra information, hex-encoded. They don't have a specific order because the smart contract is free to log anything that could be helpful. |
31+
| data | The data field can contain information added by the smart contract that generated the event, hex-encoded. |
32+
| order | The order field represents the index of the event indicating the execution order. |
33+
| txOrder | The txOrder field represents the execution order of transaction/smart contract who generated this event. |
34+
| timestamp | The timestamp field represents the timestamp of the block in which the event was generated. |
35+
| shardID | The shardID field represents the shard this events belongs to. |
36+
37+
38+
## Query examples
39+
40+
### Fetch all the events generated by a transaction
41+
42+
```
43+
curl --request GET \
44+
--url ${ES_URL}/events/_search \
45+
--header 'Content-Type: application/json' \
46+
--data '{
47+
"query": {
48+
"match": {
49+
"txHash":"d6.."
50+
}
51+
}
52+
}'
53+
```
54+
55+
### Fetch all the events generated by a transaction and the smart contract results triggered by it
56+
57+
```
58+
curl --request GET \
59+
--url ${ES_URL}/events/_search \
60+
--header 'Content-Type: application/json' \
61+
--data '{
62+
"query": {
63+
"bool": {
64+
"should": [
65+
{
66+
"match": {
67+
"_id":"d6.."
68+
}
69+
},
70+
{
71+
"match": {
72+
"originalTxHash": "d6.."
73+
}
74+
}
75+
]
76+
}
77+
}
78+
}'
79+
```

docs/sdk-and-tools/indices/logs.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ This page describes the structure of the `logs` index (Elasticsearch), and also
1111

1212
## _id
1313

14+
:::warning Important
15+
16+
**The `logs` index will be deprecated and removed in the near future.**
17+
We recommend using the [events](/sdk-and-tools/indices/es-index-events) index, which contains all the events included in a log.
18+
19+
Please make the necessary updates to ensure a smooth transition.
20+
If you need further assistance, feel free to reach out.
21+
:::
22+
1423
The `_id` field for this index is composed of hex-encoded hash of the transaction of the smart contract result that generated the log.
1524

1625
[comment]: # (mx-context-auto)

0 commit comments

Comments
 (0)