Crates.io | chaincraft-rust |
lib.rs | chaincraft-rust |
version | 0.1.3 |
created_at | 2025-06-10 23:29:20.611839+00 |
updated_at | 2025-06-10 23:52:59.542348+00 |
description | A high-performance Rust-based platform for blockchain education and prototyping |
homepage | https://github.com/jio-gl/chaincraft-rust |
repository | https://github.com/jio-gl/chaincraft-rust |
max_upload_size | |
id | 1707851 |
size | 438,325 |
A high-performance Rust-based platform for blockchain education and prototyping. Chaincraft Rust provides a clean, well-documented implementation of core blockchain concepts with a focus on performance, security, and educational value.
cargo install chaincraft-rust
git clone https://github.com/jio-gl/chaincraft-rust.git
cd chaincraft-rust
cargo build --release
Start a Chaincraft node with default settings:
chaincraft-cli start
Or with custom configuration:
chaincraft-cli start --port 8080 --max-peers 20 --debug
chaincraft-cli keygen
Add Chaincraft Rust to your Cargo.toml
:
[dependencies]
chaincraft-rust = "0.1.0"
use chaincraft_rust::{ChaincraftNode, Result};
#[tokio::main]
async fn main() -> Result<()> {
let mut node = ChaincraftNode::builder()
.port(21000)
.max_peers(10)
.build()?;
println!("Starting node {} on port {}", node.id(), node.port());
node.start().await?;
// Your application logic here
node.stop().await?;
Ok(())
}
use chaincraft_rust::{ChaincraftNode, Result};
use chaincraft_rust::crypto::KeyType;
#[tokio::main]
async fn main() -> Result<()> {
let mut node = ChaincraftNode::builder()
.port(21000)
.max_peers(50)
.enable_compression()
.enable_persistent_storage()
.key_type(KeyType::Ed25519)
.build()?;
node.start().await?;
// Node is now running with persistent storage and compression enabled
Ok(())
}
Chaincraft Rust is built with a modular architecture:
compression
: Enable message compression for network efficiencypersistent
: Enable persistent storage using sledindexing
: Enable SQLite-based transaction indexingvdf-crypto
: Enable VDF (Verifiable Delay Function) supportEnable features in your Cargo.toml
:
[dependencies]
chaincraft-rust = { version = "0.1.0", features = ["persistent", "indexing"] }
git clone https://github.com/chaincraft-org/chaincraft-rust.git
cd chaincraft-rust
cargo build
# Run all tests
cargo test
# Run tests with all features enabled
cargo test --all-features
# Run integration tests
cargo test --test integration
cargo bench
cargo install cargo-tarpaulin
cargo tarpaulin --out Html
Full API documentation is available on docs.rs.
To build documentation locally:
cargo doc --open --all-features
Check out the examples/
directory for more usage examples:
basic_node.rs
: Simple node setup and operationcustom_consensus.rs
: Implementing custom consensus mechanismsnetwork_simulation.rs
: Multi-node network simulationRun examples with:
cargo run --example basic_node
We welcome contributions! Please see our Contributing Guide for details.
git checkout -b feature/amazing-feature
)cargo test --all-features
)cargo clippy --all-features
)cargo fmt
)git commit -am 'Add amazing feature'
)git push origin feature/amazing-feature
)Chaincraft Rust is designed for high performance:
Security is a top priority:
This project is licensed under the MIT License - see the LICENSE file for details.
For more information, visit our documentation or repository.