ConsoleChain is a powerful command-line interface (CLI) tool for seamless interaction with smart contracts on various blockchain networks. Built with TypeScript for enhanced type safety and developer experience.
- 1000+ Chains - Access any EVM chain via chainlist.org integration
- RPC Fallback System - Automatically uses backup RPCs if primary fails
- Smart Chain Selection - Simple UI showing only chain slugs
- Custom RPC Support - Use any RPC endpoint you prefer
- Secure Private Key Storage - Optional encryption for your keys
- Interactive REPL - Autocomplete, command history, and help system
- Type Safety - Built with TypeScript
- Standard Support - Built-in ABIs for ERC-20, ERC-721, and ERC-1155
Install ConsoleChain globally using npm:
npm install -g consolechainJust provide the contract address - CLI will prompt you to select the chain:
consolechain 0xYourContractAddress --standard 20
# You'll be prompted:
# π Select a blockchain network
# ? Search (name, symbol, or chain ID): ethereum
# ? Select chain: ethereumconsolechain 0xYourContractAddress --chain ethereum --standard 721
consolechain 0xYourContractAddress --chain polygon --standard 20
consolechain 0xYourContractAddress --chain base --abi ./abi.jsonUse any RPC endpoint directly:
consolechain 0xYourContractAddress --rpc https://eth.llamarpc.com --standard 20# Show popular chains
consolechain list-chains
# Search for specific chains
consolechain list-chains polygon
consolechain list-chains arbitrum
consolechain list-chains 8453 # Search by chain IDTo execute transactions that modify state, set your private key:
consolechain set-pk your-private-key-hereπ Security Best Practice: Set the CONSOLECHAIN_ENCRYPTION_KEY environment variable to encrypt your private key:
export CONSOLECHAIN_ENCRYPTION_KEY=$(openssl rand -hex 32)
consolechain set-pk your-private-keyOnce connected, you have access to several features:
- Press
TABto autocomplete function names - Press
TABtwice to see all available functions
Ξ balanceOf -h
balanceOf(owner: address)
Ξ balanceOf 0x1234567890123456789012345678901234567890
1000000000000000000
help- Show available commandsexit- Exit the consoleclear- Clear the screen
# Start interactive mode
consolechain 0xYourAddress --interactive --standard 721
# You'll be prompted to:
# 1. Search for a chain (e.g., "base", "polygon", "arbitrum")
# 2. Select from matching results
# 3. Automatically connects with best RPC# Ethereum Mainnet
consolechain 0xAddress --chain ethereum --standard 20
# Polygon
consolechain 0xAddress --chain polygon --standard 721
# Base
consolechain 0xAddress --chain base --standard 1155
# Arbitrum
consolechain 0xAddress --chain arbitrum --abi ./MyContract.json
# Any chain by ID
consolechain 0xAddress --chain 8453 --standard 20 # Base# Use a specific RPC provider
consolechain 0xAddress --rpc https://eth.llamarpc.com --standard 20
# Use your own node
consolechain 0xAddress --rpc http://localhost:8545 --abi ./abi.json
# Use a premium RPC service
consolechain 0xAddress --rpc https://mainnet.infura.io/v3/YOUR_KEY --standard 721# Using chain name
consolechain 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 --chain ethereum --standard 20
# Inside console
Ξ name
USD Coin
Ξ symbol
USDC
Ξ decimals
6
Ξ totalSupply
24835236580839861# Interactive mode
consolechain 0xYourNFTAddress --interactive --standard 721
# Search for "base" β Select "Base" β Auto-connects
Ξ name
Ξ ownerOf 1consolechain 0xCustomContract --chain arbitrum --abi ./MyContract.json
Ξ myCustomFunction arg1 arg2# Arrays
Ξ batchTransfer '["0xAddr1","0xAddr2"]' '[100,200]'
# Strings with spaces
Ξ setName 'My Token Name'
# Numbers
Ξ setValue 123456
# Booleans
Ξ setFlag true| Command | Aliases | Description |
|---|---|---|
consolechain <address> |
- | Interactive console for smart contract interaction |
list-chains [search] |
ls, chains |
List and search available blockchain networks |
set-pk <key> |
- | Set your private key for signing transactions |
--help |
-h |
Show help information |
--version |
-v |
Show version number |
| Option | Alias | Description |
|---|---|---|
--chain <name> |
-c |
Specify chain by name or ID |
--rpc <url> |
-r |
Use custom RPC URL |
--interactive |
-i |
Interactive chain selection |
--standard <type> |
-s |
Use standard ABI (20, 721, 1155) |
--abi <path> |
- | Path to custom ABI file |
git clone https://github.com/vieiraricardo/consolechain.git
cd consolechain
npm install
npm run build
npm linknpm testnpm run devContributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- GitHub Repository
- npm Package
- Report Issues
- Chainlist.org - Chain data source
- Always use the encryption feature for private key storage
- Use testnets for development and testing
- Verify contract addresses and chain IDs before executing transactions
- When using custom RPCs, ensure they are from trusted sources
