The Vernachain CLI tool provides a command-line interface for interacting with the blockchain network, managing wallets, and performing various operations.
The CLI tool is included with Vernachain. After installing the main package:
pip install -r requirements.txt
Common options available for all commands:
--verbose Enable verbose output
--json Output in JSON format
--config FILE Specify custom config file
--help Show help message
python -m src.cli start-bootstrap [OPTIONS]
--host TEXT Host address (default: localhost)
--port INTEGER Port number (default: 5000)
--max-peers INTEGER Maximum number of peers (default: 50)
python -m src.cli start [OPTIONS]
--host TEXT Host address (default: localhost)
--port INTEGER Port number (default: 5001)
--bootstrap-host TEXT Bootstrap node host
--bootstrap-port INTEGER Bootstrap node port
--validator BOOLEAN Run as validator
python -m src.cli status
python -m src.cli recover # Recover from crash
python -m src.cli resync # Force resync
python -m src.cli clear-peers # Clear peer database
python -m src.wallet.cli create [OPTIONS]
-l, --label TEXT Wallet label
-p, --password Set wallet password
python -m src.wallet.cli list
python -m src.wallet.cli balance [OPTIONS]
--address TEXT Specific address (optional)
python -m src.wallet.cli import --file PATH
python -m src.wallet.cli export --file PATH
python -m src.wallet.cli send [OPTIONS]
--to TEXT Recipient address
--amount FLOAT Amount to send
--fee FLOAT Transaction fee (optional)
--data TEXT Additional data (optional)
python -m src.cli tx [OPTIONS]
--hash TEXT Transaction hash
python -m src.cli tx list [OPTIONS]
--address TEXT Address to filter by
--limit INT Number of transactions
--pending Show pending transactions
python -m src.wallet.cli stake [OPTIONS]
--amount FLOAT Amount to stake
python -m src.wallet.cli unstake [OPTIONS]
--amount FLOAT Amount to unstake
python -m src.cli validator status [OPTIONS]
--address TEXT Validator address
python -m src.cli validator list [OPTIONS]
--active Show only active validators
python -m src.cli deploy-contract [OPTIONS]
--file PATH Contract file path
--args TEXT Constructor arguments
--gas FLOAT Gas limit
python -m src.cli call-contract [OPTIONS]
--address TEXT Contract address
--function TEXT Function name
--args TEXT Function arguments
--gas FLOAT Gas limit
python -m src.cli contract [OPTIONS]
--address TEXT Contract address
--abi Show contract ABI
python -m src.cli start --validator --bootstrap-host localhost --bootstrap-port 5000
python -m src.wallet.cli stake --amount 1000
python -m src.wallet.cli send --to 0x123... --amount 10.5
python -m src.cli deploy-contract –file token.py –args “MyToken,MTK,1000000”
python -m src.cli call-contract –address 0x456… –function transfer –args “0x789…,100” ```
Common error codes and their meanings:
E001
: Invalid address formatE002
: Insufficient balanceE003
: Transaction failedE004
: Network errorE005
: Invalid contractFor detailed error descriptions, use the --verbose
flag.
The CLI can be configured using:
~/.vernachain/config.yaml
)Priority: Arguments > Environment > Config File
For more detailed information about specific commands, use the --help
flag with any command.