This project has been migrated to ethos
This repository is now archived.
Ethos is the successor to bitcoin-rpc-codegen, extending its semantic compression framework to all Bitcoin ecosystem protocols.
Generate bitcoin-rpc-midas, a Bitcoin Core client that supercharges Bitcoin testing and development.
Compared to hand-written RPC clients, midas offers:
- Reduced repetition
- Fewer versioning issues
- Increased compile-time checks
- Improved isolation from environment glitches
Together, these features translate Bitcoin Core into idiomatic Rust.
Deep Dive: semantic-convergence.md
See docs/architecture.mmd for a full system diagram.
The project is organized into several focused crates:
- types: Type definitions for Bitcoin Core's JSON-RPC interface
- conversions: For converting Bitcoin RPC types to Rust types
- codegen: Emits idiomatic Rust modules and clients
- pipeline: Coordinates end-to-end code generation
- transport: RPC transport and error handling
- node: Multi-node management and test client support
- config: Configuration utilities
All components are modular and reusable.
This asynchronous example uses Tokio and enables some
optional features, so your Cargo.toml could look like this:
[dependencies]
bitcoin-rpc-midas = "30.0.0"
tokio = { version = "1.0", features = ["full"] }And then the code:
use bitcoin_rpc_midas::*;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = BitcoinTestClient::new_with_network(Network::Regtest).await?;
let blockchain_info = client.getblockchaininfo().await?;
println!("Blockchain info:\n{blockchain_info:#?}");
Ok(())
}MIT OR Apache-2.0
Ethos: The successor to this project, a meta-compiler for The Bitcoin Protocol.
This library communicates directly with bitcoind. For mainnet use, restrict RPC access to trusted hosts and avoid exposing RPC endpoints to untrusted networks.