Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand Down
34 changes: 17 additions & 17 deletions docs/developers/gas-and-fees/user-defined-smart-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -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
```
Expand All @@ -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
```
Expand All @@ -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
```

Expand All @@ -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
```

Expand Down Expand Up @@ -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
```
Expand All @@ -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
```
Expand Down Expand Up @@ -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()
Expand Down
16 changes: 8 additions & 8 deletions docs/developers/setup-local-testnet-advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand All @@ -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
```
12 changes: 6 additions & 6 deletions docs/developers/setup-local-testnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -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', ...
Expand Down Expand Up @@ -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 \
Expand All @@ -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 \
Expand All @@ -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
Expand All @@ -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 \
Expand Down
13 changes: 12 additions & 1 deletion docs/sdk-and-tools/mxpy/installing-mxpy.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
```
Loading
Loading