diff --git a/erdpy/CLI.md b/erdpy/CLI.md index 11210371..7f7537f5 100644 --- a/erdpy/CLI.md +++ b/erdpy/CLI.md @@ -20,7 +20,7 @@ https://docs.elrond.com/tools/erdpy. COMMAND GROUPS: - {contract,tx,validator,account,wallet,network,cost,dispatcher,blockatlas,deps,config,hyperblock,testnet,data,staking-provider,dns} + {contract,tx,validator,account,ledger,wallet,network,cost,dispatcher,blockatlas,deps,config,hyperblock,testnet,data,staking-provider,dns} TOP-LEVEL OPTIONS: -h, --help show this help message and exit @@ -32,8 +32,9 @@ COMMAND GROUPS summary ---------------------- contract Build, deploy and interact with Smart Contracts tx Create and broadcast Transactions -validator Stake, Unjail and other actions useful for Validators +validator Stake, UnStake, UnBond, Unjail and other actions useful for Validators account Get Account data (nonce, balance) from the Network +ledger Get Ledger App addresses and version wallet Derive secret key from mnemonic, bech32 address helpers etc. network Get Network parameters, such as number of shards, chain identifier etc. cost Estimate cost of Transactions @@ -46,7 +47,6 @@ testnet Set up, start and control local testnets data Data manipulation omnitool staking-provider Staking provider omnitool dns Operations related to the Domain Name Service -ledger Get Ledger App address and version ``` ## Group **Contract** @@ -126,6 +126,10 @@ optional arguments: --debug set debug flag (default: False) --no-optimization bypass optimizations (for clang) (default: False) --cargo-target-dir CARGO_TARGET_DIR for rust projects, forward the parameter to Cargo + --wasm-symbols for rust projects, does not strip the symbols from the wasm output. Useful for + analysing the bytecode. Creates larger wasm files. Avoid in production (default: + False) + --wasm-name WASM_NAME for rust projects, optionally specify the name of the wasm bytecode output file ``` ### Contract.Clean @@ -154,32 +158,37 @@ usage: erdpy contract deploy [-h] ... Deploy a Smart Contract. optional arguments: - -h, --help show this help message and exit - --project PROJECT 🗀 the project directory (default: current directory) - --bytecode BYTECODE the WASM file - --metadata-not-upgradeable ‼ mark the contract as NOT upgradeable (default: upgradeable) - --metadata-payable ‼ mark the contract as payable (default: not payable) - --outfile OUTFILE where to save the output (default: stdout) - --pem PEM 🔑 the PEM file, if keyfile or ledger are not provided - --pem-index PEM_INDEX 🔑 the index in the PEM file (default: 0) - --keyfile KEYFILE 🔑 a JSON keyfile, if PEM of ledger not provided - --passfile PASSFILE 🔑 a file containing keyfile's password, if keyfile provided - --ledger 🔐 bool flag for signing transaction using ledger - --ledger-account-index 🔐 the index of the account (only applicable if --ledger is set) - --ledger-address-index 🔐 the index of the address (only applicable if --ledger is set) - --sender-username SENDER_USERNAME 🖄 the username of the sender - --proxy PROXY 🖧 the URL of the proxy (default: https://testnet-gateway.elrond.com) - --nonce NONCE # the nonce for the transaction - --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: False) - --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) - --gas-limit GAS_LIMIT ⛽ the gas limit - --value VALUE the value to transfer (default: 0) - --chain CHAIN the chain identifier (default: T) - --version VERSION the transaction version (default: 1) - --arguments ARGUMENTS [ARGUMENTS ...] arguments for the contract transaction, as numbers or hex-encoded. E.g. - --arguments 42 0x64 1000 0xabba - --send ✓ whether to broadcast the transaction (default: False) - --simulate whether to simulate the transaction (default: False) + -h, --help show this help message and exit + --project PROJECT 🗀 the project directory (default: current directory) + --bytecode BYTECODE the file containing the WASM bytecode + --metadata-not-upgradeable ‼ mark the contract as NOT upgradeable (default: upgradeable) + --metadata-payable ‼ mark the contract as payable (default: not payable) + --outfile OUTFILE where to save the output (default: stdout) + --pem PEM 🔑 the PEM file, if keyfile not provided + --pem-index PEM_INDEX 🔑 the index in the PEM file (default: 0) + --keyfile KEYFILE 🔑 a JSON keyfile, if PEM not provided + --passfile PASSFILE 🔑 a file containing keyfile's password, if keyfile provided + --ledger 🔐 bool flag for signing transaction using ledger + --ledger-account-index LEDGER_ACCOUNT_INDEX 🔐 the index of the account when using Ledger + --ledger-address-index LEDGER_ADDRESS_INDEX 🔐 the index of the address when using Ledger + --sender-username SENDER_USERNAME 🖄 the username of the sender + --proxy PROXY 🔗 the URL of the proxy (default: https://testnet-api.elrond.com) + --nonce NONCE # the nonce for the transaction + --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: + False) + --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) + --gas-limit GAS_LIMIT ⛽ the gas limit + --value VALUE the value to transfer (default: 0) + --chain CHAIN the chain identifier (default: T) + --version VERSION the transaction version (default: 1) + --options OPTIONS the transaction options (default: 0) + --arguments ARGUMENTS [ARGUMENTS ...] arguments for the contract transaction, as numbers or hex-encoded. E.g. + --arguments 42 0x64 1000 0xabba + --wait-result signal to wait for the transaction result - only valid if --send is set + --timeout TIMEOUT max num of seconds to wait for result - only valid if --wait-result is + set + --send ✓ whether to broadcast the transaction (default: False) + --simulate whether to simulate the transaction (default: False) ``` ### Contract.Call @@ -192,33 +201,38 @@ usage: erdpy contract call [-h] ... Interact with a Smart Contract (execute function). positional arguments: - contract 🖄 the address of the Smart Contract + contract 🖄 the address of the Smart Contract optional arguments: - -h, --help show this help message and exit - --outfile OUTFILE where to save the output (default: stdout) - --pem PEM 🔑 the PEM file, if keyfile or ledger are not provided - --pem-index PEM_INDEX 🔑 the index in the PEM file (default: 0) - --keyfile KEYFILE 🔑 a JSON keyfile, if PEM of ledger not provided - --passfile PASSFILE 🔑 a file containing keyfile's password, if keyfile provided - --ledger 🔐 bool flag for signing transaction using ledger - --ledger-account-index 🔐 the index of the account (only applicable if --ledger is set) - --ledger-address-index 🔐 the index of the address (only applicable if --ledger is set) - --sender-username SENDER_USERNAME 🖄 the username of the sender - --proxy PROXY 🖧 the URL of the proxy (default: https://testnet-gateway.elrond.com) - --nonce NONCE # the nonce for the transaction - --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: False) - --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) - --gas-limit GAS_LIMIT ⛽ the gas limit - --value VALUE the value to transfer (default: 0) - --chain CHAIN the chain identifier (default: T) - --version VERSION the transaction version (default: 1) - --function FUNCTION the function to call - --arguments ARGUMENTS [ARGUMENTS ...] arguments for the contract transaction, as numbers or hex-encoded. E.g. - --arguments 42 0x64 1000 0xabba - --send ✓ whether to broadcast the transaction (default: False) - --simulate whether to simulate the transaction (default: False) - --relay whether to relay the transaction (default: False) + -h, --help show this help message and exit + --outfile OUTFILE where to save the output (default: stdout) + --pem PEM 🔑 the PEM file, if keyfile not provided + --pem-index PEM_INDEX 🔑 the index in the PEM file (default: 0) + --keyfile KEYFILE 🔑 a JSON keyfile, if PEM not provided + --passfile PASSFILE 🔑 a file containing keyfile's password, if keyfile provided + --ledger 🔐 bool flag for signing transaction using ledger + --ledger-account-index LEDGER_ACCOUNT_INDEX 🔐 the index of the account when using Ledger + --ledger-address-index LEDGER_ADDRESS_INDEX 🔐 the index of the address when using Ledger + --sender-username SENDER_USERNAME 🖄 the username of the sender + --proxy PROXY 🔗 the URL of the proxy (default: https://testnet-api.elrond.com) + --nonce NONCE # the nonce for the transaction + --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: + False) + --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) + --gas-limit GAS_LIMIT ⛽ the gas limit + --value VALUE the value to transfer (default: 0) + --chain CHAIN the chain identifier (default: T) + --version VERSION the transaction version (default: 1) + --options OPTIONS the transaction options (default: 0) + --function FUNCTION the function to call + --arguments ARGUMENTS [ARGUMENTS ...] arguments for the contract transaction, as numbers or hex-encoded. E.g. + --arguments 42 0x64 1000 0xabba + --wait-result signal to wait for the transaction result - only valid if --send is set + --timeout TIMEOUT max num of seconds to wait for result - only valid if --wait-result is + set + --send ✓ whether to broadcast the transaction (default: False) + --simulate whether to simulate the transaction (default: False) + --relay whether to relay the transaction (default: False) ``` ### Contract.Upgrade @@ -231,35 +245,40 @@ usage: erdpy contract upgrade [-h] ... Upgrade a previously-deployed Smart Contract positional arguments: - contract 🖄 the address of the Smart Contract + contract 🖄 the address of the Smart Contract optional arguments: - -h, --help show this help message and exit - --outfile OUTFILE where to save the output (default: stdout) - --project PROJECT 🗀 the project directory (default: current directory) - --bytecode BYTECODE the WASM file - --metadata-not-upgradeable ‼ mark the contract as NOT upgradeable (default: upgradeable) - --metadata-payable ‼ mark the contract as payable (default: not payable) - --pem PEM 🔑 the PEM file, if keyfile or ledger are not provided - --pem-index PEM_INDEX 🔑 the index in the PEM file (default: 0) - --keyfile KEYFILE 🔑 a JSON keyfile, if PEM of ledger not provided - --passfile PASSFILE 🔑 a file containing keyfile's password, if keyfile provided - --ledger 🔐 bool flag for signing transaction using ledger - --ledger-account-index 🔐 the index of the account (only applicable if --ledger is set) - --ledger-address-index 🔐 the index of the address (only applicable if --ledger is set) - --sender-username SENDER_USERNAME 🖄 the username of the sender - --proxy PROXY 🖧 the URL of the proxy (default: https://testnet-gateway.elrond.com) - --nonce NONCE # the nonce for the transaction - --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: False) - --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) - --gas-limit GAS_LIMIT ⛽ the gas limit - --value VALUE the value to transfer (default: 0) - --chain CHAIN the chain identifier (default: T) - --version VERSION the transaction version (default: 1) - --arguments ARGUMENTS [ARGUMENTS ...] arguments for the contract transaction, as numbers or hex-encoded. E.g. - --arguments 42 0x64 1000 0xabba - --send ✓ whether to broadcast the transaction (default: False) - --simulate whether to simulate the transaction (default: False) + -h, --help show this help message and exit + --outfile OUTFILE where to save the output (default: stdout) + --project PROJECT 🗀 the project directory (default: current directory) + --bytecode BYTECODE the file containing the WASM bytecode + --metadata-not-upgradeable ‼ mark the contract as NOT upgradeable (default: upgradeable) + --metadata-payable ‼ mark the contract as payable (default: not payable) + --pem PEM 🔑 the PEM file, if keyfile not provided + --pem-index PEM_INDEX 🔑 the index in the PEM file (default: 0) + --keyfile KEYFILE 🔑 a JSON keyfile, if PEM not provided + --passfile PASSFILE 🔑 a file containing keyfile's password, if keyfile provided + --ledger 🔐 bool flag for signing transaction using ledger + --ledger-account-index LEDGER_ACCOUNT_INDEX 🔐 the index of the account when using Ledger + --ledger-address-index LEDGER_ADDRESS_INDEX 🔐 the index of the address when using Ledger + --sender-username SENDER_USERNAME 🖄 the username of the sender + --proxy PROXY 🔗 the URL of the proxy (default: https://testnet-api.elrond.com) + --nonce NONCE # the nonce for the transaction + --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: + False) + --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) + --gas-limit GAS_LIMIT ⛽ the gas limit + --value VALUE the value to transfer (default: 0) + --chain CHAIN the chain identifier (default: T) + --version VERSION the transaction version (default: 1) + --options OPTIONS the transaction options (default: 0) + --arguments ARGUMENTS [ARGUMENTS ...] arguments for the contract transaction, as numbers or hex-encoded. E.g. + --arguments 42 0x64 1000 0xabba + --wait-result signal to wait for the transaction result - only valid if --send is set + --timeout TIMEOUT max num of seconds to wait for result - only valid if --wait-result is + set + --send ✓ whether to broadcast the transaction (default: False) + --simulate whether to simulate the transaction (default: False) ``` ### Contract.Query @@ -276,7 +295,7 @@ positional arguments: optional arguments: -h, --help show this help message and exit - --proxy PROXY 🖧 the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY 🔗 the URL of the proxy (default: https://testnet-api.elrond.com) --function FUNCTION the function to call --arguments ARGUMENTS [ARGUMENTS ...] arguments for the contract transaction, as numbers or hex-encoded. E.g. --arguments 42 0x64 1000 0xabba @@ -315,31 +334,36 @@ usage: erdpy tx new [-h] ... Create a new transaction optional arguments: - -h, --help show this help message and exit - --pem PEM 🔑 the PEM file, if keyfile or ledger are not provided - --pem-index PEM_INDEX 🔑 the index in the PEM file (default: 0) - --keyfile KEYFILE 🔑 a JSON keyfile, if PEM of ledger not provided - --passfile PASSFILE 🔑 a file containing keyfile's password, if keyfile provided - --ledger 🔐 bool flag for signing transaction using ledger - --ledger-account-index 🔐 the index of the account (only applicable if --ledger is set) - --ledger-address-index 🔐 the index of the address (only applicable if --ledger is set) - --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction - --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: False) - --receiver RECEIVER 🖄 the address of the receiver - --receiver-username RECEIVER_USERNAME 🖄 the username of the receiver - --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) - --gas-limit GAS_LIMIT ⛽ the gas limit - --value VALUE the value to transfer (default: 0) - --data DATA the payload, or 'memo' of the transaction (default: ) - --chain CHAIN the chain identifier (default: T) - --version VERSION the transaction version (default: 1) - --data-file DATA_FILE a file containing transaction data - --outfile OUTFILE where to save the output (signed transaction, hash) (default: stdout) - --send ✓ whether to broadcast the transaction (default: False) - --simulate whether to simulate the transaction (default: False) - --relay whether to relay the transaction (default: False) - --proxy PROXY 🖧 the URL of the proxy (default: https://testnet-gateway.elrond.com) + -h, --help show this help message and exit + --pem PEM 🔑 the PEM file, if keyfile not provided + --pem-index PEM_INDEX 🔑 the index in the PEM file (default: 0) + --keyfile KEYFILE 🔑 a JSON keyfile, if PEM not provided + --passfile PASSFILE 🔑 a file containing keyfile's password, if keyfile provided + --ledger 🔐 bool flag for signing transaction using ledger + --ledger-account-index LEDGER_ACCOUNT_INDEX 🔐 the index of the account when using Ledger + --ledger-address-index LEDGER_ADDRESS_INDEX 🔐 the index of the address when using Ledger + --sender-username SENDER_USERNAME 🖄 the username of the sender + --nonce NONCE # the nonce for the transaction + --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: + False) + --receiver RECEIVER 🖄 the address of the receiver + --receiver-username RECEIVER_USERNAME 🖄 the username of the receiver + --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) + --gas-limit GAS_LIMIT ⛽ the gas limit + --value VALUE the value to transfer (default: 0) + --data DATA the payload, or 'memo' of the transaction (default: ) + --chain CHAIN the chain identifier (default: T) + --version VERSION the transaction version (default: 1) + --options OPTIONS the transaction options (default: 0) + --data-file DATA_FILE a file containing transaction data + --outfile OUTFILE where to save the output (signed transaction, hash) (default: stdout) + --send ✓ whether to broadcast the transaction (default: False) + --simulate whether to simulate the transaction (default: False) + --relay whether to relay the transaction (default: False) + --proxy PROXY 🔗 the URL of the proxy (default: https://testnet-api.elrond.com) + --wait-result signal to wait for the transaction result - only valid if --send is set + --timeout TIMEOUT max num of seconds to wait for result - only valid if --wait-result is + set ``` ### Transactions.Send @@ -355,7 +379,7 @@ optional arguments: -h, --help show this help message and exit --infile INFILE input file (a previously saved transaction) --outfile OUTFILE where to save the output (the hash) (default: stdout) - --proxy PROXY 🖧 the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY 🔗 the URL of the proxy (default: https://testnet-api.elrond.com) ``` ### Transactions.Get @@ -372,7 +396,7 @@ optional arguments: --hash HASH the hash --sender SENDER the sender address --with-results will also return the results of transaction - --proxy PROXY 🖧 the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY 🔗 the URL of the proxy (default: https://testnet-api.elrond.com) --omit-fields OMIT_FIELDS omit fields in the output payload (default: []) ``` @@ -403,7 +427,7 @@ Get hyperblock optional arguments: -h, --help show this help message and exit - --proxy PROXY 🖧 the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY 🔗 the URL of the proxy (default: https://testnet-api.elrond.com) --key KEY the hash or the nonce of the hyperblock ``` @@ -414,10 +438,10 @@ optional arguments: $ erdpy validator --help usage: erdpy validator COMMAND [-h] ... -Stake, Unjail and other actions useful for Validators +Stake, UnStake, UnBond, Unjail and other actions useful for Validators COMMANDS: - {stake,unstake,unjail,unbond,change-reward-address,claim} + {stake,unstake,unjail,unbond,change-reward-address,claim,unstake-nodes,unstake-tokens,unbond-nodes,unbond-tokens,clean-registered-data,restake-unstaked-nodes} OPTIONS: -h, --help show this help message and exit @@ -428,9 +452,15 @@ COMMANDS summary stake Stake value into the Network unstake Unstake value unjail Unjail a Validator Node -unbond Unbond +unbond Unbond tokens for a bls key change-reward-address Change the reward address claim Claim rewards +unstake-nodes Unstake-nodes will unstake nodes for provided bls keys +unstake-tokens This command will un-stake the given amount (if value is greater than the existing topUp value, it will unStake one or several nodes) +unbond-nodes It will unBond nodes +unbond-tokens It will unBond tokens, if provided value is bigger that topUp value will unBond nodes +clean-registered-data Deletes duplicated keys from registered data +restake-unstaked-nodes It will reStake UnStaked nodes ``` ### Validator.Stake @@ -443,29 +473,32 @@ usage: erdpy validator stake [-h] ... Stake value into the Network optional arguments: - -h, --help show this help message and exit - --proxy PROXY 🖧 the URL of the proxy (default: https://testnet-gateway.elrond.com) - --pem PEM 🔑 the PEM file, if keyfile or ledger are not provided - --pem-index PEM_INDEX 🔑 the index in the PEM file (default: 0) - --keyfile KEYFILE 🔑 a JSON keyfile, if PEM of ledger not provided - --passfile PASSFILE 🔑 a file containing keyfile's password, if keyfile provided - --ledger 🔐 bool flag for signing transaction using ledger - --ledger-account-index 🔐 the index of the account (only applicable if --ledger is set) - --ledger-address-index 🔐 the index of the address (only applicable if --ledger is set) - --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction - --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: False) - --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) - --gas-limit GAS_LIMIT ⛽ the gas limit - --estimate-gas ⛽ whether to estimate the gas limit (default: 0) - --value VALUE the value to transfer (default: 0) - --chain CHAIN the chain identifier (default: T) - --version VERSION the transaction version (default: 1) - --send ✓ whether to broadcast the transaction (default: False) - --simulate whether to simulate the transaction (default: False) - --outfile OUTFILE where to save the output (signed transaction, hash) (default: stdout) - --reward-address REWARD_ADDRESS the reward address - --validators-file VALIDATORS_FILE a JSON file describing the Nodes + -h, --help show this help message and exit + --proxy PROXY 🔗 the URL of the proxy (default: https://testnet-api.elrond.com) + --pem PEM 🔑 the PEM file, if keyfile not provided + --pem-index PEM_INDEX 🔑 the index in the PEM file (default: 0) + --keyfile KEYFILE 🔑 a JSON keyfile, if PEM not provided + --passfile PASSFILE 🔑 a file containing keyfile's password, if keyfile provided + --ledger 🔐 bool flag for signing transaction using ledger + --ledger-account-index LEDGER_ACCOUNT_INDEX 🔐 the index of the account when using Ledger + --ledger-address-index LEDGER_ADDRESS_INDEX 🔐 the index of the address when using Ledger + --sender-username SENDER_USERNAME 🖄 the username of the sender + --nonce NONCE # the nonce for the transaction + --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: + False) + --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) + --gas-limit GAS_LIMIT ⛽ the gas limit + --estimate-gas ⛽ whether to estimate the gas limit (default: 0) + --value VALUE the value to transfer (default: 0) + --chain CHAIN the chain identifier (default: T) + --version VERSION the transaction version (default: 1) + --options OPTIONS the transaction options (default: 0) + --send ✓ whether to broadcast the transaction (default: False) + --simulate whether to simulate the transaction (default: False) + --outfile OUTFILE where to save the output (signed transaction, hash) (default: stdout) + --reward-address REWARD_ADDRESS the reward address + --validators-file VALIDATORS_FILE a JSON file describing the Nodes + --top-up Stake value for top up ``` ### Validator.Unstake @@ -478,28 +511,30 @@ usage: erdpy validator unstake [-h] ... Unstake value optional arguments: - -h, --help show this help message and exit - --proxy PROXY 🖧 the URL of the proxy (default: https://testnet-gateway.elrond.com) - --pem PEM 🔑 the PEM file, if keyfile or ledger are not provided - --pem-index PEM_INDEX 🔑 the index in the PEM file (default: 0) - --keyfile KEYFILE 🔑 a JSON keyfile, if PEM of ledger not provided - --passfile PASSFILE 🔑 a file containing keyfile's password, if keyfile provided - --ledger 🔐 bool flag for signing transaction using ledger - --ledger-account-index 🔐 the index of the account (only applicable if --ledger is set) - --ledger-address-index 🔐 the index of the address (only applicable if --ledger is set) - --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction - --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: False) - --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) - --gas-limit GAS_LIMIT ⛽ the gas limit - --estimate-gas ⛽ whether to estimate the gas limit (default: 0) - --value VALUE the value to transfer (default: 0) - --chain CHAIN the chain identifier (default: T) - --version VERSION the transaction version (default: 1) - --send ✓ whether to broadcast the transaction (default: False) - --simulate whether to simulate the transaction (default: False) - --outfile OUTFILE where to save the output (signed transaction, hash) (default: stdout) - --nodes-public-keys NODES_PUBLIC_KEYS the public keys of the nodes as CSV (addrA,addrB) + -h, --help show this help message and exit + --proxy PROXY 🔗 the URL of the proxy (default: https://testnet-api.elrond.com) + --pem PEM 🔑 the PEM file, if keyfile not provided + --pem-index PEM_INDEX 🔑 the index in the PEM file (default: 0) + --keyfile KEYFILE 🔑 a JSON keyfile, if PEM not provided + --passfile PASSFILE 🔑 a file containing keyfile's password, if keyfile provided + --ledger 🔐 bool flag for signing transaction using ledger + --ledger-account-index LEDGER_ACCOUNT_INDEX 🔐 the index of the account when using Ledger + --ledger-address-index LEDGER_ADDRESS_INDEX 🔐 the index of the address when using Ledger + --sender-username SENDER_USERNAME 🖄 the username of the sender + --nonce NONCE # the nonce for the transaction + --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: + False) + --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) + --gas-limit GAS_LIMIT ⛽ the gas limit + --estimate-gas ⛽ whether to estimate the gas limit (default: 0) + --value VALUE the value to transfer (default: 0) + --chain CHAIN the chain identifier (default: T) + --version VERSION the transaction version (default: 1) + --options OPTIONS the transaction options (default: 0) + --send ✓ whether to broadcast the transaction (default: False) + --simulate whether to simulate the transaction (default: False) + --outfile OUTFILE where to save the output (signed transaction, hash) (default: stdout) + --nodes-public-keys NODES_PUBLIC_KEYS the public keys of the nodes as CSV (addrA,addrB) ``` ### Validator.Unjail @@ -512,28 +547,30 @@ usage: erdpy validator unjail [-h] ... Unjail a Validator Node optional arguments: - -h, --help show this help message and exit - --proxy PROXY 🖧 the URL of the proxy (default: https://testnet-gateway.elrond.com) - --pem PEM 🔑 the PEM file, if keyfile or ledger are not provided - --pem-index PEM_INDEX 🔑 the index in the PEM file (default: 0) - --keyfile KEYFILE 🔑 a JSON keyfile, if PEM of ledger not provided - --passfile PASSFILE 🔑 a file containing keyfile's password, if keyfile provided - --ledger 🔐 bool flag for signing transaction using ledger - --ledger-account-index 🔐 the index of the account (only applicable if --ledger is set) - --ledger-address-index 🔐 the index of the address (only applicable if --ledger is set) - --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction - --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: False) - --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) - --gas-limit GAS_LIMIT ⛽ the gas limit - --estimate-gas ⛽ whether to estimate the gas limit (default: 0) - --value VALUE the value to transfer (default: 0) - --chain CHAIN the chain identifier (default: T) - --version VERSION the transaction version (default: 1) - --send ✓ whether to broadcast the transaction (default: False) - --simulate whether to simulate the transaction (default: False) - --outfile OUTFILE where to save the output (signed transaction, hash) (default: stdout) - --nodes-public-keys NODES_PUBLIC_KEYS the public keys of the nodes as CSV (addrA,addrB) + -h, --help show this help message and exit + --proxy PROXY 🔗 the URL of the proxy (default: https://testnet-api.elrond.com) + --pem PEM 🔑 the PEM file, if keyfile not provided + --pem-index PEM_INDEX 🔑 the index in the PEM file (default: 0) + --keyfile KEYFILE 🔑 a JSON keyfile, if PEM not provided + --passfile PASSFILE 🔑 a file containing keyfile's password, if keyfile provided + --ledger 🔐 bool flag for signing transaction using ledger + --ledger-account-index LEDGER_ACCOUNT_INDEX 🔐 the index of the account when using Ledger + --ledger-address-index LEDGER_ADDRESS_INDEX 🔐 the index of the address when using Ledger + --sender-username SENDER_USERNAME 🖄 the username of the sender + --nonce NONCE # the nonce for the transaction + --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: + False) + --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) + --gas-limit GAS_LIMIT ⛽ the gas limit + --estimate-gas ⛽ whether to estimate the gas limit (default: 0) + --value VALUE the value to transfer (default: 0) + --chain CHAIN the chain identifier (default: T) + --version VERSION the transaction version (default: 1) + --options OPTIONS the transaction options (default: 0) + --send ✓ whether to broadcast the transaction (default: False) + --simulate whether to simulate the transaction (default: False) + --outfile OUTFILE where to save the output (signed transaction, hash) (default: stdout) + --nodes-public-keys NODES_PUBLIC_KEYS the public keys of the nodes as CSV (addrA,addrB) ``` ### Validator.Unbond @@ -543,31 +580,33 @@ optional arguments: $ erdpy validator unbond --help usage: erdpy validator unbond [-h] ... -Unbond +Unbond tokens for a bls key optional arguments: - -h, --help show this help message and exit - --proxy PROXY 🖧 the URL of the proxy (default: https://testnet-gateway.elrond.com) - --pem PEM 🔑 the PEM file, if keyfile or ledger are not provided - --pem-index PEM_INDEX 🔑 the index in the PEM file (default: 0) - --keyfile KEYFILE 🔑 a JSON keyfile, if PEM of ledger not provided - --passfile PASSFILE 🔑 a file containing keyfile's password, if keyfile provided - --ledger 🔐 bool flag for signing transaction using ledger - --ledger-account-index 🔐 the index of the account (only applicable if --ledger is set) - --ledger-address-index 🔐 the index of the address (only applicable if --ledger is set) - --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction - --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: False) - --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) - --gas-limit GAS_LIMIT ⛽ the gas limit - --estimate-gas ⛽ whether to estimate the gas limit (default: 0) - --value VALUE the value to transfer (default: 0) - --chain CHAIN the chain identifier (default: T) - --version VERSION the transaction version (default: 1) - --send ✓ whether to broadcast the transaction (default: False) - --simulate whether to simulate the transaction (default: False) - --outfile OUTFILE where to save the output (signed transaction, hash) (default: stdout) - --nodes-public-keys NODES_PUBLIC_KEYS the public keys of the nodes as CSV (addrA,addrB) + -h, --help show this help message and exit + --proxy PROXY 🔗 the URL of the proxy (default: https://testnet-api.elrond.com) + --pem PEM 🔑 the PEM file, if keyfile not provided + --pem-index PEM_INDEX 🔑 the index in the PEM file (default: 0) + --keyfile KEYFILE 🔑 a JSON keyfile, if PEM not provided + --passfile PASSFILE 🔑 a file containing keyfile's password, if keyfile provided + --ledger 🔐 bool flag for signing transaction using ledger + --ledger-account-index LEDGER_ACCOUNT_INDEX 🔐 the index of the account when using Ledger + --ledger-address-index LEDGER_ADDRESS_INDEX 🔐 the index of the address when using Ledger + --sender-username SENDER_USERNAME 🖄 the username of the sender + --nonce NONCE # the nonce for the transaction + --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: + False) + --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) + --gas-limit GAS_LIMIT ⛽ the gas limit + --estimate-gas ⛽ whether to estimate the gas limit (default: 0) + --value VALUE the value to transfer (default: 0) + --chain CHAIN the chain identifier (default: T) + --version VERSION the transaction version (default: 1) + --options OPTIONS the transaction options (default: 0) + --send ✓ whether to broadcast the transaction (default: False) + --simulate whether to simulate the transaction (default: False) + --outfile OUTFILE where to save the output (signed transaction, hash) (default: stdout) + --nodes-public-keys NODES_PUBLIC_KEYS the public keys of the nodes as CSV (addrA,addrB) ``` ### Validator.ChangeRewardAddress @@ -580,28 +619,30 @@ usage: erdpy validator change-reward-address [-h] ... Change the reward address optional arguments: - -h, --help show this help message and exit - --proxy PROXY 🖧 the URL of the proxy (default: https://testnet-gateway.elrond.com) - --pem PEM 🔑 the PEM file, if keyfile or ledger are not provided - --pem-index PEM_INDEX 🔑 the index in the PEM file (default: 0) - --keyfile KEYFILE 🔑 a JSON keyfile, if PEM of ledger not provided - --passfile PASSFILE 🔑 a file containing keyfile's password, if keyfile provided - --ledger 🔐 bool flag for signing transaction using ledger - --ledger-account-index 🔐 the index of the account (only applicable if --ledger is set) - --ledger-address-index 🔐 the index of the address (only applicable if --ledger is set) - --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction - --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: False) - --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) - --gas-limit GAS_LIMIT ⛽ the gas limit - --estimate-gas ⛽ whether to estimate the gas limit (default: 0) - --value VALUE the value to transfer (default: 0) - --chain CHAIN the chain identifier (default: T) - --version VERSION the transaction version (default: 1) - --send ✓ whether to broadcast the transaction (default: False) - --simulate whether to simulate the transaction (default: False) - --outfile OUTFILE where to save the output (signed transaction, hash) (default: stdout) - --reward-address REWARD_ADDRESS the new reward address + -h, --help show this help message and exit + --proxy PROXY 🔗 the URL of the proxy (default: https://testnet-api.elrond.com) + --pem PEM 🔑 the PEM file, if keyfile not provided + --pem-index PEM_INDEX 🔑 the index in the PEM file (default: 0) + --keyfile KEYFILE 🔑 a JSON keyfile, if PEM not provided + --passfile PASSFILE 🔑 a file containing keyfile's password, if keyfile provided + --ledger 🔐 bool flag for signing transaction using ledger + --ledger-account-index LEDGER_ACCOUNT_INDEX 🔐 the index of the account when using Ledger + --ledger-address-index LEDGER_ADDRESS_INDEX 🔐 the index of the address when using Ledger + --sender-username SENDER_USERNAME 🖄 the username of the sender + --nonce NONCE # the nonce for the transaction + --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: + False) + --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) + --gas-limit GAS_LIMIT ⛽ the gas limit + --estimate-gas ⛽ whether to estimate the gas limit (default: 0) + --value VALUE the value to transfer (default: 0) + --chain CHAIN the chain identifier (default: T) + --version VERSION the transaction version (default: 1) + --options OPTIONS the transaction options (default: 0) + --send ✓ whether to broadcast the transaction (default: False) + --simulate whether to simulate the transaction (default: False) + --outfile OUTFILE where to save the output (signed transaction, hash) (default: stdout) + --reward-address REWARD_ADDRESS the new reward address ``` ### Validator.Claim @@ -614,27 +655,29 @@ usage: erdpy validator claim [-h] ... Claim rewards optional arguments: - -h, --help show this help message and exit - --proxy PROXY 🖧 the URL of the proxy (default: https://testnet-gateway.elrond.com) - --pem PEM 🔑 the PEM file, if keyfile or ledger are not provided - --pem-index PEM_INDEX 🔑 the index in the PEM file (default: 0) - --keyfile KEYFILE 🔑 a JSON keyfile, if PEM of ledger not provided - --passfile PASSFILE 🔑 a file containing keyfile's password, if keyfile provided - --ledger 🔐 bool flag for signing transaction using ledger - --ledger-account-index 🔐 the index of the account (only applicable if --ledger is set) - --ledger-address-index 🔐 the index of the address (only applicable if --ledger is set) - --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction - --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: False) - --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) - --gas-limit GAS_LIMIT ⛽ the gas limit - --estimate-gas ⛽ whether to estimate the gas limit (default: 0) - --value VALUE the value to transfer (default: 0) - --chain CHAIN the chain identifier (default: T) - --version VERSION the transaction version (default: 1) - --send ✓ whether to broadcast the transaction (default: False) - --simulate whether to simulate the transaction (default: False) - --outfile OUTFILE where to save the output (signed transaction, hash) (default: stdout) + -h, --help show this help message and exit + --proxy PROXY 🔗 the URL of the proxy (default: https://testnet-api.elrond.com) + --pem PEM 🔑 the PEM file, if keyfile not provided + --pem-index PEM_INDEX 🔑 the index in the PEM file (default: 0) + --keyfile KEYFILE 🔑 a JSON keyfile, if PEM not provided + --passfile PASSFILE 🔑 a file containing keyfile's password, if keyfile provided + --ledger 🔐 bool flag for signing transaction using ledger + --ledger-account-index LEDGER_ACCOUNT_INDEX 🔐 the index of the account when using Ledger + --ledger-address-index LEDGER_ADDRESS_INDEX 🔐 the index of the address when using Ledger + --sender-username SENDER_USERNAME 🖄 the username of the sender + --nonce NONCE # the nonce for the transaction + --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: + False) + --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) + --gas-limit GAS_LIMIT ⛽ the gas limit + --estimate-gas ⛽ whether to estimate the gas limit (default: 0) + --value VALUE the value to transfer (default: 0) + --chain CHAIN the chain identifier (default: T) + --version VERSION the transaction version (default: 1) + --options OPTIONS the transaction options (default: 0) + --send ✓ whether to broadcast the transaction (default: False) + --simulate whether to simulate the transaction (default: False) + --outfile OUTFILE where to save the output (signed transaction, hash) (default: stdout) ``` ## Group **Account** @@ -670,7 +713,7 @@ Query account details (nonce, balance etc.) optional arguments: -h, --help show this help message and exit - --proxy PROXY 🖧 the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY 🔗 the URL of the proxy (default: https://testnet-api.elrond.com) --address ADDRESS 🖄 the address to query --balance whether to only fetch the balance --nonce whether to only fetch the nonce @@ -689,7 +732,7 @@ Query account transactions optional arguments: -h, --help show this help message and exit - --proxy PROXY 🖧 the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY 🔗 the URL of the proxy (default: https://testnet-api.elrond.com) --outfile OUTFILE where to save the output (default: stdout) --address ADDRESS 🖄 the address to query @@ -704,7 +747,7 @@ usage: erdpy wallet COMMAND [-h] ... Derive secret key from mnemonic, bech32 address helpers etc. COMMANDS: - {derive,bech32,pem-address,pem-address-hex} + {new,derive,bech32,pem-address,pem-address-hex} OPTIONS: -h, --help show this help message and exit @@ -712,11 +755,28 @@ OPTIONS: ---------------- COMMANDS summary ---------------- +new Create a new wallet derive Derive a PEM file from a mnemonic or generate a new PEM file (for tests only!) bech32 Helper for encoding and decoding bech32 addresses pem-address Get the public address out of a PEM file as bech32 pem-address-hex Get the public address out of a PEM file as hex +``` +### Wallet.New + + +``` +$ erdpy wallet new --help +usage: erdpy wallet new [-h] ... + +Create a new wallet + +optional arguments: + -h, --help show this help message and exit + --json whether to create a json key file + --pem whether to create a pem key file + --output-path OUTPUT_PATH the output path and base file name for the generated wallet files (default: ./wallet) + ``` ### Wallet.Derive @@ -860,7 +920,7 @@ Get the number of shards. optional arguments: -h, --help show this help message and exit - --proxy PROXY 🖧 the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY 🔗 the URL of the proxy (default: https://testnet-api.elrond.com) ``` ### Network.BlockNonce @@ -874,7 +934,7 @@ Get the latest block nonce, by shard. optional arguments: -h, --help show this help message and exit - --proxy PROXY 🖧 the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY 🔗 the URL of the proxy (default: https://testnet-api.elrond.com) --shard SHARD the shard ID (use 4294967295 for metachain) ``` @@ -889,7 +949,7 @@ Get the chain identifier. optional arguments: -h, --help show this help message and exit - --proxy PROXY 🖧 the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY 🔗 the URL of the proxy (default: https://testnet-api.elrond.com) ``` ## Group **Cost** @@ -927,7 +987,7 @@ Query minimum gas price optional arguments: -h, --help show this help message and exit - --proxy PROXY 🖧 the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY 🔗 the URL of the proxy (default: https://testnet-api.elrond.com) ``` ### Cost.TxTransfer @@ -941,7 +1001,7 @@ Query cost of regular transaction (transfer) optional arguments: -h, --help show this help message and exit - --proxy PROXY 🖧 the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY 🔗 the URL of the proxy (default: https://testnet-api.elrond.com) --data DATA a transaction payload, required to estimate the cost ``` @@ -956,9 +1016,9 @@ Query cost of Smart Contract deploy transaction optional arguments: -h, --help show this help message and exit - --proxy PROXY 🖧 the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY 🔗 the URL of the proxy (default: https://testnet-api.elrond.com) --project PROJECT 🗀 the project directory (default: current directory) - --bytecode BYTECODE the WASM file + --bytecode BYTECODE the file containing the WASM bytecode --arguments ARGUMENTS [ARGUMENTS ...] arguments for the contract transaction, as numbers or hex-encoded. E.g. --arguments 42 0x64 1000 0xabba @@ -977,7 +1037,7 @@ positional arguments: optional arguments: -h, --help show this help message and exit - --proxy PROXY 🖧 the URL of the proxy (default: https://testnet-gateway.elrond.com) + --proxy PROXY 🔗 the URL of the proxy (default: https://testnet-api.elrond.com) --function FUNCTION the function to call --arguments ARGUMENTS [ARGUMENTS ...] arguments for the contract transaction, as numbers or hex-encoded. E.g. --arguments 42 0x64 1000 0xabba @@ -1026,6 +1086,7 @@ optional arguments: --data DATA the payload, or 'memo' of the transaction (default: ) --chain CHAIN the chain identifier (default: T) --version VERSION the transaction version (default: 1) + --options OPTIONS the transaction options (default: 0) ``` ### Dispatcher.Dispatch @@ -1038,16 +1099,16 @@ usage: erdpy dispatcher dispatch [-h] ... Dispatch queued transactions optional arguments: - -h, --help show this help message and exit - --proxy PROXY 🖧 the URL of the proxy (default: https://testnet-gateway.elrond.com) - --pem PEM 🔑 the PEM file, if keyfile or ledger are not provided - --pem-index PEM_INDEX 🔑 the index in the PEM file (default: 0) - --keyfile KEYFILE 🔑 a JSON keyfile, if PEM of ledger not provided - --passfile PASSFILE 🔑 a file containing keyfile's password, if keyfile provided - --ledger 🔐 bool flag for signing transaction using ledger - --ledger-account-index 🔐 the index of the account (only applicable if --ledger is set) - --ledger-address-index 🔐 the index of the address (only applicable if --ledger is set) - --sender-username SENDER_USERNAME 🖄 the username of the sender + -h, --help show this help message and exit + --proxy PROXY 🔗 the URL of the proxy (default: https://testnet-api.elrond.com) + --pem PEM 🔑 the PEM file, if keyfile not provided + --pem-index PEM_INDEX 🔑 the index in the PEM file (default: 0) + --keyfile KEYFILE 🔑 a JSON keyfile, if PEM not provided + --passfile PASSFILE 🔑 a file containing keyfile's password, if keyfile provided + --ledger 🔐 bool flag for signing transaction using ledger + --ledger-account-index LEDGER_ACCOUNT_INDEX 🔐 the index of the account when using Ledger + --ledger-address-index LEDGER_ADDRESS_INDEX 🔐 the index of the address when using Ledger + --sender-username SENDER_USERNAME 🖄 the username of the sender ``` ### Dispatcher.DispatchContinuously @@ -1060,17 +1121,17 @@ usage: erdpy dispatcher dispatch-continuously [-h] ... Continuously dispatch queued transactions optional arguments: - -h, --help show this help message and exit - --proxy PROXY 🖧 the URL of the proxy (default: https://testnet-gateway.elrond.com) - --pem PEM 🔑 the PEM file, if keyfile or ledger are not provided - --pem-index PEM_INDEX 🔑 the index in the PEM file (default: 0) - --keyfile KEYFILE 🔑 a JSON keyfile, if PEM of ledger not provided - --passfile PASSFILE 🔑 a file containing keyfile's password, if keyfile provided - --ledger 🔐 bool flag for signing transaction using ledger - --ledger-account-index 🔐 the index of the account (only applicable if --ledger is set) - --ledger-address-index 🔐 the index of the address (only applicable if --ledger is set) - --sender-username SENDER_USERNAME 🖄 the username of the sender - --interval INTERVAL the interval to retrieve transactions from the queue, in seconds + -h, --help show this help message and exit + --proxy PROXY 🔗 the URL of the proxy (default: https://testnet-api.elrond.com) + --pem PEM 🔑 the PEM file, if keyfile not provided + --pem-index PEM_INDEX 🔑 the index in the PEM file (default: 0) + --keyfile KEYFILE 🔑 a JSON keyfile, if PEM not provided + --passfile PASSFILE 🔑 a file containing keyfile's password, if keyfile provided + --ledger 🔐 bool flag for signing transaction using ledger + --ledger-account-index LEDGER_ACCOUNT_INDEX 🔐 the index of the account when using Ledger + --ledger-address-index LEDGER_ADDRESS_INDEX 🔐 the index of the address when using Ledger + --sender-username SENDER_USERNAME 🖄 the username of the sender + --interval INTERVAL the interval to retrieve transactions from the queue, in seconds ``` ### Dispatcher.Clean @@ -1185,7 +1246,7 @@ usage: erdpy deps install [-h] ... Install dependencies or elrond-sdk modules. positional arguments: - {llvm,clang,cpp,arwentools,rust,nodejs,elrond_go,elrond_proxy_go,golang,mcl_signer} + {all,llvm,clang,cpp,vmtools,rust,nodejs,elrond_go,elrond_proxy_go,golang,mcl_signer} the dependency to install optional arguments: @@ -1204,7 +1265,7 @@ usage: erdpy deps check [-h] ... Check whether a dependency is installed. positional arguments: - {llvm,clang,cpp,arwentools,rust,nodejs,elrond_go,elrond_proxy_go,golang,mcl_signer} + {all,llvm,clang,cpp,vmtools,rust,nodejs,elrond_go,elrond_proxy_go,golang,mcl_signer} the dependency to check optional arguments: @@ -1222,7 +1283,7 @@ usage: erdpy config COMMAND [-h] ... Configure elrond-sdk (default values etc.) COMMANDS: - {dump,get,set,new,switch,list} + {dump,get,set,delete,new,switch,list} OPTIONS: -h, --help show this help message and exit @@ -1233,6 +1294,7 @@ COMMANDS summary dump Dumps configuration. get Gets a configuration value. set Sets a configuration value. +delete Deletes a configuration value. new Creates a new configuration. switch Switch to a different config list List available configs @@ -1249,6 +1311,7 @@ Dumps configuration. optional arguments: -h, --help show this help message and exit + --defaults dump defaults instead of local config ``` ### Configuration.Get @@ -1401,46 +1464,3 @@ optional arguments: --use-global use the global storage (default: False) ``` - -## Group **Ledger** - - - -``` -usage: erdpy ledger COMMAND [-h] ... - -Get Ledger App addresses and version - -COMMANDS: - {addresses,version} - -OPTIONS: - -h, --help show this help message and exit - ----------------- -COMMANDS summary ----------------- -addresses Print multiple addresses for the Ledger device -version Print the Elrond App version -``` - -### Ledger.addresses -``` -usage: erdpy ledger addresses [-h] ... - -Get the addresses within Ledger - -optional arguments: - -h, --help show this help message and exit - --num-addresses NUM_ADDRESSES The number of addresses to fetch -``` - -### Ledger.version -``` -usage: erdpy ledger version [-h] ... - -Get the version of the Elrond App for Ledger - -optional arguments: - -h, --help show this help message and exit -``` diff --git a/erdpy/CLI.md.sh b/erdpy/CLI.md.sh index 498cbc46..1afbc44c 100755 --- a/erdpy/CLI.md.sh +++ b/erdpy/CLI.md.sh @@ -67,8 +67,9 @@ generate() { group "Account" "account" command "Account.Get" "account get" command "Account.GetTransactions" "account get-transactions" - + group "Wallet" "wallet" + command "Wallet.New" "wallet new" command "Wallet.Derive" "wallet derive" command "Wallet.Bech32" "wallet bech32" diff --git a/erdpy/config.py b/erdpy/config.py index 02c8f878..101584c7 100644 --- a/erdpy/config.py +++ b/erdpy/config.py @@ -148,10 +148,10 @@ def get_defaults() -> Dict[str, Any]: "proxy": "https://testnet-gateway.elrond.com", "chainID": "T", "txVersion": "1", - "dependencies.arwentools.tag": "latest", + "dependencies.vmtools.tag": "latest", "dependencies.elrond_wasm_rs.tag": "latest", - "dependencies.arwentools.urlTemplate.linux": "https://github.com/ElrondNetwork/arwen-wasm-vm/archive/{TAG}.tar.gz", - "dependencies.arwentools.urlTemplate.osx": "https://github.com/ElrondNetwork/arwen-wasm-vm/archive/{TAG}.tar.gz", + "dependencies.vmtools.urlTemplate.linux": "https://github.com/ElrondNetwork/wasm-vm/archive/{TAG}.tar.gz", + "dependencies.vmtools.urlTemplate.osx": "https://github.com/ElrondNetwork/wasm-vm/archive/{TAG}.tar.gz", "dependencies.llvm.tag": "v9-19feb", "dependencies.llvm.urlTemplate.linux": "https://ide.elrond.com/vendor-llvm/{TAG}/linux-amd64.tar.gz?t=19feb", "dependencies.llvm.urlTemplate.osx": "https://ide.elrond.com/vendor-llvm/{TAG}/darwin-amd64.tar.gz?t=19feb", diff --git a/erdpy/constants.py b/erdpy/constants.py index a8825d59..599aa321 100644 --- a/erdpy/constants.py +++ b/erdpy/constants.py @@ -1,5 +1,5 @@ VM_TYPE_SYSTEM = "0001" -VM_TYPE_ARWEN = "0500" +VM_TYPE_WASM_VM = "0500" SC_HEX_PUBKEY_PREFIX = "0" * 16 SC_HEX_PUBKEY_PREFIX_SYSTEM = SC_HEX_PUBKEY_PREFIX + VM_TYPE_SYSTEM + "0" * 30 -SC_HEX_PUBKEY_PREFIX_ARWEN = SC_HEX_PUBKEY_PREFIX + VM_TYPE_ARWEN +SC_HEX_PUBKEY_PREFIX_WASM_VM = SC_HEX_PUBKEY_PREFIX + VM_TYPE_WASM_VM diff --git a/erdpy/contracts.py b/erdpy/contracts.py index 90bed1d9..39d09d1e 100644 --- a/erdpy/contracts.py +++ b/erdpy/contracts.py @@ -52,7 +52,7 @@ def deploy(self, owner: Account, arguments: List[Any], gas_price: int, gas_limit return tx def prepare_deploy_transaction_data(self, arguments: List[Any]): - tx_data = f"{self.bytecode}@{constants.VM_TYPE_ARWEN}@{self.metadata.to_hex()}" + tx_data = f"{self.bytecode}@{constants.VM_TYPE_WASM_VM}@{self.metadata.to_hex()}" for arg in arguments: tx_data += f"@{_prepare_argument(arg)}" diff --git a/erdpy/dependencies/install.py b/erdpy/dependencies/install.py index aebe12e8..fd142aa2 100644 --- a/erdpy/dependencies/install.py +++ b/erdpy/dependencies/install.py @@ -3,7 +3,7 @@ from typing import Dict, List from erdpy import config, errors -from erdpy.dependencies.modules import (ArwenToolsModule, DependencyModule, +from erdpy.dependencies.modules import (VMToolsModule, DependencyModule, GolangModule, MclSignerModule, NodejsModule, Rust, StandaloneModule) @@ -12,7 +12,7 @@ def install_module(key: str, tag: str = "", overwrite: bool = False): if key == 'all': - modules = get_all_deps() + modules = get_all_deps_installable_via_cli() else: modules = [get_module_by_key(key)] @@ -47,7 +47,7 @@ def get_deps_dict() -> Dict[str, DependencyModule]: def get_all_deps() -> List[DependencyModule]: return [ StandaloneModule(key="llvm", aliases=["clang", "cpp"]), - ArwenToolsModule(key="arwentools"), + VMToolsModule(key="vmtools"), Rust(key="rust"), NodejsModule(key="nodejs", aliases=[]), StandaloneModule(key="elrond_go", repo_name="elrond-go", organisation="ElrondNetwork"), @@ -57,6 +57,16 @@ def get_all_deps() -> List[DependencyModule]: ] +def get_all_deps_installable_via_cli() -> List[DependencyModule]: + return [ + VMToolsModule(key="vmtools"), + StandaloneModule(key="elrond_go", repo_name="elrond-go", organisation="ElrondNetwork"), + StandaloneModule(key="elrond_proxy_go", repo_name="elrond-proxy-go", organisation="ElrondNetwork"), + MclSignerModule(key="mcl_signer") + ] + + + def get_golang() -> GolangModule: golang = get_module_by_key('golang') assert isinstance(golang, GolangModule) diff --git a/erdpy/dependencies/modules.py b/erdpy/dependencies/modules.py index 7e0ff379..fa172f21 100644 --- a/erdpy/dependencies/modules.py +++ b/erdpy/dependencies/modules.py @@ -143,22 +143,19 @@ def _get_archive_path(self, tag: str) -> Path: return archive -class ArwenToolsModule(StandaloneModule): +class VMToolsModule(StandaloneModule): def __init__(self, key: str, aliases: List[str] = None): if aliases is None: aliases = list() super().__init__(key, aliases) - self.repo_name = 'arwen-wasm-vm' + self.repo_name = 'wasm-vm' self.organisation = 'ElrondNetwork' def _post_install(self, tag: str): dependencies.install_module('golang') - self.build_binary(tag, 'arwendebug') self.build_binary(tag, 'test') - - self.make_binary_symlink_in_parent_folder(tag, 'arwendebug', 'arwendebug') self.make_binary_symlink_in_parent_folder(tag, 'test', 'mandos-test') self.copy_libwasmer_in_parent_directory(tag) diff --git a/erdpy/projects/core.py b/erdpy/projects/core.py index 0c16dac5..8add3b2e 100644 --- a/erdpy/projects/core.py +++ b/erdpy/projects/core.py @@ -58,7 +58,7 @@ def run_tests(args: Any): logger.info("run_tests.project: %s", project) - dependencies.install_module("arwentools") + dependencies.install_module("vmtools") guards.is_directory(project) project = load_project(project) diff --git a/erdpy/projects/project_base.py b/erdpy/projects/project_base.py index 59e48732..ab4c84fb 100644 --- a/erdpy/projects/project_base.py +++ b/erdpy/projects/project_base.py @@ -26,7 +26,7 @@ def build(self, options: Union[Dict[str, Any], None] = None) -> Path: return self._do_after_build() def clean(self): - utils.remove_folder(self._get_output_folder()) + utils.remove_folder(self.get_output_folder()) def _ensure_dependencies_installed(self): module_keys = self.get_dependencies() @@ -42,36 +42,35 @@ def perform_build(self) -> None: def get_file_wasm(self): return self.find_file_in_output("*.wasm") - def find_file_globally(self, pattern): - folder = self.directory - return self.find_file_in_folder(folder, pattern) + def find_file_globally(self, pattern: str) -> Path: + return self.find_file_in_folder(self.path, pattern) - def find_file_in_output(self, pattern): - folder = path.join(self.directory, "output") + def find_file_in_output(self, pattern: str) -> Path: + folder = self.path / 'output' return self.find_file_in_folder(folder, pattern) - def find_file_in_folder(self, folder, pattern): - files = list(Path(folder).rglob(pattern)) + def find_file_in_folder(self, folder: Path, pattern: str) -> Path: + files = list(folder.rglob(pattern)) if len(files) == 0: raise errors.KnownError(f"No file matches pattern [{pattern}].") if len(files) > 1: logger.warning(f"More files match pattern [{pattern}]. Will pick first:\n{files}") - file = path.join(folder, files[0]) + file = folder / files[0] return Path(file).resolve() def _do_after_build(self) -> Path: raise NotImplementedError() - def _copy_to_output(self, source: str, destination: str = None) -> Path: - output_folder = self._get_output_folder() + def _copy_to_output(self, source: Path, destination: str = None) -> Path: + output_folder = self.get_output_folder() utils.ensure_folder(output_folder) destination = path.join(output_folder, destination) if destination else output_folder - output_wasm_file = shutil.copy(source, destination) + output_wasm_file = shutil.copy(str(source), destination) return Path(output_wasm_file) - def _get_output_folder(self): + def get_output_folder(self): return path.join(self.directory, "output") def get_bytecode(self): @@ -97,9 +96,9 @@ def default_config(self): return dict() def run_tests(self, tests_directory: str, wildcard: str = ""): - arwentools = cast(StandaloneModule, dependencies.get_module_by_key("arwentools")) - tool_env = arwentools.get_env() - tool = path.join(arwentools.get_parent_directory(), "mandos-test") + vmtools = cast(StandaloneModule, dependencies.get_module_by_key("vmtools")) + tool_env = vmtools.get_env() + tool = path.join(vmtools.get_parent_directory(), "mandos-test") test_folder = path.join(self.directory, tests_directory) if not wildcard: diff --git a/erdpy/projects/project_clang.py b/erdpy/projects/project_clang.py index 01647c94..10327a66 100644 --- a/erdpy/projects/project_clang.py +++ b/erdpy/projects/project_clang.py @@ -1,9 +1,10 @@ import logging -import os import subprocess from os import path from pathlib import Path +from typing import List + from erdpy import dependencies, errors, myprocess, utils from erdpy.projects.project_base import Project @@ -135,9 +136,9 @@ def ensure_source_files(self): self.config['source_files'] = source_files - def get_exported_functions(self): + def get_exported_functions(self) -> List[str]: file_export = self.find_file_globally('*.export') - lines = utils.read_lines(file_export) + lines = utils.read_lines(str(file_export)) return lines def default_config(self): diff --git a/erdpy/projects/project_rust.py b/erdpy/projects/project_rust.py index d742207b..cfef1c27 100644 --- a/erdpy/projects/project_rust.py +++ b/erdpy/projects/project_rust.py @@ -14,25 +14,36 @@ class ProjectRust(Project): def __init__(self, directory): super().__init__(directory) - self.cargo_file = self._get_cargo_file() + self.cargo_file = self.get_cargo_file() def clean(self): super().clean() utils.remove_folder(path.join(self.directory, "wasm", "target")) - def _get_cargo_file(self): - cargo_path = path.join(self.directory, "Cargo.toml") + def get_cargo_file(self): + cargo_path = self.path / 'Cargo.toml' return CargoFile(cargo_path) + def get_meta_folder(self): + return self.path / 'meta' + def perform_build(self): + meta = self.has_meta() try: + if meta: + # The meta crate allows contract developers to add extra + # preparation steps before building. + self.run_meta() self.run_cargo() - self._generate_abi() + + # ABI generated separately for backwards compatibility + if not meta: + self.generate_abi() except subprocess.CalledProcessError as err: raise errors.BuildError(err.output) def run_cargo(self): - env = self._get_env() + env = self.get_env() args = [ "cargo", @@ -40,66 +51,82 @@ def run_cargo(self): "--target=wasm32-unknown-unknown", "--release", "--out-dir", - self._get_output_folder(), + self.get_output_folder(), "-Z" "unstable-options" ] - self._decorate_cargo_args(args) + self.decorate_cargo_args(args) if not self.options.get("wasm_symbols"): env["RUSTFLAGS"] = "-C link-arg=-s" - cwd = path.join(self.directory, "wasm") - return_code = myprocess.run_process_async(args, env=env, cwd=cwd) + cwd = self.path / 'wasm' + return_code = myprocess.run_process_async(args, env=env, cwd=str(cwd)) if return_code != 0: raise errors.BuildError(f"error code = {return_code}, see output") - def _decorate_cargo_args(self, args): + def run_meta(self): + cwd = self.get_meta_folder() + env = self.get_env() + + args = [ + "cargo", + "run", + ] + + return_code = myprocess.run_process_async(args, env=env, cwd=str(cwd)) + if return_code != 0: + raise errors.BuildError(f"error code = {return_code}, see output") + + def decorate_cargo_args(self, args): target_dir = self.options.get("cargo_target_dir") if target_dir: args.extend(["--target-dir", target_dir]) - def _generate_abi(self): - if not self._has_abi(): + def generate_abi(self): + if not self.has_abi(): return args = [ "cargo", "run" ] - self._decorate_cargo_args(args) + self.decorate_cargo_args(args) - env = self._get_env() + env = self.get_env() cwd = path.join(self.directory, "abi") - sink = myprocess.FileOutputSink(self._get_abi_filepath()) + sink = myprocess.FileOutputSink(self.get_abi_filepath()) return_code = myprocess.run_process_async(args, env=env, cwd=cwd, stdout_sink=sink) if return_code != 0: raise errors.BuildError(f"error code = {return_code}, see output") - utils.prettify_json_file(self._get_abi_filepath()) + utils.prettify_json_file(self.get_abi_filepath()) + + def has_meta(self): + return (self.get_meta_folder() / "Cargo.toml").exists() - def _has_abi(self): - return (self._get_abi_folder() / "Cargo.toml").exists() + def has_abi(self): + return (self.get_abi_folder() / "Cargo.toml").exists() - def _get_abi_filepath(self): - return self._get_abi_folder() / "abi.json" + def get_abi_filepath(self): + return self.get_abi_folder() / "abi.json" - def _get_abi_folder(self): + def get_abi_folder(self): return Path(self.directory, "abi") def _do_after_build(self) -> Path: original_name = self.cargo_file.package_name wasm_base_name = self.cargo_file.package_name.replace("-", "_") - wasm_file = Path(self._get_output_folder(), f"{wasm_base_name}_wasm.wasm").resolve() + wasm_file = Path(self.get_output_folder(), f"{wasm_base_name}_wasm.wasm").resolve() wasm_file_renamed = self.options.get("wasm_name") if not wasm_file_renamed: wasm_file_renamed = f"{original_name}.wasm" - wasm_file_renamed_path = Path(self._get_output_folder(), wasm_file_renamed) + wasm_file_renamed_path = Path(self.get_output_folder(), wasm_file_renamed) shutil.move(wasm_file, wasm_file_renamed_path) - if self._has_abi(): - abi_file = self._get_abi_filepath() - abi_file_renamed = Path(self._get_output_folder(), f"{original_name}.abi.json") + if self.has_abi(): + abi_file = self.get_abi_filepath() + abi_file_renamed = Path(self.get_output_folder(), f"{original_name}.abi.json") shutil.move(abi_file, abi_file_renamed) return wasm_file_renamed_path @@ -107,14 +134,14 @@ def _do_after_build(self) -> Path: def get_dependencies(self): return ["rust"] - def _get_env(self): + def get_env(self): return dependencies.get_module_by_key("rust").get_env() class CargoFile: data: Dict[str, Any] - def __init__(self, path): + def __init__(self, path: Path): self.data = {} self.path = path diff --git a/erdpy/scope.py b/erdpy/scope.py index 91f95342..096749ab 100644 --- a/erdpy/scope.py +++ b/erdpy/scope.py @@ -25,7 +25,7 @@ def initialize(): testnet_config = TestnetConfiguration.from_file(testnet_toml) proxy = f"http://localhost:{testnet_config.proxy_port()}" except FileNotFoundError: - logger.warn("components of the testnet may be missing") + pass def get_chain_id(): diff --git a/erdpy/testnet/config.py b/erdpy/testnet/config.py index 2242343f..07c2e0bd 100644 --- a/erdpy/testnet/config.py +++ b/erdpy/testnet/config.py @@ -296,8 +296,8 @@ def proxy_port(self): def loglevel(self) -> str: return self.features.get("loglevel", "") - def arwen_binary(self) -> bool: - return self.features.get("arwen_binary", False) + def wasm_vm_binary(self) -> bool: + return self.features.get("wasm_vm_binary", False) @classmethod def default(cls): @@ -305,7 +305,7 @@ def default(cls): config['features'] = { 'loglevel': '*:DEBUG', 'proxy': True, - 'arwen_binary': False + 'wasm_vm_binary': False } config['folders'] = { 'elrond_go': diff --git a/erdpy/testnet/setup.py b/erdpy/testnet/setup.py index 7f3d080e..d8c35fee 100644 --- a/erdpy/testnet/setup.py +++ b/erdpy/testnet/setup.py @@ -246,22 +246,17 @@ def build_binaries(testnet_config: TestnetConfiguration): node_folder = testnet_config.node_source() / "cmd" / "node" myprocess.run_process(['go', 'build'], cwd=node_folder, env=golang_env) - arwen_binary = testnet_config.arwen_binary() - logger.info(f"Arwen Binary: {arwen_binary}") - if arwen_binary: - logger.info("Building arwen...") - env = dict(golang_env) - env["ARWEN_PATH"] = str(node_folder) - node_folder_root = testnet_config.node_source() - myprocess.run_process(['make', 'arwen'], cwd=node_folder_root, env=env) + wasm_vm_binary = testnet_config.wasm_vm_binary() + if wasm_vm_binary: + logger.warn("WASM VM does not require building anymore. Skipping...") logger.info("Building proxy...") proxy_folder = testnet_config.proxy_source() / "cmd" / "proxy" myprocess.run_process(['go', 'build'], cwd=proxy_folder, env=golang_env) # Now copy the binaries to the testnet folder - arwen_version = _get_arwen_version(testnet_config) - libwasmer_path = path.join(golang.get_gopath(), f"pkg/mod/github.com/!elrond!network/arwen-wasm-vm@{arwen_version}/wasmer/libwasmer_darwin_amd64.dylib") + wasm_vm_version = _get_wasm_vm_version(testnet_config) + libwasmer_path = path.join(golang.get_gopath(), f"pkg/mod/github.com/!elrond!network/arwen-wasm-vm@{wasm_vm_version}/wasmer/libwasmer_darwin_amd64.dylib") shutil.copy(seednode_folder / "seednode", testnet_config.seednode_folder()) if workstation.get_platform() == "osx": @@ -269,11 +264,6 @@ def build_binaries(testnet_config: TestnetConfiguration): for destination in testnet_config.all_nodes_folders(): shutil.copy(node_folder / "node", destination) - if arwen_binary: - try: - shutil.copy(node_folder / "arwen", destination) - except FileNotFoundError: - logger.warn("Could not copy the arwen binary!") if workstation.get_platform() == "osx": shutil.copy(libwasmer_path, destination) @@ -283,7 +273,7 @@ def build_binaries(testnet_config: TestnetConfiguration): shutil.copy(libwasmer_path, testnet_config.proxy_folder()) -def _get_arwen_version(testnet_config: TestnetConfiguration): +def _get_wasm_vm_version(testnet_config: TestnetConfiguration): go_mod = testnet_config.node_source() / "go.mod" lines = utils.read_lines(str(go_mod)) line = next(line for line in lines if "github.com/ElrondNetwork/arwen-wasm-vm" in line) diff --git a/erdpy/tests/test_cli_deps.sh b/erdpy/tests/test_cli_deps.sh index 6dd9bbc9..7a1c024f 100644 --- a/erdpy/tests/test_cli_deps.sh +++ b/erdpy/tests/test_cli_deps.sh @@ -7,11 +7,11 @@ testAll() { ${ERDPY} --verbose deps install rust ${ERDPY} --verbose deps install clang - ${ERDPY} --verbose deps install arwentools --overwrite + ${ERDPY} --verbose deps install vmtools --overwrite ${ERDPY} --verbose deps check rust ${ERDPY} --verbose deps check clang - ${ERDPY} --verbose deps check arwentools + ${ERDPY} --verbose deps check vmtools set +x } diff --git a/erdpy/utils.py b/erdpy/utils.py index 5c86eed3..5e98521e 100644 --- a/erdpy/utils.py +++ b/erdpy/utils.py @@ -79,7 +79,7 @@ def uniquify(path: Path) -> Path: return path -def read_lines(file: str): +def read_lines(file: str) -> List[str]: with open(file) as f: lines = f.readlines() lines = [line.strip() for line in lines]