diff --git a/docs/developers/tutorials/staking-contract.md b/docs/developers/tutorials/staking-contract.md index 91284b732..b40eb46c9 100644 --- a/docs/developers/tutorials/staking-contract.md +++ b/docs/developers/tutorials/staking-contract.md @@ -218,7 +218,6 @@ Every smart contract needs to have a function annotated with `#[init]`. This fun [comment]: # (mx-context-auto) - ### Creating a devnet wallet :::note @@ -248,7 +247,6 @@ Now that we've created a wallet, it's time to deploy our contract. **Make sure y ```bash - mxpy --verbose contract deploy --bytecode=~/Projects/tutorials/staking-contract/output/staking-contract.wasm \ --recall-nonce --pem=~/Downloads/tutorialKey.pem \ --gas-limit=10000000 \ @@ -264,6 +262,8 @@ More details can be found [here](/developers/constants/). The things you need to edit are the CLI parameters --pem and --project with your local paths. +[comment]: # (mx-context-auto) + ### Account was not found? But I just created the wallet! You're going to see an error like the following: diff --git a/docs/sdk-and-tools/elastic-search-wrong-mappings-fix.md b/docs/sdk-and-tools/elastic-search-wrong-mappings-fix.md index 61b8ab46f..22a0282c8 100644 --- a/docs/sdk-and-tools/elastic-search-wrong-mappings-fix.md +++ b/docs/sdk-and-tools/elastic-search-wrong-mappings-fix.md @@ -14,12 +14,71 @@ for an index, then one should follow the next steps: In the example below we will repair the `operations` index. +[comment]: # (mx-context-auto) + +## Solution 1 + +1. Stop the observers nodes that index data in the Elasticsearch cluster. +2. Force a `rollover` for the index with problems in this case `operations` index and the rollover have to contain the correct + mappings. + ``` + curl --request POST \ + --url ${ES_CLUSTER_URL}/operations/_rollover \ + --header 'Content-Type: application/json' \ + --data '{ + "mappings": { + "properties": { + "esdtValuesNum": { + "type": "double" + }, + {ADD_THE_REST_OF_THE_MAPPINGS_OF_THE_INDEX}:{}, + } + }, + "settings": { + "index": { + "sort.field": [ + "timestamp", + "nonce" + ], + "sort.order": [ + "desc", + "desc" + ] + }, + "number_of_replicas": 0, + "number_of_shards": 5 + } + }' + ``` +3. Make alias `operations` to fetch data from both indices("operations-000001" and "operations-000002"). + + ``` + curl --request POST \ + --url ${ES_CLUSTER_URL}/_aliases \ + --header 'Content-Type: application/json' \ + --data '{ + "actions" : [ + { "add" : { "index" : "operations-000001", "alias" : "operations" } }, + { "add" : { "index" : "operations-000002", "alias" : "operations", "is_write_index" : true } } + ] + }' + ``` + +4. Start again the observers. + +[comment]: # (mx-context-auto) + +## Solution 2 +:::caution +This solution will take more time because all the documents from the index with problems +have to be reindexed from a public cluster. +::: + 1. Stop the observers nodes that index data in the Elasticsearch cluster. 2. Delete affected index: `operations` 3. Create the index again with the correct mappings: - in order to do this, clone this [repository](https://github.com/multiversx/mx-chain-tools-go) - - checkout this branch `mappings-for-all-fields` - - `cd elasticreindexer/indices-creator` + - `cd elasticreindexer/cmd/indices-creator` - open `config/cluster.toml` file and update it with the information about your cluster and at the `enabled-indices` section put `["operations"]` - build the binary and run it in order to create the index with the correct mappings. @@ -27,3 +86,4 @@ In the example below we will repair the `operations` index. 4. After the index was created you can start again the observers. 5. Copy all the data from a public Elasticsearch cluster for the index with problems. - in order to do this follow the steps from this [documentation](https://github.com/multiversx/mx-chain-tools-go/tree/mappings-for-all-fields/elasticreindexer#step-2) (only for the index/indices with problems) + diff --git a/docs/sdk-and-tools/indices/accounts.md b/docs/sdk-and-tools/indices/accounts.md index 12bc9b58f..954ba88e5 100644 --- a/docs/sdk-and-tools/indices/accounts.md +++ b/docs/sdk-and-tools/indices/accounts.md @@ -17,14 +17,17 @@ The `_id` field of this index is represented by a bech32 encoded address. ## Fields -| Field | Description | -|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| address | The address field holds the address in a bech32 encoding. Should be equal to the _id field. | -| balance | The balance field holds the amount of EGLD the address possesses. It is a string that also includes the number of decimals. Example: "1500000000000000000" (equivalent to 1.5 EGLD). | -| balanceNum | The balanceNum field holds the amount of EGLD the address possesses, in a numeric format. Example: 1.5. | -| nonce | The nonce field represents the sequence number of the address. | -| shardID | The shardID field represents the shard where the address belongs to, based on its bytes. | -| timestamp | The timestamp field represents the last moment when the address balance was changed. | +| Field | Description | +|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| address | The address field holds the address in a bech32 encoding. Should be equal to the _id field. | +| balance | The balance field holds the amount of EGLD the address possesses. It is a string that also includes the number of decimals. Example: "1500000000000000000" (equivalent to 1.5 EGLD). | +| balanceNum | The balanceNum field holds the amount of EGLD the address possesses, in a numeric format. Example: 1.5. | +| nonce | The nonce field represents the sequence number of the address. | +| shardID | The shardID field represents the shard where the address belongs to, based on its bytes. | +| timestamp | The timestamp field represents the last moment when the address balance was changed. | +| developerRewards | The developerRewards represents the fees that were accumulated after all the smart contract calls. They can be claimed by the owner. | +| currentOwner | The currentOwner field holds the address in a bech32 format of the current owner of the smart contract. This field is populated only for the smart contract addresses. | +| userName | The userName field contains the herotag the address possesses. | [comment]: # (mx-context-auto) @@ -74,3 +77,20 @@ curl --request GET \ "size":10 }' ``` + +[comment]: # (mx-context-auto) + +### Fetch addresses with username + +``` +curl --request GET \ + --url ${ES_URL}/accounts/_search \ + --header 'Content-Type: application/json' \ + --data '{ + "query": { + "exists": { + "field": "userName" + } + } +}' +``` diff --git a/docs/sdk-and-tools/indices/accountsesdt.md b/docs/sdk-and-tools/indices/accountsesdt.md index 03d8796c1..1b3ea80a1 100644 --- a/docs/sdk-and-tools/indices/accountsesdt.md +++ b/docs/sdk-and-tools/indices/accountsesdt.md @@ -17,17 +17,18 @@ The `_id` field of this index is composed in this way: `{bech32address}_{tokenId ## Fields -| Field | Description | -|-------------|---------------------------------------------------------------------------------------------------------------------------------------| -| identifier | The identifier field consists of `token` field and the `nonce` field hex encoded (example: `TOKEN-01abdc-01`). | -| address | The address field holds the address in a bech32 encoding. | -| balance | The balance field holds the amount of ESDT token the address possesses. It includes the number of decimals. | -| balanceNum | The balanceNum field holds the amount of ESDT tokens the address possesses, in a numeric format. | -| data | The data field is a structure that contains extra data about a token, such as the creator of an NFT. | -| tokenNonce | The tokenNonce field holds the sequence number of the token. This field is empty in the case of `FungibleESDT`. | -| token | The token field holds the name of the token. | -| timestamp | The timestamp field represents the timestamp when the address balance was changed. | -| type | The type field represents the type of the ESDT token. It can be `FungibleESDT`, `NonFungibleESDT`, `SemiFungibleESDT`, or `MetaESDT`. | +| Field | Description | +|------------|---------------------------------------------------------------------------------------------------------------------------------------| +| identifier | The identifier field consists of `token` field and the `nonce` field hex encoded (example: `TOKEN-01abdc-01`). | +| address | The address field holds the address in a bech32 encoding. | +| balance | The balance field holds the amount of ESDT token the address possesses. It includes the number of decimals. | +| balanceNum | The balanceNum field holds the amount of ESDT tokens the address possesses, in a numeric format. | +| data | The data field is a structure that contains extra data about a token, such as the creator of an NFT. | +| tokenNonce | The tokenNonce field holds the sequence number of the token. This field is empty in the case of `FungibleESDT`. | +| token | The token field holds the name of the token. | +| timestamp | The timestamp field represents the timestamp when the address balance was changed. | +| type | The type field represents the type of the ESDT token. It can be `FungibleESDT`, `NonFungibleESDT`, `SemiFungibleESDT`, or `MetaESDT`. | +| frozen | The frozen field is set to true when the address possesses a current ESDT token that is in a frozen state. | Docs with a non-empty `tokenNonce` field will have the `data` field populated with the following structure: diff --git a/docs/sdk-and-tools/indices/accountsesdthistory.md b/docs/sdk-and-tools/indices/accountsesdthistory.md index 7b08962b5..ca9261fba 100644 --- a/docs/sdk-and-tools/indices/accountsesdthistory.md +++ b/docs/sdk-and-tools/indices/accountsesdthistory.md @@ -17,14 +17,16 @@ The `_id` field of this index is composed in this way: `{bech32address}_{tokenId ## Fields -| Field | Description | -|------------|---------------------------------------------------------------------------------------------------------------------| -| address | The address field holds the address in a bech32 encoding. | -| balance | The balance field holds the amount of ESDT tokens the address possesses. | -| token | The token field holds the token name of the token. | -| identifier | The identifier field is composed of the `token` field and the `nonce` field, hex encoded. | -| tokenNonce | The tokenNonce field holds the sequence number of the token. This field can be empty in the case of `FungibleESDT`. | -| timestamp | The timestamp field represents the timestamp when the address balance was changed. | +| Field | Description | +|-----------------|---------------------------------------------------------------------------------------------------------------------| +| address | The address field holds the address in a bech32 encoding. | +| balance | The balance field holds the amount of ESDT tokens the address possesses. | +| token | The token field holds the token name of the token. | +| identifier | The identifier field is composed of the `token` field and the `nonce` field, hex encoded. | +| tokenNonce | The tokenNonce field holds the sequence number of the token. This field can be empty in the case of `FungibleESDT`. | +| timestamp | The timestamp field represents the timestamp when the address balance was changed. | +| isSmartContract | The isSmartContract field is true if the address is a smart contract address. | +| shardID | The shardID field represents the shard where the address belongs to, based on its bytes. | [comment]: # (mx-context-auto) diff --git a/docs/sdk-and-tools/indices/accountshistory.md b/docs/sdk-and-tools/indices/accountshistory.md index 8eba4f892..c268de057 100644 --- a/docs/sdk-and-tools/indices/accountshistory.md +++ b/docs/sdk-and-tools/indices/accountshistory.md @@ -17,12 +17,14 @@ The `_id` field of this index is composed in this way: `{bech32address}_{timesta ## Fields -| Field | Description | -|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| address | The address field holds the address in a bech32 encoding. | -| balance | The balance field holds the amount of EGLD the address possesses. It is a string that also includes the number of decimals. Example: "1500000000000000000" (equivalent to 1.5 EGLD). | -| isSender | The isSender field is true if the address was the sender when the balance has changed. | -| timestamp | The timestamp field represents the timestamp when the address balance was changed. | +| Field | Description | +|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| address | The address field holds the address in a bech32 encoding. | +| balance | The balance field holds the amount of EGLD the address possesses. It is a string that also includes the number of decimals. Example: "1500000000000000000" (equivalent to 1.5 EGLD). | +| isSender | The isSender field is true if the address was the sender when the balance has changed. | +| timestamp | The timestamp field represents the timestamp when the address balance was changed. | +| isSmartContract | The isSmartContract field is true if the address is a smart contract address. | +| shardID | The shardID field represents the shard where the address belongs to, based on its bytes. | [comment]: # (mx-context-auto) diff --git a/docs/sdk-and-tools/indices/delegators.md b/docs/sdk-and-tools/indices/delegators.md index a65e25c6f..1f29bc710 100644 --- a/docs/sdk-and-tools/indices/delegators.md +++ b/docs/sdk-and-tools/indices/delegators.md @@ -23,6 +23,16 @@ The `_id` field of this index is composed in this way: `blake2bHash(delegatorAdd | contract | This field holds the bech32 encoded address of the staking provider contract to whom it was delegated to. | | activeStake | The activeStake field holds the EGLD amount of the active stake (not undelegated nor unbondable). | | activeStakeNum | The activeStake field holds the EGLD amount of the active stake (not undelegated nor unbondable), in a numeric format. Example: 1.5. | +| unDelegateInfo | The unDelegateInfo contains a list with data about the unDelegated values. | +| timestamp | The timestamp field represents the last moment of an interaction with the delegation contract. | + +The `unDelegateInfo` field is populated with the fields below: + +| unDelegateInfo fields | Description | +|-----------------------|-------------------------------------------------------------------------------------------------| +| value | The value field holds the EGLD amount that was undelegated. | +| valueNum | The value field holds the EGLD amount that was undelegated, in a numeric format (example: 1.5). | +| timestamp | The timestamp field represents the timestamp when the unDelegation operation was done. | [comment]: # (mx-context-auto) diff --git a/docs/sdk-and-tools/indices/scresults.md b/docs/sdk-and-tools/indices/scresults.md index d15f1c027..c0aad0587 100644 --- a/docs/sdk-and-tools/indices/scresults.md +++ b/docs/sdk-and-tools/indices/scresults.md @@ -47,6 +47,7 @@ The `_id` field for this index is composed of hex encoded smart contract result | operation | The operation field represents the operation of the smart contract result based on the data field. | | function | The function field holds the name of the function that is called in case of a smart contract call. | | originalSender | The originalSender field holds the sender's address of the original transaction. | +| hasLogs | The hasLogs field is true if the transaction has logs. | [comment]: # (mx-context-auto) diff --git a/docs/sdk-and-tools/indices/tokens.md b/docs/sdk-and-tools/indices/tokens.md index 234311332..a8f345fba 100644 --- a/docs/sdk-and-tools/indices/tokens.md +++ b/docs/sdk-and-tools/indices/tokens.md @@ -27,6 +27,7 @@ The `_id` field of this index is represented by token identifier of an ESDT toke | type | The type field holds the type of the token. It can be `FungibleESDT`, `NonFungibleESDT`, `SemiFungibleESDT`, or `MetaESDT`. | | timestamp | The timestamp field represents the timestamp of the block in which the token was created. | | ownersHistory | The ownersHistory field holds a list of all the owners of a token. | +| paused | The paused field is true if the token is paused. | [comment]: # (mx-context-auto) diff --git a/docs/sdk-and-tools/indices/transactions.md b/docs/sdk-and-tools/indices/transactions.md index a8d57d6a6..7473567af 100644 --- a/docs/sdk-and-tools/indices/transactions.md +++ b/docs/sdk-and-tools/indices/transactions.md @@ -18,39 +18,40 @@ The `_id` field for this index is composed of hex encoded transaction hash. ## Fields -| Field | Description | -|-------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| miniBlockHash | The miniBlockHash represents the hash of the miniblock in which the transaction was included. | -| nonce | The nonce field represents the transaction sequence number of the sender address. | -| round | The round field represents the round of the block when the transaction was executed. | -| value | The value field represents the amount of EGLD to be sent from the sender to the receiver. | -| receiver | The receiver field represents the destination address of the transaction. | -| sender | The sender field represents the address of the transaction sender. | -| receiverShard | The receiverShard field represents the shard ID of the receiver address. | -| senderShard | The senderShard field represents the shard ID of the sender address. | -| gasPrice | The gasPrice field represents the amount to be paid for each gas unit. | -| gasLimit | The gasLimit field represents the maximum gas units the sender is willing to pay for. | | -| gasUsed | The gasUsed field represents the amount of gas used by the transaction. | -| fee | The fee field represents the amount of EGLD the sender paid for the transaction. | -| initialPaidFee | The initialPaidFee field represents the initial amount of EGLD the sender paid for the transaction, before the refund. | -| data | The data field holds additional information for a transaction. It can contain a simple message, a function call, an ESDT transfer payload, or so on. | -| signature | The signature obtained by the sender after signing the transaction. It is hex-encoded. | -| timestamp | The timestamp field represents the timestamp of the block in which the transaction was executed. | -| status | The status field represents the status of the transaction. | -| senderUserName | The senderUserName field represents the username of the sender address. | -| receiverUserName | The receiverUserName field represents the username of the receiver address. | -| hasScResults | The hasScResults field is true if the transaction has smart contract results. | -| isScCall | The isScCall field is true if the transaction is a smart contract call. | -| hasOperations | The hasOperations field is true if the transaction has smart contract results or logs. | -| tokens | The tokens field contains a list of ESDT tokens that are transferred based on the data field. The indices from the `tokens` list are linked with the indices from `esdtValues` list. | -| esdtValues | The esdtValues field contains a list of ESDT values that are transferred based on the data field. | -| receivers | The receivers field contains a list of receiver addresses in case of ESDTNFTTransfer or MultiESDTTransfer. | -| receiversShardIDs | The receiversShardIDs field contains a list of receiver addresses shard IDs. | -| type | The type field represents the type of the transaction based on the data field. | -| operation | The operation field represents the operation of the transaction based on the data field. | -| function | The function field holds the name of the function that is called in case of a smart contract call. | -| isRelayed | The isRelayed field is true if the transaction is a relayed transaction. | -| version | The version field represents the version of the transaction. | +| Field | Description | +|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| miniBlockHash | The miniBlockHash represents the hash of the miniblock in which the transaction was included. | +| nonce | The nonce field represents the transaction sequence number of the sender address. | +| round | The round field represents the round of the block when the transaction was executed. | +| value | The value field represents the amount of EGLD to be sent from the sender to the receiver. | +| receiver | The receiver field represents the destination address of the transaction. | +| sender | The sender field represents the address of the transaction sender. | +| receiverShard | The receiverShard field represents the shard ID of the receiver address. | +| senderShard | The senderShard field represents the shard ID of the sender address. | +| gasPrice | The gasPrice field represents the amount to be paid for each gas unit. | +| gasLimit | The gasLimit field represents the maximum gas units the sender is willing to pay for. | | +| gasUsed | The gasUsed field represents the amount of gas used by the transaction. | +| fee | The fee field represents the amount of EGLD the sender paid for the transaction. | +| initialPaidFee | The initialPaidFee field represents the initial amount of EGLD the sender paid for the transaction, before the refund. | +| data | The data field holds additional information for a transaction. It can contain a simple message, a function call, an ESDT transfer payload, or so on. | +| signature | The signature obtained by the sender after signing the transaction. It is hex-encoded. | +| timestamp | The timestamp field represents the timestamp of the block in which the transaction was executed. | +| status | The status field represents the status of the transaction. | +| senderUserName | The senderUserName field represents the username of the sender address. | +| receiverUserName | The receiverUserName field represents the username of the receiver address. | +| hasScResults | The hasScResults field is true if the transaction has smart contract results. | +| isScCall | The isScCall field is true if the transaction is a smart contract call. | +| hasOperations | The hasOperations field is true if the transaction has smart contract results. | +| tokens | The tokens field contains a list of ESDT tokens that are transferred based on the data field. The indices from the `tokens` list are linked with the indices from `esdtValues` list. | +| esdtValues | The esdtValues field contains a list of ESDT values that are transferred based on the data field. | +| receivers | The receivers field contains a list of receiver addresses in case of ESDTNFTTransfer or MultiESDTTransfer. | +| receiversShardIDs | The receiversShardIDs field contains a list of receiver addresses shard IDs. | +| type | The type field represents the type of the transaction based on the data field. | +| operation | The operation field represents the operation of the transaction based on the data field. | +| function | The function field holds the name of the function that is called in case of a smart contract call. | +| isRelayed | The isRelayed field is true if the transaction is a relayed transaction. | +| version | The version field represents the version of the transaction. | +| hasLogs | The hasLogs field is true if the transaction has logs. | [comment]: # (mx-context-auto) diff --git a/docs/validators/key-management/multikey-nodes.md b/docs/validators/key-management/multikey-nodes.md index 30fe929ab..75bc14cc5 100644 --- a/docs/validators/key-management/multikey-nodes.md +++ b/docs/validators/key-management/multikey-nodes.md @@ -7,6 +7,7 @@ title: Multikey nodes management This page contains information about how to manage multiple keys on a group of nodes. [comment]: # (mx-context-auto) + ## Multikey architecture overview Since the mainnet launch, and up until the release candidate RC/v1.6.0, each node could have managed only @@ -40,6 +41,7 @@ The following image describes the keys and nodes relationship between the single ![img](/validators/multikey-diagram.drawio.png) [comment]: # (mx-context-auto) + ## General implementation details The nodes running with the multikey feature, beside deciding the consensus group (which is normally done on each node), @@ -48,6 +50,7 @@ key is part of the consensus group. The code changes to support multikey nodes affected mainly the `consensus`, `keyManagement` and `heartbeat` packages. [comment]: # (mx-context-auto) + ### Heartbeat information The group managing the set of keys (we will call them multikey nodes or multikey group), will pass the validators BLS @@ -56,6 +59,7 @@ connect to as it does not have a real address bind to. Consequentially, this fea the multikey nodes will hide the relationship between the validator BLS keys and the host that manages those BLS keys. [comment]: # (mx-context-auto) + ### Redundancy The redundancy sub-system has been upgraded to accommodate the multikey requirements keeping the multiple redundancy @@ -68,6 +72,7 @@ then, the fallback group, after `k` misses in the consensus activity (propose/si was the only key assigned to the multikey group (`k` is the value defined in the `prefs.toml` file, `RedundancyLevel` option). [comment]: # (mx-context-auto) + ## Economics running multikey nodes As for `n` managed keys we will need at least a group of nodes, there is a threshold that a staking operator @@ -76,9 +81,11 @@ operator when the number of managed keys is greater or equal of the number of sh at least 4 keys that are either *eligible* or *waiting*, the switch to multikey mode becomes feasible. [comment]: # (mx-context-auto) + ## Usage [comment]: # (mx-context-auto) + ### allValidatorsKeys.pem file The switch towards the multikey operation will only require aggregating all BLS keys in a new file, called `allValidatorsKeys.pem` that will be loaded by default from the same directory where the `validatorKey.pem` file resides. The path can be altered by using the @@ -100,6 +107,7 @@ NTA4YjFjMTVlYTIwNDYyMw== ``` [comment]: # (mx-context-auto) + ### prefs.toml file The existing fields `NodeDisplayName` and `Identity` will be applied to all managed and loaded BLS keys. The `NodeDisplayName` will @@ -135,4 +143,4 @@ which will generate the naming as: example-0 e296e97524483e6b59... example-1 585ddceb6b7bf0d308... random-0 791c7e2bd6a5fb1371... -``` \ No newline at end of file +```