Skip to content

Latest commit

 

History

History
296 lines (219 loc) · 6.72 KB

README.md

File metadata and controls

296 lines (219 loc) · 6.72 KB

CLI

How to install

Running the following command will install the CLI as the binary rex.

make cli

How to run

After installing the CLI with make cli, run rex to display the help message.

> rex

Usage: rex <COMMAND>

Commands:
  l2            L2 specific commands.
  autocomplete  Generate shell completion scripts.
  block-number  Get the current block_number. [aliases: bl]
  transaction   Get the transaction's info. [aliases: tx, t]
  receipt       Get the transaction's receipt. [aliases: r]
  balance       Get the account's balance info. [aliases: bal, b]
  nonce         Get the account's nonce. [aliases: n]
  address       Get either the account's address from private key, the zero address, or a random address [aliases: addr, a]
  hash          Get either the keccak for a given input, the zero hash, the empty string, or a random hash [aliases: h]
  signer
  transfer      Transfer funds to another wallet.
  send          Send a transaction
  call          Make a call to a contract
  deploy        Deploy a contract
  chain-id      Get the network's chain id.
  help          Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

Commands

rex address

Get either the account's address from private key, the zero address, or a random address

Usage: rex address [OPTIONS]

Options:
      --from-private-key <FROM_PRIVATE_KEY>
          The private key to derive the address from. [env: PRIVATE_KEY=]
  -z, --zero
          The zero address.
  -r, --random
          A random address.
  -h, --help
          Print help

rex hash

Get either the keccak for a given input, the zero hash, the empty string, or a random hash

Usage: rex hash [OPTIONS]

Options:
      --input <INPUT>  The input to hash.
  -z, --zero           The zero hash.
  -r, --random         A random hash.
  -s, --string         Hash of empty string
  -h, --help           Print help

rex receipt

Get the transaction's receipt.

Usage: rex receipt <TX_HASH> [RPC_URL]

Arguments:
  <TX_HASH>
  [RPC_URL]  [env: RPC_URL=] [default: http://localhost:8545]

Options:
  -h, --help  Print help

rex transaction

Get the transaction's info.

Usage: rex transaction <TX_HASH> [RPC_URL]

Arguments:
  <TX_HASH>
  [RPC_URL]  [env: RPC_URL=] [default: http://localhost:8545]

Options:
  -h, --help  Print help

rex balance

Get the account's balance info.

Usage: rex balance [OPTIONS] <ACCOUNT> [RPC_URL]

Arguments:
  <ACCOUNT>
  [RPC_URL]  [env: RPC_URL=] [default: http://localhost:8545]

Options:
      --token <TOKEN_ADDRESS>  Specify the token address, the ETH is used as default.
      --eth                    Display the balance in ETH.
  -h, --help                   Print help

rex nonce

Get the account's nonce.

Usage: rex nonce <ACCOUNT> [RPC_URL]

Arguments:
  <ACCOUNT>
  [RPC_URL]  [env: RPC_URL=] [default: http://localhost:8545]

Options:
  -h, --help  Print help

rex block-number

Get the current block_number.

Usage: rex block-number [RPC_URL]

Arguments:
  [RPC_URL]  [env: RPC_URL=] [default: http://localhost:8545]

Options:
  -h, --help  Print help

rex signer

Usage: rex signer <MESSAGE> <SIGNATURE>

Arguments:
  <MESSAGE>
  <SIGNATURE>

Options:
  -h, --help  Print help

rex chain-id

Get the network's chain id.

Usage: rex chain-id [OPTIONS] [RPC_URL]

Arguments:
  [RPC_URL]  [env: RPC_URL=] [default: http://localhost:8545]

Options:
  -h, --hex   Display the chain id as a hex-string.
  -h, --help  Print help

rex transfer

Transfer funds to another wallet.

Usage: rex transfer [OPTIONS] <AMOUNT> <TO> <PRIVATE_KEY> [RPC_URL]

Arguments:
  <AMOUNT>
  <TO>
  <PRIVATE_KEY>  [env: PRIVATE_KEY=]
  [RPC_URL]      [env: RPC_URL=] [default: http://localhost:8545]

Options:
      --token <TOKEN_ADDRESS>
      --nonce <NONCE>
  -b                           Do not wait for the transaction receipt
      --explorer-url           Display transaction URL in the explorer.
  -h, --help                   Print help

rex send

Send a transaction

Usage: rex send [OPTIONS] <TO> [VALUE] <PRIVATE_KEY> [RPC_URL]

Arguments:
  <TO>
  [VALUE]        Value to send in wei [default: 0]
  <PRIVATE_KEY>  [env: PRIVATE_KEY=]
  [RPC_URL]      [env: RPC_URL=] [default: http://localhost:8545]

Options:
      --calldata <CALLDATA>                            [default: ]
      --chain-id <CHAIN_ID>
      --nonce <NONCE>
      --gas-limit <GAS_LIMIT>
      --gas-price <MAX_FEE_PER_GAS>
      --priority-gas-price <MAX_PRIORITY_FEE_PER_GAS>
  -b                                                   Do not wait for the transaction receipt
      --explorer-url                                   Display transaction URL in the explorer.
  -h, --help                                           Print help

rex call

Make a call to a contract

Usage: rex call [OPTIONS] <TO> [CALLDATA] [VALUE] [RPC_URL]

Arguments:
  <TO>
  [CALLDATA]  [default: ]
  [VALUE]     Value to send in wei [default: 0]
  [RPC_URL]   [env: RPC_URL=] [default: http://localhost:8545]

Options:
      --from <FROM>
      --gas-limit <GAS_LIMIT>
      --max-fee-per-gas <MAX_FEE_PER_GAS>
      --explorer-url                       Display transaction URL in the explorer.
  -h, --help                               Print help

rex deploy

Deploy a contract

Usage: rex deploy [OPTIONS] <BYTECODE> [VALUE] <PRIVATE_KEY> [RPC_URL]

Arguments:
  <BYTECODE>
  [VALUE]        Value to send in wei [default: 0]
  <PRIVATE_KEY>  [env: PRIVATE_KEY=]
  [RPC_URL]      [env: RPC_URL=] [default: http://localhost:8545]

Options:
      --chain-id <CHAIN_ID>
      --nonce <NONCE>
      --gas-limit <GAS_LIMIT>
      --gas-price <MAX_FEE_PER_GAS>
      --priority-gas-price <MAX_PRIORITY_FEE_PER_GAS>
  -b                                                   Do not wait for the transaction receipt
      --explorer-url                                   Display transaction URL in the explorer.
  -h, --help                                           Print help

Examples

A curated list of examples as GIFs.

TODO