Skip to content

2140-dev/bitcoin-capnp-types

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bitcoin Cap'n Proto Rust Client

This project auto-generates the client code to interact with Bitcoin Core in Rust using interprocess communication.

Build prerequisites

Building this crate requires the capnp compiler.

macOS:

brew install capnp

Debian / Ubuntu:

sudo apt-get install capnproto libcapnp-dev

If /capnp/c++.capnp cannot be found during cargo build, install the platform's Cap'n Proto development package in addition to the compiler.

Minimum Standard Rust Version

To compile this crate your project must use a Rust compiler of 1.85 or higher.

Building

cargo build

Running integration tests

The integration tests connect to a running bitcoin node via IPC.

1. Build Bitcoin Core

cd /path/to/bitcoin
cmake -B build -DENABLE_WALLET=ON -DBUILD_TESTS=OFF
cmake --build build -j$(nproc)

2. Start bitcoin

./build/bin/bitcoin node -chain=regtest -ipcbind=unix -server -debug=ipc -daemon

3. Run tests

If bitcoin is not in your PATH, set BITCOIN_BIN to the full path of the Bitcoin Core binary.

The test harness bootstraps regtest chain state and ensures the test wallet is available before running integration tests.

BITCOIN_BIN=./build/bin/bitcoin \
cargo test

4. Stop bitcoin

./build/bin/bitcoin rpc -chain=regtest stop

License

Creative Commons 1.0 Universal

About

Auto-generated Rust package built by Cap'n Proto schemas

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors