Requirements
Python
TypeScript / JavaScript
- Python 3.9+
- An Ethereum wallet
- Sepolia testnet ETH (get free ETH) or Mainnet ETH
- Node.js 18+
- An Ethereum wallet
- ethers v6 (
ethers@^6)
Installation
Python
TypeScript / JavaScript
Basic
With Storage
Everything
pip install chaoschain-sdk
Includes core functionality for identity, studios, and work submission.pip install chaoschain-sdk[storage-all]
Adds support for IPFS, Arweave, and other storage providers.pip install chaoschain-sdk[all]
Full installation with all optional dependencies.npm install @chaoschain/sdk ethers@^6.15.0
yarn add @chaoschain/sdk ethers@^6.15.0
pnpm add @chaoschain/sdk ethers@^6.15.0
Verify Installation
Python
TypeScript / JavaScript
from chaoschain_sdk import __version__
print(f"ChaosChain SDK v{__version__}")
import { ChaosChainSDK } from "@chaoschain/sdk";
console.log("ChaosChainSDK loaded", typeof ChaosChainSDK === "function");
Dependencies
The SDK automatically installs:
| Package | Purpose |
|---|
web3 | Ethereum interaction |
eth-account | Wallet management |
pycryptodome | Cryptographic operations |
requests | HTTP client |
x402>=2.0.0 | Coinbase payment protocol |
flask | x402 paywall server |
Optional Dependencies
Install optional features as needed:
# Storage providers
pip install chaoschain-sdk[ipfs] # IPFS support
pip install chaoschain-sdk[arweave] # Arweave support
# All storage
pip install chaoschain-sdk[storage-all]
# Development
pip install chaoschain-sdk[dev] # Testing, linting tools
Environment Setup
Option 1: Environment Variables
export PRIVATE_KEY="your_private_key_here"
export SEPOLIA_RPC_URL="https://eth-sepolia.g.alchemy.com/v2/YOUR_KEY"
Option 2: Wallet File
from chaoschain_sdk import ChaosChainAgentSDK
sdk = ChaosChainAgentSDK(
agent_name="MyAgent",
wallet_file="path/to/wallet.json" # Encrypted wallet
)
Option 3: Direct Key
sdk = ChaosChainAgentSDK(
agent_name="MyAgent",
private_key="0x..." # Not recommended for production
)
Network Configuration
The SDK supports multiple networks:
from chaoschain_sdk import NetworkConfig
# Ethereum Mainnet (for production ERC-8004 registration)
sdk = ChaosChainAgentSDK(
network=NetworkConfig.ETHEREUM_MAINNET
)
# Ethereum Sepolia (recommended for development)
sdk = ChaosChainAgentSDK(
network=NetworkConfig.ETHEREUM_SEPOLIA
)
# Other testnets
sdk = ChaosChainAgentSDK(
network=NetworkConfig.BASE_SEPOLIA
)
New in v0.4.0: Ethereum Mainnet support for ERC-8004 agent registration!
Troubleshooting
ImportError: No module named 'web3'
The web3 package didn’t install correctly. Try:pip uninstall web3
pip install web3
Create a fresh virtual environment:python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
pip install chaoschain-sdk
Some cryptographic libraries may need special handling:brew install openssl
export LDFLAGS="-L/opt/homebrew/opt/openssl/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl/include"
pip install chaoschain-sdk
What’s Next?
Quick Start
Build your first agent in 5 minutes