diff --git a/docs/developers/developer-reference/upgrading-smart-contracts.md b/docs/developers/developer-reference/upgrading-smart-contracts.md index cc98c99fb..a0e36c682 100644 --- a/docs/developers/developer-reference/upgrading-smart-contracts.md +++ b/docs/developers/developer-reference/upgrading-smart-contracts.md @@ -40,7 +40,7 @@ Let's assume we deploy the contract with the argument **1u64**, and then we upgr Upgrading a smart contract is a relatively easy process, but its implications are not exactly obvious. To upgrade a smart contract, simply run the following command: ``` -mxpy --verbose contract upgrade SC_ADDRESS --recall-nonce \ +mxpy --verbose contract upgrade SC_ADDRESS \ --pem=PEM_PATH --bytecode=WASM_PATH \ --gas-limit=100000000 \ --send --proxy=https://devnet-gateway.multiversx.com --chain=D @@ -51,7 +51,7 @@ Replace SC_ADDRESS, PEM_PATH and WASM_PATH accordingly. Also, if you want to use This will replace the given SC's code with the one from the provided file, but that is not all. Additionally, it will run the new code's `upgrade` function. So, if your `upgrade` function has any arguments, the command has to be run by also giving said arguments: ``` -mxpy --verbose contract upgrade SC_ADDRESS --recall-nonce \ +mxpy --verbose contract upgrade SC_ADDRESS \ --pem=PEM_PATH --bytecode=WASM_PATH \ --arguments arg1 arg2 arg3 --gas-limit=100000000 \ diff --git a/docs/developers/gas-and-fees/user-defined-smart-contracts.md b/docs/developers/gas-and-fees/user-defined-smart-contracts.md index 0e8988072..36a6527aa 100644 --- a/docs/developers/gas-and-fees/user-defined-smart-contracts.md +++ b/docs/developers/gas-and-fees/user-defined-smart-contracts.md @@ -18,7 +18,7 @@ At first, pass the maximum possible amount for `gas-limit` (no guessing). ```bash $ mxpy --verbose contract deploy --bytecode=./contract.wasm \ - --recall-nonce --gas-limit=600000000 \ + --gas-limit=600000000 \ --pem=~/multiversx-sdk/testwallets/latest/users/alice.pem \ --simulate ``` @@ -43,7 +43,7 @@ After that, check the cost simulation by running the simulation once again, but ```bash $ mxpy --verbose contract deploy --bytecode=./contract.wasm \ - --recall-nonce --gas-limit=1849711 \ + --gas-limit=1849711 \ --pem=~/multiversx-sdk/testwallets/latest/users/alice.pem \ --simulate ``` @@ -65,7 +65,7 @@ In the end, let's actually deploy the contract: ```bash $ mxpy --verbose contract deploy --bytecode=./contract.wasm \ - --recall-nonce --gas-limit=1849711 \ + --gas-limit=1849711 \ --pem=~/multiversx-sdk/testwallets/latest/users/alice.pem \ --send --wait-result ``` @@ -92,7 +92,7 @@ Assuming we've already deployed the contract (see above) let's get the cost for $ mxpy --verbose contract call erd1qqqqqqqqqqqqqpgqygvvtlty3v7cad507v5z793duw9jjmlxd8sszs8a2y \ --pem=~/multiversx-sdk/testwallets/latest/users/alice.pem \ --function=increment\ - --recall-nonce --gas-limit=600000000\ + --gas-limit=600000000\ --simulate ``` @@ -114,7 +114,7 @@ In the end, let's actually call the contract: $ mxpy --verbose contract call erd1qqqqqqqqqqqqqpgqygvvtlty3v7cad507v5z793duw9jjmlxd8sszs8a2y \ --pem=~/multiversx-sdk/testwallets/latest/users/alice.pem \ --function=increment\ - --recall-nonce --gas-limit=1225515\ + --gas-limit=1225515\ --send --wait-result ``` @@ -142,12 +142,12 @@ Let's deploy the contracts `A` and `B`: ```bash $ mxpy --verbose contract deploy --bytecode=./a.wasm \ - --recall-nonce --gas-limit=5000000 \ + --gas-limit=5000000 \ --pem=~/multiversx-sdk/testwallets/latest/users/alice.pem \ --send --wait-result --outfile=a.json $ mxpy --verbose contract deploy --bytecode=./b.wasm \ - --recall-nonce --gas-limit=5000000 \ + --gas-limit=5000000 \ --pem=~/multiversx-sdk/testwallets/latest/users/alice.pem \ --send --wait-result --outfile=b.json ``` @@ -160,7 +160,7 @@ $ export hexAddressOfB=0x$(mxpy wallet bech32 --decode erd1qqqqqqqqqqqqqpgqj5zft $ mxpy --verbose contract call erd1qqqqqqqqqqqqqpgqfzydqmdw7m2vazsp6u5p95yxz76t2p9rd8ss0zp9ts \ --pem=~/multiversx-sdk/testwallets/latest/users/alice.pem \ --function=foo\ - --recall-nonce --gas-limit=50000000\ + --gas-limit=50000000\ --arguments ${hexAddressOfB}\ --simulate ``` @@ -225,27 +225,27 @@ For our example, let's simulate using the following values for `gasLimit`: `7619 ```bash $ mxpy --verbose contract call erd1qqqqqqqqqqqqqpgqfzydqmdw7m2vazsp6u5p95yxz76t2p9rd8ss0zp9ts \ --pem=~/multiversx-sdk/testwallets/latest/users/alice.pem \ - --function=foo\ - --recall-nonce --gas-limit=7619200\ - --arguments ${hexAddressOfB}\ + --function=foo \ + --gas-limit=7619200 \ + --arguments ${hexAddressOfB} \ --simulate ... inspect output (possibly testnet logs); execution is successful mxpy --verbose contract call erd1qqqqqqqqqqqqqpgqfzydqmdw7m2vazsp6u5p95yxz76t2p9rd8ss0zp9ts \ --pem=~/multiversx-sdk/testwallets/latest/users/alice.pem \ - --function=foo\ - --recall-nonce --gas-limit=7000000\ - --arguments ${hexAddressOfB}\ + --function=foo \ + --gas-limit=7000000 \ + --arguments ${hexAddressOfB} \ --simulate ... inspect output (possibly testnet logs); execution is successful mxpy --verbose contract call erd1qqqqqqqqqqqqqpgqfzydqmdw7m2vazsp6u5p95yxz76t2p9rd8ss0zp9ts \ --pem=~/multiversx-sdk/testwallets/latest/users/alice.pem \ - --function=foo\ - --recall-nonce --gas-limit=6000000\ - --arguments ${hexAddressOfB}\ + --function=foo \ + --gas-limit=6000000 \ + --arguments ${hexAddressOfB} \ --simulate ... inspect output (possibly testnet logs); ERROR: out of gas when executing B::bar() diff --git a/docs/developers/setup-local-testnet-advanced.md b/docs/developers/setup-local-testnet-advanced.md index 891b66166..fcae73419 100644 --- a/docs/developers/setup-local-testnet-advanced.md +++ b/docs/developers/setup-local-testnet-advanced.md @@ -175,7 +175,7 @@ Given the request above, extract and save the fields `erd_chain_id` and `erd_min Let's send a simple transaction using **mxpy:** ```bash -$ mxpy tx new --recall-nonce --data="Hello, World" --gas-limit=70000 \ +$ mxpy tx new --data="Hello, World" --gas-limit=70000 \ --receiver=erd1... \ --pem=./sandbox/node/config/walletKey.pem --pem-index=0 \ --proxy=http://localhost:7950 \ @@ -197,7 +197,7 @@ Let's deploy a Smart Contract using **mxpy**. ```bash Deploy mxpy --verbose contract deploy --bytecode=./mycontract/output/contract.wasm \ - --recall-nonce --gas-limit=5000000 \ + --gas-limit=5000000 \ --pem=./sandbox/node/config/walletKey.pem --pem-index=0 \ --outfile=contract.json \ --proxy=http://localhost:7950 \ @@ -216,16 +216,16 @@ If everything is fine (transaction status is `executed` and the `code` property ```bash Call mxpy --verbose contract call erd1qqqqqqqqqqqqqpgql... \ - --recall-nonce --gas-limit=1000000 --function=increment \ - --pem=./sandbox/node/config/walletKey.pem --pem-index=0 --outfile=myCall.json \ - --proxy=http://localhost:7950 \ - --send + --gas-limit=1000000 --function=increment \ + --pem=./sandbox/node/config/walletKey.pem --pem-index=0 --outfile=myCall.json \ + --proxy=http://localhost:7950 \ + --send ``` ```bash Query -mxpy --verbose contract query erd1qqqqqqqqqqqqqpgqlq... \ +mxpy --verbose contract query erd1qqqqqqqqqqqqqpgqlq... \ --function=get \ - --proxy=http://localhost:7950 + --proxy=http://localhost:7950 ``` diff --git a/docs/developers/setup-local-testnet.md b/docs/developers/setup-local-testnet.md index cb262b7e8..1c05ed5b1 100644 --- a/docs/developers/setup-local-testnet.md +++ b/docs/developers/setup-local-testnet.md @@ -64,7 +64,7 @@ If everything goes well, in the terminal you should see logs coming from the nod ``` INFO:cli.localnet:Starting localnet... -... +... INFO:localnet:Starting process ['./seednode', ... ... INFO:localnet:Starting process ['./node', ... @@ -326,7 +326,7 @@ These wallets (Alice, Bob, Carol, ..., Mike) **are publicly known** - they shoul Let's send a simple transaction using **mxpy**: ```bash -mxpy tx new --recall-nonce --data="Hello, World" --gas-limit=70000 \ +mxpy tx new --data="Hello, World" --gas-limit=70000 \ --receiver=erd1spyavw0956vq68xj8y4tenjpq2wd5a9p2c6j8gsz7ztyrnpxrruqzu66jx \ --pem=~/multiversx-sdk/testwallets/latest/users/alice.pem \ --chain=localnet --proxy=http://localhost:7950 \ @@ -347,7 +347,7 @@ Let's deploy a Smart Contract using **mxpy**. ```bash mxpy --verbose contract deploy --bytecode=./contract.wasm \ - --recall-nonce --gas-limit=5000000 \ + --gas-limit=5000000 \ --pem=~/multiversx-sdk/testwallets/latest/users/alice.pem \ --outfile=contract.json \ --chain=localnet --proxy=http://localhost:7950 \ @@ -365,7 +365,7 @@ If everything is fine (transaction status is `executed` and the `code` property ```bash mxpy --verbose contract call erd1qqqqqqqqqqqqqpgqj5zftf3ef3gqm3gklcetpmxwg43rh8z2d8ss2e49aq \ - --recall-nonce --gas-limit=1000000 --function=increment \ + --gas-limit=1000000 --function=increment \ --pem=~/multiversx-sdk/testwallets/latest/users/alice.pem --outfile=myCall.json \ --chain=localnet --proxy=http://localhost:7950 \ --send @@ -386,13 +386,13 @@ At times, you can simulate transactions instead of broadcasting them, by replaci ```bash # Simulate: Call Contract mxpy contract call erd1qqqqqqqqqqqqqpgqj5zftf3ef3gqm3gklcetpmxwg43rh8z2d8ss2e49aq \ - --recall-nonce --gas-limit=1000000 --function=increment \ + --gas-limit=1000000 --function=increment \ --pem=~/multiversx-sdk/testwallets/latest/users/alice.pem \ --chain=localnet --proxy=http://localhost:7950 \ --simulate # Simulate: Simple Transfer -mxpy tx new --recall-nonce --data="Hello, World" --gas-limit=70000 \ +mxpy tx new --data="Hello, World" --gas-limit=70000 \ --receiver=erd1spyavw0956vq68xj8y4tenjpq2wd5a9p2c6j8gsz7ztyrnpxrruqzu66jx \ --pem=~/multiversx-sdk/testwallets/latest/users/alice.pem \ --chain=localnet --proxy=http://localhost:7950 \ diff --git a/docs/learn/consensus.md b/docs/learn/consensus.md index 118cc276d..73ac40b67 100644 --- a/docs/learn/consensus.md +++ b/docs/learn/consensus.md @@ -18,13 +18,12 @@ Below is a step‑by‑step walk‑through of *one* six‑second block cycle (ro ### 1.2 Round randomness -Randomness must be unpredictable yet verifiable. For round `r` the seed is: - ``` -rand_r = BLS_sign(prev_block_hash, proposer_{r-1}) +newRandSeed = currentProposer.Sign(lastRandSeed) +randomness = hash(newRandSeed, currentRound) ``` - -Because the identity of the previous proposer is only revealed at the end of round `r – 1`, no one can bias or predict `rand_r` ahead of time. +* `newRandSeed` - VUF (Verifiable Unpredictable Function). It allows the generate seeds that are verifiable, unpredictable but not uniform. +* `randomness` - VRF (Verifiable Random Function) ### 1.3 Proposer election diff --git a/docs/sdk-and-tools/mxpy/installing-mxpy.md b/docs/sdk-and-tools/mxpy/installing-mxpy.md index 353aa63ba..9514d04bb 100644 --- a/docs/sdk-and-tools/mxpy/installing-mxpy.md +++ b/docs/sdk-and-tools/mxpy/installing-mxpy.md @@ -41,10 +41,15 @@ pipx install multiversx-sdk-cli --force This will simply install the latest version available. +As of latest versions, we also publish the package under the `mxpy` name. Typing the following command should also work: +```sh +pipx install mxpy +``` + In case you want to install a specific version you should also specify the version. ```sh -pipx install multiversx-sdk-cli==9.5.1 +pipx install multiversx-sdk-cli==11.0.0 ``` You can also install **mxpy** directly from a GitHub branch. Replace `branch_name` with your desired branch and run the following command: @@ -98,3 +103,9 @@ To upgrade **mxpy** to a newer version, you can simply run the following command ```sh pipx upgrade multiversx-sdk-cli ``` + +or, if you've installed the CLI using the `mxpy` name: + +```sh +pipx upgrade mxpy +``` diff --git a/docs/sdk-and-tools/mxpy/mxpy-cli.md b/docs/sdk-and-tools/mxpy/mxpy-cli.md index 49b9519ff..5f5f37b0d 100644 --- a/docs/sdk-and-tools/mxpy/mxpy-cli.md +++ b/docs/sdk-and-tools/mxpy/mxpy-cli.md @@ -86,6 +86,8 @@ mxpy's configuration is stored in the file `~/multiversx-sdk/mxpy.json`. ### Viewing the current mxpy configuration +As of `mxpy v11`, we've introduced more configuration options, such as `environments` and `wallets`. + In order to view the current configuration, one can issue the command `mxpy config dump`. Output example: ```json @@ -104,23 +106,205 @@ mxpy config dump --defaults ### Updating the mxpy configuration -One can alter the current configuration using the command `mxpy config set`. For example, in order to set the **_testwallets version_** to be used, one would do the following: +One can alter the current configuration using the command `mxpy config set`. + +The default config contains the **log level** of the CLI. The default log level is set to `info`, but can be changed. The available values are: [debug, info, warning, error]. To set the log level, we can use the following command: +```sh +mxpy config set log_level debug +``` + +:::note +Previously, the `default_address_hrp` was also stored in the config. As of `mxpy v11` it has been moved to the `env` config, which we'll talk about in the next section. +::: + +### Configuring environments + +An `env config` is a named environment configuration that stores commonly used settings (like proxy url, hrp, and flags) for use with the **mxpy CLI**. Environments can be useful when switching between networks, such as Mainnet and Devnet. + +The values that are available for configuration and their default values are the following: +```json +{ + "default_address_hrp": "erd", + "proxy_url": "", + "explorer_url": "", + "ask_confirmation": "false", +} +``` + +#### Creating a new env config -```bash -mxpy config set dependencies.testwallets.tag v1.0.0 +To create a new env config, we use the following command: + +```sh +mxpy config-env new ``` -The default config contains the **default address hrp** which depending on the network (e.g Sovereign Chain) might need to be altered. +Additionally, `--template` can be used to create a config from an existing env config. After a new env config is created, it becomes the active one. You can then set its values using the `mxpy config-env set` command. + +#### Setting the default hrp + +The `default_address_hrp` might need to be changed depending on the network you plan on using (e.g Sovereign Chain). Most of the commands that might need the `address hrp` already provide a parameter called `--hrp` or `--address-hrp`, that can be explicitly set, but there are system smart contract addresses that cannot be changed by providing the parameter. If those addresses need to be changed, we can use the following command to set the `default hrp` that will be used throughout mxpy. Here we set the default hrp to `test`: -Most of the commands that might need the `address hrp` already provide a parameter called `--hrp` or `--address-hrp`, that can be explicitly set, but there are system smart contract addresses that cannot be changed by providing the parameter. If that addresses need to be changed, we can use the following command to set the `default hrp` that will be used throughout mxpy. Here we set the default hrp to `test` : ```sh -mxpy config set default_address_hrp test +mxpy config-env set default_address_hrp test --env test-env ``` :::note Explicitly providing `--hrp` will **always** be used over the one fetched from the network or the `hrp` set in the config. ::: +#### Setting the proxy url + +If `proxy_url` is set in the active environment, the `--proxy` argument is no longer required for the commands that need this argument. + +To set the proxy url, use the following command: + +```sh +mxpy config-env set proxy_url https://devnet-api.multiversx.com --env devnet +``` + +#### Setting the explorer url + +**mxpy** already knows the explorer urls for all three networks (Mainnet, Devnet, Testnet). This is particularly useful when running the CLI on custom networks where an explorer is also available. This key is not required to be present in the `env config` for the config to be valid. To set the explorer url use the following command: + +```sh +mxpy config-env set explorer_url https://url-to-explorer.com --env test-env +``` + +#### Setting the ask for confirmation flag + +If set to `true`, whenever sending a transaction, mxpy will display the transaction and will ask for your confirmation. To set the flag, use the following command: + +```sh +mxpy config-env set ask_confirmation true --env mainnet +``` + +#### Dumping the active env config + +We can see the values set in our active env config. To do so, we use the following command: + +```sh +mxpy config-env dump +``` + +#### Dumping all the available env configs + +We may have multiple env configs, maybe one for each network. To dump all the available env configs, we use the following command: + +```sh +mxpy config-env list +``` + +#### Deleting a value from the active env config + +We can also delete the key-value pairs saved in the env config. For example, let's say we want to delete the explorer url, so we use the following command: + +```sh +mxpy config-env delete explorer_url --env test-env +``` + +#### Getting a value from the active env config + +If we want to see just the value of a env config key from a specific environment, we can use the following command: + +```sh +mxpy config-env get --env mainnet +``` + +#### Deleting an env config + +To delete an env config, we use the following command: + +```sh +mxpy config-env remove +``` + +#### Switching to a different env config + +To switch to a new env config, we use the following command: + +```sh +mxpy config-env switch --env +``` + +You can manage multiple environment configurations with ease using `mxpy config-env`. This feature helps streamline workflows when working with multiple networks or projects. Use `mxpy config-env list` to see all available configs, and `switch` to quickly toggle between them. + +### Configuring wallets + +Wallets can be configured in the wallet config. Among all configured wallets, one must be set as the active wallet. This active wallet will be used by default in all mxpy commands, unless another wallet is explicitly provided using `--pem`, `--keystore`, or `--ledger`. Alternatively, the `--sender` argument can be used to specify a particular sender address from the address config (e.g. --sender alice). + +The values that are available for configuring wallets are the following: +```json +{ + "path": "", + "index": "", +} +``` + +Supported wallet types include PEM files and keystores. The CLI will determine the type based on the given path and act accordingly. If the wallet is of type `keystore`, you'll be prompted to enter the wallet's password. + +The `path` field represents the absolute path to the wallet. + +The `index` field represents the index that will be used when deriving the wallet from the secret key. This field is optional, the default index is `0`. + +#### Creating a new wallet config + +When configuring a new wallet we need to give it an alias. An alias is a user-defined name that identifies a configured wallet (e.g. alice, bob, dev-wallet). To create a new wallet config, we use the following command: + +```sh +mxpy config-wallet new +``` + +This command accepts the `--path` argument, so the path to the wallet can be set directly, without needing to call `mxpy config-wallet set` afterwards. + +#### Setting the wallet config fields + +For a config to be valid, we need to set at least the `path` field for an already created wallet alias. To do so, we use the following command: + +```sh +mxpy config-wallet set path absolute/path/to/pem/wallet.pem --alias alice +``` + +#### Getting the value of a field + +We can get the value of a field from an alias using the following command: + +```sh +mxpy config-wallet get path --alias alice +``` + +#### Dumping the active wallet config + +To view all the properties of the active address, use the following command: + +```sh +mxpy config-wallet dump +``` + +#### Dumping all configured wallets + +To view all the wallets configured, use the following command: + +```sh +mxpy config-wallet list +``` + +#### Switching to a different wallet + +We may have multiple wallets configured, so to switch between them, we use the following command: + +```sh +mxpy config-wallet switch --alias alice +``` + +#### Removing an address from the config + +We can remove an address from the config using the alias of the address and the following command: + +```sh +mxpy config-wallet remove --alias alice +``` + [comment]: # (mx-context-auto) ## Creating wallets @@ -672,3 +856,81 @@ mxpy contract call erd1qqqqqqqqqqqqqpgqwwef37kmegph97egvvrxh3nccx7xuygez8ns682zz :::note As of October 2023, on Windows (or WSL), you might encounter some issues when trying to use Ledger in `mxpy`. ::: + +## Interacting with the Multisig Smart Contract + +As of `mxpy v11`, interacting with Multisig contracts has become a lot easier because a dedicated command group called `mxpy multisig` has been added. We can deploy a multisig contract, create proposals and query the contract. For a full list of all the possible actions, run the following command: + +```sh +mxpy multisig -h +``` + +#### Deploying a multisig contract + +```sh +mxpy multisig deploy --bytecode path/to/multisig.wasm \ + --abi path/to/multisig.abi.json + --quorum 2 + --board-members erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th erd1spyavw0956vq68xj8y4tenjpq2wd5a9p2c6j8gsz7ztyrnpxrruqzu66jx + --proxy=https://devnet-gateway.multiversx.com \ + --gas-limit 100000000 \ + --send +``` + +#### Creating a new proposal + +```sh +mxpy multisig add-board-member --contract erd1qqqqqqqqqqqqqpgq2ukrsg73nwgu3uz6sp8vequuyrhtv2akd8ssyrg7wj \ + --abi path/to/multisig.abi.json + --board-member erd1k2s324ww2g0yj38qn2ch2jwctdy8mnfxep94q9arncc6xecg3xaq6mjse8 + --proxy=https://devnet-gateway.multiversx.com \ + --gas-limit 10000000 \ + --send +``` + +#### Querying the contract + +```sh +mxpy multisig get-proposers --contract erd1qqqqqqqqqqqqqpgq2ukrsg73nwgu3uz6sp8vequuyrhtv2akd8ssyrg7wj \ + --abi path/to/multisig.abi.json + --proxy=https://devnet-gateway.multiversx.com +``` + +## Interacting with the Governance Smart Contract + +As of `mxpy v11`, mxpy allows for easier interaction with the Governance smart contract. We can create a new governance proposal, vote for a proposal and query the contract. For a full list of the available commands, run the following command: + +```sh +mxpy governance -h +``` + +#### Creating a new proposal + +```sh +mxpy governance propose \ + --commit-hash 30118901102b0bef11d675f4327565ae5246eeb5 \ + --start-vote-epoch 1000 \ + --end-vote-epoch 1010 \ + --proxy=https://devnet-gateway.multiversx.com \ + --gas-limit 100000000 \ + --send +``` + +#### Voting for a proposal + +```sh +mxpy governance vote \ + --proposal-nonce 1 \ + --vote yes \ + --proxy=https://devnet-gateway.multiversx.com \ + --gas-limit 100000000 \ + --send +``` + +#### Querying the contract + +```sh +mxpy governance get-proposal-info \ + --proposal-nonce 1 \ + --proxy=https://devnet-gateway.multiversx.com +``` diff --git a/docs/sdk-and-tools/mxpy/smart-contract-interactions.md b/docs/sdk-and-tools/mxpy/smart-contract-interactions.md index 7c0eecc73..4e1f4e0b4 100644 --- a/docs/sdk-and-tools/mxpy/smart-contract-interactions.md +++ b/docs/sdk-and-tools/mxpy/smart-contract-interactions.md @@ -49,7 +49,7 @@ Now, in order to deploy the contract, we use the special **deploy** function of ``` deploySC() { - mxpy --verbose contract deploy --recall-nonce \ + mxpy --verbose contract deploy \ --bytecode=${WASM_PATH} \ --pem=${WALLET_PEM} \ --gas-limit=60000000 \ @@ -77,7 +77,7 @@ The upgrade function would look like this: ``` upgradeSC() { - mxpy --verbose contract upgrade ${CONTRACT_ADDRESS} --recall-nonce --payable \ + mxpy --verbose contract upgrade ${CONTRACT_ADDRESS} --payable \ --bytecode=${WASM_PATH} \ --pem=${WALLET_PEM} \ --gas-limit=60000000 \ @@ -113,7 +113,7 @@ ADDRESS_ARGUMENT="erd14nw9pukqyqu75gj0shm8upsegjft8l0awjefp877phfx74775dsq49swp3 THIRD_BIGUINT_ARGUMENT=0x0f4240 myNonPayableEndpoint() { address_argument="0x$(mxpy wallet bech32 --decode ${ADDRESS_ARGUMENT})" - mxpy --verbose contract call ${CONTRACT_ADDRESS} --recall-nonce \ + mxpy --verbose contract call ${CONTRACT_ADDRESS} \ --pem=${WALLET_PEM} \ --gas-limit=6000000 \ --proxy=${PROXY} --chain=${CHAIN_ID} \ @@ -152,7 +152,7 @@ So, in case of our **myNonPayableEndpoint** interaction, we can write it like so ADDRESS_ARGUMENT="erd14nw9pukqyqu75gj0shm8upsegjft8l0awjefp877phfx74775dsq49swp3" THIRD_BIGUINT_ARGUMENT=1000000 myNonPayableEndpoint() { - mxpy --verbose contract call ${CONTRACT_ADDRESS} --recall-nonce \ + mxpy --verbose contract call ${CONTRACT_ADDRESS} \ --pem=${WALLET_PEM} \ --gas-limit=6000000 \ --proxy=${PROXY} --chain=${CHAIN_ID} \ @@ -193,7 +193,7 @@ myPayableEndpoint() { method_name=str:myPayableEndpoint my_token=str:$1 token_amount=$2 - mxpy --verbose contract call ${CONTRACT_ADDRESS} --recall-nonce \ + mxpy --verbose contract call ${CONTRACT_ADDRESS} \ --pem=${WALLET_PEM} \ --gas-limit=6000000 \ --proxy=${PROXY} --chain=${CHAIN_ID} \ @@ -226,7 +226,7 @@ myESDTNFTPayableEndpoint() { sft_token_nonce=$2 sft_token_amount=$3 destination_address=$4 - mxpy --verbose contract call $user_address --recall-nonce \ + mxpy --verbose contract call $user_address \ --pem=${WALLET_PEM} \ --gas-limit=100000000 \ --proxy=${PROXY} --chain=${CHAIN_ID} \ @@ -279,7 +279,7 @@ myMultiESDTNFTPayableEndpoint() { third_token_nonce=$7 third_token_amount=$8 - mxpy --verbose contract call $user_address --recall-nonce \ + mxpy --verbose contract call $user_address \ --pem=${WALLET_PEM} \ --gas-limit=100000000 \ --proxy=${PROXY} --chain=${CHAIN_ID} \ diff --git a/docs/validators/node-cli.md b/docs/validators/node-cli.md index 327cf7be6..e247de479 100644 --- a/docs/validators/node-cli.md +++ b/docs/validators/node-cli.md @@ -15,11 +15,11 @@ Command Line Interface for the Node and the associated Tools The **Command Line Interface** of the **Node** and its associated **Tools** is described at the following locations: -- [Node](https://github.com/multiversx/mx-chain-go/blob/master/cmd/node/CLI) -- [SeedNode](https://github.com/multiversx/mx-chain-go/blob/master/cmd/seednode/CLI) -- [Keygenerator](https://github.com/multiversx/mx-chain-go/blob/master/cmd/keygenerator/CLI) -- [TermUI](https://github.com/multiversx/mx-chain-go/blob/master/cmd/termui/CLI) -- [Logviewer](https://github.com/multiversx/mx-chain-go/blob/master/cmd/logviewer/CLI) +- [Node](https://github.com/multiversx/mx-chain-go/blob/master/cmd/node/CLI.md) +- [SeedNode](https://github.com/multiversx/mx-chain-go/blob/master/cmd/seednode/CLI.md) +- [Keygenerator](https://github.com/multiversx/mx-chain-go/blob/master/cmd/keygenerator/CLI.md) +- [TermUI](https://github.com/multiversx/mx-chain-go/blob/master/cmd/termui/CLI.md) +- [Logviewer](https://github.com/multiversx/mx-chain-go/blob/master/cmd/logviewer/CLI.md) [comment]: # (mx-context-auto) diff --git a/docs/validators/staking/staking.md b/docs/validators/staking/staking.md index 2b5fb40fd..0ea9ab0df 100644 --- a/docs/validators/staking/staking.md +++ b/docs/validators/staking/staking.md @@ -105,7 +105,7 @@ The following commands assume that the PEM file for your Wallet was saved with t The command to submit a staking transaction with `mxpy` is this: ```bash -mxpy --verbose validator stake --pem=walletKey.pem --value="" --validators-file= --proxy=https://gateway.multiversx.com --estimate-gas --recall-nonce +mxpy --verbose validator stake --pem=walletKey.pem --value="" --validators-file= --proxy=https://gateway.multiversx.com ``` Notice that we are using the `walletKey.pem` file. Moreover, before executing this command, you need to replace the following: @@ -131,12 +131,10 @@ Notice that we are using the `walletKey.pem` file. Moreover, before executing th The `pemFile` field should point to valid Validator PEM file. **Note that paths must be relative to the JSON file itself.** -Notice also that there is no calculation for "Gas Limit". If you provide the `--estimate-gas` argument to `mxpy`, the gas limit will be estimated automatically. - Here's an example for a staking command for one node: ``` -mxpy --verbose validator stake --pem=walletKey.pem --value="2500000000000000000000" --validators-file=my-validators.json --proxy=https://gateway.multiversx.com --estimate-gas --recall-nonce +mxpy --verbose validator stake --pem=walletKey.pem --value="2500000000000000000000" --validators-file=my-validators.json --proxy=https://gateway.multiversx.com ``` :::note important @@ -146,7 +144,7 @@ You must take **denomination** into account when specifying the `value` paramete For two nodes, it becomes this: ``` -mxpy --verbose validator stake --pem=walletKey.pem --value="5000000000000000000000" --validators-file=my-validators.json --proxy=https://gateway.multiversx.com --estimate-gas --recall-nonce +mxpy --verbose validator stake --pem=walletKey.pem --value="5000000000000000000000" --validators-file=my-validators.json --proxy=https://gateway.multiversx.com ``` [comment]: # (mx-context-auto) @@ -160,7 +158,7 @@ Alternatively, you can tell `mxpy` to specify another wallet to which your rewar For example, a staking command for a single node, with a reward address specified, looks like this: ``` -mxpy --verbose validator stake --reward-address="erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th" --pem=walletKey.pem --value="2500000000000000000000" --validators-file=my-validators.json --proxy=https://gateway.multiversx.com --estimate-gas --recall-nonce +mxpy --verbose validator stake --reward-address="erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th" --pem=walletKey.pem --value="2500000000000000000000" --validators-file=my-validators.json --proxy=https://gateway.multiversx.com ``` The above command will submit a staking command and will also inform the Staking SmartContract that the rewards should be transferred to the wallet `erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th` . diff --git a/docs/validators/staking/unjailing.md b/docs/validators/staking/unjailing.md index 600626c37..c368758b4 100644 --- a/docs/validators/staking/unjailing.md +++ b/docs/validators/staking/unjailing.md @@ -145,8 +145,8 @@ The following commands assume that the PEM file for your Wallet was saved with t The command to submit an unjailing transaction with `mxpy` is this: -```python -mxpy --verbose validator unjail --pem=walletKey.pem --value="" --nodes-public-keys=",,...," --proxy=https://gateway.multiversx.com --estimate-gas --recall-nonce +```sh +mxpy --verbose validator unjail --pem=walletKey.pem --value="" --nodes-public-keys=",,...," --proxy=https://gateway.multiversx.com ``` Notice that we are using the `walletKey.pem` file. Moreover, before executing this command, you need to replace the following: @@ -154,12 +154,10 @@ Notice that we are using the `walletKey.pem` file. Moreover, before executing th - Replace `` with the amount of EGLD required for unjailing your validators. You need to calculate this value with respect to the number of nodes you are unjailing. See the [beginning of the Unjailing through the Wallet](/validators/staking/unjailing#unjailing-through-the-wallet) section for info on how to do it. - Replace all the `` with the actual **BLS public keys** of your nodes, which you can find inside their individual `validatorKey.pem` files. Make sure you **do not write the BLS secret keys**! Read the page [Validator Keys](/validators/key-management/validator-keys) to see how to interpret the `validatorKey.pem` files. -Notice also that there is no calculation for "Gas Limit". If you provide the `--estimate-gas` argument to `mxpy`, the gas limit will be estimated automatically. - Here's an example for an unjailing command for one validator: -```python -mxpy --verbose validator unjail --pem=walletKey.pem --value="2500000000000000000000" --nodes-public-keys="b617d8bc442bda59510f77e04a1680e8b2d3293c8c4083d94260db96a4d732deaaf9855fa0cef2273f5a67b4f442c725efc06a5d366b9f15a66da9eb8208a09c9ab4066b6b3d38c3cf1ea7fab6489a90713b3b56d87de68c6558c80d7533bf27" --proxy=https://gateway.multiversx.com --estimate-gas --recall-nonce +```sh +mxpy --verbose validator unjail --pem=walletKey.pem --value="2500000000000000000000" --nodes-public-keys="b617d8bc442bda59510f77e04a1680e8b2d3293c8c4083d94260db96a4d732deaaf9855fa0cef2273f5a67b4f442c725efc06a5d366b9f15a66da9eb8208a09c9ab4066b6b3d38c3cf1ea7fab6489a90713b3b56d87de68c6558c80d7533bf27" --proxy=https://gateway.multiversx.com ``` :::note important @@ -168,8 +166,8 @@ You must take **denomination** into account when specifying the `value` paramete For two validators, the command becomes this one: -```python -mxpy --verbose validator unjail --pem=walletKey.pem --value="5000000000000000000000" --nodes-public-keys="b617d8bc442bda59510f77e04a1680e8b2d3293c8c4083d94260db96a4d732deaaf9855fa0cef2273f5a67b4f442c725efc06a5d366b9f15a66da9eb8208a09c9ab4066b6b3d38c3cf1ea7fab6489a90713b3b56d87de68c6558c80d7533bf27,f921a0f76ed70e8a806c6f9119f87b12700f96f732e6070b675e0aec10cb0723803202a4c40194847c38195db07b1001f6d50c81a82b949e438cd6dd945c2eb99b32c79465aefb9144c8668af67e2d01f71b81842d9b94e4543a12616cb5897d" --proxy=https://gateway.multiversx.com --estimate-gas --recall-nonce +```sh +mxpy --verbose validator unjail --pem=walletKey.pem --value="5000000000000000000000" --nodes-public-keys="b617d8bc442bda59510f77e04a1680e8b2d3293c8c4083d94260db96a4d732deaaf9855fa0cef2273f5a67b4f442c725efc06a5d366b9f15a66da9eb8208a09c9ab4066b6b3d38c3cf1ea7fab6489a90713b3b56d87de68c6558c80d7533bf27,f921a0f76ed70e8a806c6f9119f87b12700f96f732e6070b675e0aec10cb0723803202a4c40194847c38195db07b1001f6d50c81a82b949e438cd6dd945c2eb99b32c79465aefb9144c8668af67e2d01f71b81842d9b94e4543a12616cb5897d" --proxy=https://gateway.multiversx.com ``` Notice that the two BLS public keys are separated by a comma, with no extra space between them.