Skip to content

Commit

Permalink
Impl Blockchain for nakamoto
Browse files Browse the repository at this point in the history
This commit adds the nakamoto CBF libraries and implements bdk's
blockchain trait on it.
  • Loading branch information
rajarshimaitra committed Sep 13, 2022
1 parent 7b12f35 commit 222a2b4
Show file tree
Hide file tree
Showing 4 changed files with 647 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ bitcoin = { version = "0.28.1", features = ["use-serde", "base64", "rand"] }
serde = { version = "^1.0", features = ["derive"] }
serde_json = { version = "^1.0" }
rand = "^0.7"
thiserror = "1.0"

# Optional dependencies
sled = { version = "0.34", optional = true }
Expand All @@ -41,6 +42,12 @@ bitcoinconsensus = { version = "0.19.0-3", optional = true }
# Needed by bdk_blockchain_tests macro and the `rpc` feature
bitcoincore-rpc = { version = "0.15", optional = true }

# Nakamoto crates for the CBF blockchain
nakamoto-client = { git = "https://github.com/cloudhead/nakamoto.git", rev = "b17f93cdb3fa824cd1601809ab5ddefa32f2757b", optional = true }
nakamoto-net-poll = { git = "https://github.com/cloudhead/nakamoto.git", rev = "b17f93cdb3fa824cd1601809ab5ddefa32f2757b", optional = true }
nakamoto-p2p = { git = "https://github.com/cloudhead/nakamoto.git", rev = "b17f93cdb3fa824cd1601809ab5ddefa32f2757b", optional = true }
nakamoto-common = { git = "https://github.com/cloudhead/nakamoto.git", rev = "b17f93cdb3fa824cd1601809ab5ddefa32f2757b", optional = true }

# Platform-specific dependencies
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { version = "1", features = ["rt"] }
Expand All @@ -57,7 +64,8 @@ verify = ["bitcoinconsensus"]
default = ["key-value-db", "electrum"]
sqlite = ["rusqlite", "ahash"]
sqlite-bundled = ["sqlite", "rusqlite/bundled"]
compact_filters = ["rocksdb", "socks", "lazy_static", "cc"]
nakamoto = ["nakamoto-client", "nakamoto-net-poll", "nakamoto-p2p", "nakamoto-common"]
compact_filters = ["rocksdb", "socks", "lazy_static", "cc", "nakamoto"]
key-value-db = ["sled"]
all-keys = ["keys-bip39"]
keys-bip39 = ["bip39"]
Expand Down Expand Up @@ -92,6 +100,7 @@ reqwest-default-tls = ["reqwest/default-tls"]
test-blockchains = ["bitcoincore-rpc", "electrum-client"]
test-electrum = ["electrum", "electrsd/electrs_0_8_10", "electrsd/bitcoind_22_0", "test-blockchains"]
test-rpc = ["rpc", "electrsd/electrs_0_8_10", "electrsd/bitcoind_22_0", "test-blockchains"]
test-cbf = ["compact_filters", "electrsd/electrs_0_8_10", "electrsd/bitcoind_22_0", "test-blockchains"]
test-rpc-legacy = ["rpc", "electrsd/electrs_0_8_10", "electrsd/bitcoind_0_20_0", "test-blockchains"]
test-esplora = ["electrsd/legacy", "electrsd/esplora_a33e97e1", "electrsd/bitcoind_22_0", "test-blockchains"]
test-md-docs = ["electrum"]
Expand Down
2 changes: 2 additions & 0 deletions src/blockchain/compact_filters/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ mod peer;
mod store;
mod sync;

pub mod nakamoto;

use crate::blockchain::*;
use crate::database::{BatchDatabase, BatchOperations, DatabaseUtils};
use crate::error::Error;
Expand Down
Loading

0 comments on commit 222a2b4

Please sign in to comment.