What is Chain Forge?
Chain Forge is a Foundry-inspired multi-chain development tool suite designed to simplify local blockchain development and testing. It provides a unified interface for working with different blockchain networks, starting with Solana support.
The Problem
Blockchain developers often face these challenges:
- Inconsistent tooling across different blockchain ecosystems
- Complex setup for local development environments
- Manual account management and funding
- Different CLIs and APIs for each chain
- Difficulty integrating into automated testing pipelines
The Solution
Chain Forge provides:
- Unified Interface: One CLI and API for multiple blockchain networks
- Instant Setup: Start a local validator with pre-funded accounts in seconds
- Developer Experience: Simple commands inspired by Ethereum's Foundry
- Standard Wallets: BIP39/BIP44 account generation compatible with popular wallets
- Programmatic Access: TypeScript SDK for seamless integration
Core Features
Multi-Chain Support
Built with a trait-based architecture that makes adding new blockchain networks straightforward. Currently supports:
- ✅ Solana - Full support with CLI and TypeScript package
- 🔜 Bitcoin - Planned
- 🔜 Ethereum - Planned
Account Management
- Generate accounts using standard BIP39 mnemonics
- BIP44 derivation paths for wallet compatibility
- Pre-fund accounts automatically on startup
- Fund additional accounts via CLI or API
CLI Tools
Each supported chain gets its own CLI tool:
# Solana
cf-solana start --accounts 10 --balance 100
cf-solana accounts
cf-solana fund <address> 50TypeScript Packages
Programmatic access via NPM packages:
import { SolanaClient } from '@chain-forge/solana';
const client = new SolanaClient({ accounts: 10 });
await client.start();
const accounts = await client.getAccounts();Configuration System
Flexible TOML-based configuration with:
- Project-level configuration
- Global user defaults
- Multiple profiles (default, ci, devnet, etc.)
Architecture
Chain Forge uses a ChainProvider trait as the core abstraction:
pub trait ChainProvider {
async fn start(&mut self) -> Result<()>;
async fn stop(&mut self) -> Result<()>;
async fn get_accounts(&self) -> Result<Vec<Account>>;
async fn set_balance(&self, address: &str, amount: f64) -> Result<()>;
// ... more methods
}Each blockchain implementation:
- Implements the
ChainProvidertrait - Lives in
chains/<chain-name>/ - Provides a CLI binary (
cf-<chain>) - Exposes a TypeScript package (
@chain-forge/<chain>)
Use Cases
Smart Contract Development
Test your programs locally before deploying to testnet or mainnet:
cf-solana start --accounts 5 --balance 100
# Deploy and test your Solana program
anchor deploy
anchor testdApp Development
Build frontends against a local blockchain with controlled state:
const client = new SolanaClient();
await client.start();
// Connect your dApp to localhost:8899
const connection = client.getConnection();Automated Testing
Integrate into CI/CD pipelines for reproducible test environments:
- name: Start validator
run: cf-solana start --accounts 3 --balance 10 &
- name: Run integration tests
run: npm testLearning & Experimentation
Experiment with blockchain development without spending real tokens:
# Try different scenarios
cf-solana start --accounts 20 --balance 1000
# Make mistakes, restart fresh anytimeWhy "Chain Forge"?
Inspired by Ethereum's Foundry, Chain Forge aims to bring the same level of developer experience and tooling quality to multi-chain development.
The name reflects the project's goal: to be a forge for building blockchain applications across any chain.
Design Principles
- Developer First: Optimize for developer productivity and happiness
- Simple Defaults: Works out of the box with sensible defaults
- Flexible Configuration: Easy to customize when needed
- Standards Compliant: Use standard protocols (BIP39/44) for compatibility
- Wraps Official Tools: Leverage official blockchain tooling rather than reimplementing