Chain Management
Master multi-chain operations including switching networks, working with built-in chains, and understanding cross-chain considerations.
Understanding Blockchain Networks
What are Blockchain Networks?
Blockchain networks (or "chains") are independent blockchain systems that:
Process Transactions - Each chain validates and records transactions
Store State - Account balances, contract data, NFTs
Use Native Currency - ETH, POL, BNB, etc. for gas fees
Run Smart Contracts - DApps and protocols specific to each chain
EVM Compatibility
WalletAgent supports EVM-compatible chains that:
Use Ethereum Virtual Machine
Support Ethereum-style addresses (0x...)
Allow Solidity smart contracts
Use similar transaction formats
Supported Chains
Built-in Chains
WalletAgent includes these chains by default:
Anvil
31337
ETH
Local development
Ethereum
1
ETH
Mainnet (view-only)
Sepolia
11155111
ETH
Ethereum testnet
Polygon
137
POL
Polygon PoS mainnet
Chain Details
Get Current Chain Information
Example Output:
Switching Chains
Switch by Name
Change to any supported chain:
Example Output:
Switch by Chain ID
Use numeric chain identifiers:
Switch Back to Default
Return to Anvil for testing:
Example Output:
Current Chain Information
Get Chain Status
Check your current network and available options:
Example Output:
The tool shows:
Your currently connected chain
Native currency symbol
RPC endpoint being used
All available chains you can switch to
Built-in Chain Support
Supported Networks
WalletAgent includes built-in support for major EVM networks:
Anvil (Chain ID: 31337) - Local development network with unlimited test funds
Ethereum (Chain ID: 1) - Ethereum mainnet (view-only for safety)
Sepolia (Chain ID: 11155111) - Ethereum testnet
Polygon (Chain ID: 137) - Polygon PoS mainnet
These networks are pre-configured and ready to use without additional setup.
Network Information
Get Network Details
The chain info tool provides all essential network information in one command.
Example usage:
Shows current chain, currency, RPC endpoint, and all available chains for easy switching.
Multi-Chain Operations
Balance Checking Across Chains
Check balances on different networks:
This shows how the same wallet address can have different balances on each chain.
Token Management Across Chains
Understand how tokens work on different chains:
Important: USDC on Ethereum β USDC on Polygon
Different contract addresses
Require bridging to move between chains
May have different names (USDC vs USDC.e)
Cross-Chain Considerations
Cross-Chain Limitations:
Cannot send tokens directly between chains
Each chain has separate native currencies
Gas fees paid in chain's native token
Smart contracts exist independently per chain
Chain-Specific Features
Gas Management by Chain
Each chain has different gas characteristics:
Ethereum
ETH
High ($5-50+)
12 sec blocks
Polygon
POL
Very Low ($0.01)
2 sec blocks
Anvil
ETH
Free
Instant
Sepolia
ETH
Free (testnet)
12 sec blocks
Network-Specific Operations
Ethereum Features:
ENS domain resolution
Highest security and decentralization
Most DeFi protocols
Polygon Features:
Extremely low fees
Fast transactions
Gaming and NFT focus
Anvil Features:
Instant transactions
Unlimited test funds
Perfect for development
Error Handling
Common Chain Errors
Chain Not Supported
RPC Connection Failed
Insufficient Gas for Chain
Chain Switching Issues
Wallet Not Connected
Unsupported Chain
Best Practices
Chain Selection Strategy
Development: Start with Anvil
Testing: Use appropriate testnets
Production: Use mainnet only when ready
Multi-Chain Portfolio Management
Track Balances: Regularly check all chains
Gas Planning: Keep native tokens for fees
Bridge Strategy: Plan token movement between chains
Security: Verify chain configuration before transactions
Network Safety
Test First: Always test on Anvil or testnet before mainnet
Verify Network: Confirm you're on the intended network
Start Small: Try small operations before large transactions
Monitor Status: Check network health before important operations
Advanced Features
Network Performance
Built-in networks are configured with reliable RPC endpoints:
Anvil: Local network with instant transactions
Built-in Networks: Pre-configured with reliable public endpoints
Load Balancing: Automatic failover to backup endpoints when needed
Optimized: Performance-tuned for common operations
Chain Monitoring
Check network health and statistics:
Example Output:
Troubleshooting
Connection Issues
Network Timeout: Try alternative network
Chain Not Responding: Use backup network
Network Problems
Network Unavailable: Switch to working network
Connection Issues: Use local development
Next Steps
Now that you understand chain management, explore advanced topics:
π Security β - Multi-chain security practices π Developer Guide β - Building multi-chain applications π Advanced Topics β - Custom chain development
Practice Exercises
Chain Switching
Switch between all supported chains
Compare balances and gas costs
Practice network information retrieval
Development Workflow
Start development on Anvil
Test on Sepolia testnet
Compare mainnet networks
Multi-Chain Strategy
Plan token distribution across chains
Compare transaction costs
Understand bridge requirements
You now have comprehensive knowledge of multi-chain operations! βοΈ
Last updated
