A collection of Rust crates for interacting with the Bittensor blockchain network.
This monorepo contains the following crates:
| Crate | Description | Crates.io |
|---|---|---|
bittensor-rs |
Core SDK for Bittensor chain interactions | |
bittensor-wallet |
Wallet management with Python bindings | - |
lightning-tensor |
Terminal UI for Bittensor | - |
Add to your Cargo.toml:
[dependencies]
bittensor-rs = "0.1"use bittensor::{config::BittensorConfig, Service};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Connect to Finney mainnet
let config = BittensorConfig::finney("my_wallet", "my_hotkey", 1);
let service = Service::new(config).await?;
// Query metagraph
let metagraph = service.get_metagraph(1).await?;
println!("Found {} neurons", metagraph.hotkeys.len());
Ok(())
}- Rust 1.70 or later
- Protocol Buffers compiler (
protoc)
# Build all crates
cargo build --workspace
# Build with all features
cargo build --workspace --all-features
# Run tests
cargo test --workspace
# Run specific crate tests
cargo test -p bittensor-rsThis project includes a justfile for common tasks:
# Install just: https://github.com/casey/just
cargo install just
# See available commands
just --list- bittensor-rs API docs - Full API documentation on docs.rs
- bittensor-wallet README - Wallet crate documentation
Contributions are welcome! Please follow these guidelines:
-
Conventional Commits: Use conventional commit format:
feat: add new featurefix: resolve bugdocs: update documentationchore: maintenance task
-
Pull Requests: All changes should go through PR review
-
Testing: Add tests for new functionality
This repository uses release-please for automated releases:
- Merge PRs with conventional commits to
main - Release-please automatically creates/updates a release PR with changelog
- Merge the release PR to trigger a GitHub release
- The publish workflow automatically publishes to crates.io
MIT License - see LICENSE for details.