Skip to main content

Interact with blockchains and smart contracts using the command line

Project description

Interact with blockchains and smart contracts using the command line.

Build on web3client, the Swiss-army knife of the blockchain.

Install

pip3 install -U web3cli

Examples

  • Get the ETH balance of the Ethereum foundation:

    web3 balance 0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae
    
  • Get the BNB balance of the Binance hot wallet on BNB chain:

    web3 -n binance balance 0x8894e0a0c962cb723c1976a4421c95949be2d4e3
    
  • List all supported networks (blockchains):

    web3 network list
    

Settings

Settings are read from the configuration file ~/.web3cli/config/web3cli.yaml, or from environment variables. (The symbol ~ refers to the home folder of your user.) See the example configuration file for a list of available settings.

Environment variables

All settings can be overridden via environment variables. For example, the settings web3cli.default_network can be overridden by setting the env variable WEB3CLI_DEFAULT_NETWORK:

WEB3CLI_DEFAULT_NETWORK=avalanche web3 network get

output> avalanche

Folder-specific settings

To have settings that apply only to the current folder, create a web3cli.yaml file in that folder. Settings specified in web3cli.yaml will override those in your home folder. Environment variables will still get the precedence.

Contribute ❤️

Pull requests are welcome!

  1. Install and configure PDM:
    curl -sSL https://raw.githubusercontent.com/pdm-project/pdm/main/install-pdm.py | python3 -
    
  2. Install dependencies:
    pdm install
    
  3. To run the CLI against your changes:
    pdm web3client
    
  4. To run tests:
    pdm test
    

TODO

  • Test web3 balance
  • Autocomplete
  • Allow to add networks
  • Command structure
  • Interactive vs non-interactive mode

Project details


Release history Release notifications | RSS feed

This version

0.1.7

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

web3cli-0.1.7.tar.gz (7.9 kB view hashes)

Uploaded Source

Built Distribution

web3cli-0.1.7-py3-none-any.whl (9.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page