Configuration Sources
The CLI uses Viper to load configuration from multiple sources with clear precedence:Configuration File
The CLI looks for configuration files in these locations (in order):- Path specified by
--configflag $HOME/.cctp/config.yaml./config.yaml(current directory)
Creating a Config File
Configuration Options
| Option | Type | Description | Default |
|---|---|---|---|
network | string | mainnet or testnet | mainnet |
keystore_path | string | Path to Ethereum keystore directory | OS-specific |
rpc_urls | map | Custom RPC endpoints by chain name | Built-in defaults |
defaults.amount | string | Default transfer amount | (none) |
defaults.recipient | string | Default recipient address | (none) |
saved_addresses | array | Named addresses for quick access | (none) |
Chain names in
rpc_urls must match exactly (case-sensitive). Use the full chain names like Ethereum, Arbitrum, OP Mainnet, etc.Wallet Authentication
The CLI supports two methods for wallet authentication:1. Private Key (Environment Variable)
The simplest method for programmatic usage or testing:- Automated scripts
- CI/CD pipelines (with secret management)
- Development and testing
- Single-account scenarios
2. Keystore File
More secure method using encrypted keystore files with password protection:- List available accounts from the keystore directory
- Prompt you to select an account
- Ask for the password to decrypt the keystore
- Production environments
- Multiple account management
- Enhanced security with password protection
- When sharing wallets across applications (e.g., with Geth, Metamask export)
Default Keystore Locations
- macOS
- Linux
- Windows
--keystore flag is provided.Setting Up a Keystore
Add keystore files
Copy your existing keystore files to the directory, or create a new one using Geth:You can also export from MetaMask:
- Open MetaMask
- Go to Account Details
- Export Private Key
- Use a tool like MyCrypto to convert to keystore format
Keystore File Format
Keystore File Format
Keystore files are JSON files with encrypted private keys. Example structure:The file is typically named:
UTC--<timestamp>--<address>Environment Variables
Set environment variables with theCCTP_ prefix (uppercased, with underscores):
Available Variables
| Variable | Type | Description | Example |
|---|---|---|---|
CCTP_TESTNET | boolean | Use testnet | true, false |
CCTP_KEYSTORE_PATH | string | Keystore directory path | /path/to/keystore |
PRIVATE_KEY | string | Private key for wallet | 0x1234... |
Examples
Custom RPC Endpoints
Override default RPC endpoints to use your own infrastructure or preferred providers.Configuration File
Chain Names for RPC URLs
Mainnet Chain Names
Mainnet Chain Names
Use these exact names (case-sensitive):
EthereumAvalancheOP MainnetArbitrumBasePolygon PoSUnichainLineaCodexSonicWorld ChainSeiXDCHyperEVMInkPlume
Testnet Chain Names
Testnet Chain Names
Use these exact names (case-sensitive):
Ethereum SepoliaAvalanche FujiOP SepoliaArbitrum SepoliaBase SepoliaPolygon PoS AmoyUnichain SepoliaLinea SepoliaCodex TestnetSonic TestnetWorld Chain SepoliaSei TestnetXDC ApothemHyperEVM TestnetInk TestnetPlume TestnetArc Testnet
Popular RPC Providers
Alchemy
- Reliable and fast
- Free tier available
- alchemy.com
Infura
- Wide chain support
- Enterprise options
- infura.io
QuickNode
- High performance
- Global infrastructure
- quicknode.com
Ankr
- Public endpoints
- Free and premium
- ankr.com
LlamaRPC
- Community-driven
- No registration needed
- Free public RPCs
Self-hosted
- Full control
- Run Geth, Erigon, etc.
- Best for privacy
Default Values
Set default values to speed up the transfer process:- Pre-populate TUI fields (you can still edit them)
- Override with command-line flags:
--amount 500 - Useful for repetitive transfers to the same recipient
Defaults are convenient but optional. The TUI always allows you to modify these values before confirming the transfer.
Saved Addresses
Store frequently used addresses with friendly names:While saved addresses are stored in the config, the current TUI version doesn’t automatically present them yet. This feature is planned for future enhancements.
Configuration Examples
Production Setup
Production Setup
Development Setup
Development Setup
Multi-Environment
Multi-Environment
Create separate config files for each environment:config.mainnet.yaml:config.testnet.yaml:Use with:
Configuration Precedence Example
Understanding how different sources combine: 1. Config file (~/.cctp/config.yaml):
network:testnet(env var overrides config file)keystore_path:/custom/path(flag overrides env and config)
Security Best Practices
Protect Private Keys
- Never commit
PRIVATE_KEYto version control - Use environment variables or secure secret management
- Consider using keystore files for better security
Secure Config Files
- Don’t commit config files with sensitive data
- Set appropriate file permissions:
Secure Keystore Files
- Use strong passwords for keystore encryption
- Store keystore files in secure locations
- Backup keystore files securely
Use Testnet First
- Always test with testnet before mainnet
- Verify recipient addresses carefully
- Test with small amounts first
Troubleshooting
No wallet source available
No wallet source available
Error:
no wallet source available: set PRIVATE_KEY env variable or provide --keystore pathCause: Neither private key nor keystore is configured.Solution:Config file not found
Config file not found
Not an error: Config files are optional. The CLI works fine without one.To suppress the warning: Create an empty config file:
Keystore path does not exist
Keystore path does not exist
Error:
keystore path does not exist: /path/to/keystoreCause: The specified keystore directory doesn’t exist.Solution:Invalid chain name in RPC URLs
Invalid chain name in RPC URLs
Error: Custom RPC not being used.Cause: Chain name doesn’t match exactly (case-sensitive).Solution: Use exact chain names:
Environment variable not working
Environment variable not working
Cause: Missing
CCTP_ prefix or not exported.Solution:RPC rate limiting
RPC rate limiting
Symptoms: Slow transfers or RPC errors.Cause: Hitting free tier rate limits.Solution:
- Upgrade to paid RPC plan
- Use multiple RPC providers
- Self-host a node
Next Steps
Commands
Learn all available CLI commands and flags
Quick Start
Complete your first cross-chain transfer
SDK Integration
Integrate CCTP into your application
Chain Reference
View all supported chains and capabilities