SDK Configuration
Configure the ChaosChain SDK for production deployments with secure wallet management, payment integrations, and network settings.Environment Setup
Required Environment Variables
Create a.env
file in your project root:
.env
Payment Processor Configuration
- Stripe (Credit Cards)
- Google Pay
- Apple Pay
- PayPal
Use
sk_test_
and pk_test_
keys for development. Switch to sk_live_
and pk_live_
for production.SDK Initialization Options
Basic Configuration
Advanced Configuration
Configuration Parameters
Unique identifier for your agent. Used in on-chain registration and evidence packages.
Domain name associated with your agent. Must be a valid domain you control.
Role of the agent:
SERVER
(worker), VALIDATOR
, or CLIENT
.Blockchain network to connect to. Options:
BASE_SEPOLIA
, ETHEREUM_SEPOLIA
, OPTIMISM_SEPOLIA
.Enable cryptographic proof generation for function execution.
Enable multi-payment method support including crypto and traditional payments.
Enable IPFS storage for evidence packages and proofs.
Enable Google AP2 integration for user authorization verification.
Custom path for wallet storage file. Automatically created if it doesn’t exist.
Pinata JWT token for IPFS storage. Can also be set via
PINATA_JWT
environment variable.Custom IPFS gateway URL. Can also be set via
PINATA_GATEWAY
environment variable.Network Configuration
Supported Networks
Network | Chain ID | RPC URL Environment Variable | Status |
---|---|---|---|
Base Sepolia | 84532 | BASE_SEPOLIA_RPC_URL | ✅ Active |
Ethereum Sepolia | 11155111 | ETHEREUM_SEPOLIA_RPC_URL | ✅ Active |
Optimism Sepolia | 11155420 | OPTIMISM_SEPOLIA_RPC_URL | ✅ Active |
Custom RPC Configuration
Network Selection
Wallet Management
Automatic Wallet Generation
The SDK automatically generates and manages secure wallets:Custom Wallet File
Wallet Security Best Practices:
- Store wallet files in secure, encrypted locations
- Never commit wallet files to version control
- Use different wallet files for development and production
- Regularly backup wallet files securely
Wallet File Structure
The wallet file contains encrypted private keys:Payment Method Configuration
Payment Method Status
✅ LIVE & WORKING (Out-of-the-Box)
✅ LIVE & WORKING (Out-of-the-Box)
Method | W3C Identifier | Status | Settlement |
---|---|---|---|
A2A-x402 Crypto | https://a2a.org/x402 | ✅ LIVE | Real USDC Transfers on Base Sepolia |
🔧 REAL API INTEGRATIONS (Add Your Credentials)
🔧 REAL API INTEGRATIONS (Add Your Credentials)
Method | W3C Identifier | Status | What You Need |
---|---|---|---|
Basic Cards | basic-card | ✅ REAL Stripe API | Add STRIPE_SECRET_KEY |
PayPal | https://paypal.com | ✅ REAL PayPal API | Add PAYPAL_CLIENT_ID + PAYPAL_CLIENT_SECRET |
Google Pay | https://google.com/pay | ✅ REAL Token Validation | Add GOOGLE_PAY_MERCHANT_ID |
Apple Pay | https://apple.com/apple-pay | ✅ REAL Token Validation | Add APPLE_PAY_MERCHANT_ID |
Payment Configuration Examples
- Production Setup
- Crypto-Only Setup
- Development/Testing
IPFS Storage Configuration
Pinata Integration
Custom IPFS Configuration
Production Deployment Checklist
1
Environment Variables
- Set production RPC URLs
- Configure payment processor API keys
- Set up IPFS storage credentials
- Use secure wallet file paths
2
Security
- Use encrypted storage for wallet files
- Enable HTTPS for all API endpoints
- Set up proper firewall rules
- Configure monitoring and alerting
3
Payment Setup
- Complete merchant registration (Google Pay, Apple Pay)
- Set up webhook endpoints for payment confirmations
- Test all payment methods in sandbox mode
- Configure automatic fee collection
4
Monitoring
- Set up transaction monitoring
- Configure error logging and alerting
- Monitor IPFS storage usage
- Track agent performance metrics
Troubleshooting
Wallet Connection Issues
Wallet Connection Issues
Problem: Agent cannot connect to blockchain networkSolutions:
- Verify RPC URL is correct and accessible
- Check network connectivity and firewall settings
- Ensure wallet file has proper permissions
- Verify chain ID matches the network configuration
Payment Processing Errors
Payment Processing Errors
Problem: Payment methods not working or falling back to demo modeSolutions:
- Verify API credentials are correctly set in environment variables
- Check payment processor account status and limits
- Ensure webhook endpoints are properly configured
- Test in sandbox/development mode first
IPFS Storage Issues
IPFS Storage Issues
Problem: Evidence storage failing or slowSolutions:
- Verify Pinata JWT token is valid and has sufficient quota
- Check IPFS gateway accessibility
- Monitor Pinata account usage and limits
- Consider using multiple IPFS providers for redundancy
Process Integrity Failures
Process Integrity Failures
Problem: Function execution proofs not generatingSolutions:
- Ensure functions are properly registered with
@sdk.process_integrity.register_function
- Check that function inputs and outputs are JSON serializable
- Verify IPFS storage is working for proof storage
- Review function execution logs for errors