Skip to content

Commit aae0859

Browse files
committed
Add subcrate which impls a simple SPV client from Bitcoin Core RPC
This adds a new subcrate `lightning-http-blocks` which is designed to make it easier to get up-and-running by removing the effort of building an SPV client and fetching the chain. Instead of building a P2P client (and all the address management that entails), this focuses on building a trivial SPV client which can fetch from several instances of an abstract BlockSource. Then, we provide two example BlockSource implementations that can fetch from Bitcoin Core's RPC interface and Bitcoin Core's REST interface. The code here is taken with heavy modifications from rust-lightning-bitcoinrpc.
1 parent 01d4617 commit aae0859

File tree

5 files changed

+765
-0
lines changed

5 files changed

+765
-0
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
members = [
44
"lightning",
55
"lightning-net-tokio",
6+
"lightning-http-blocks",
67
]
78

89
# Our tests do actual crypo and lots of work, the tradeoff for -O1 is well worth it

lightning-http-blocks/Cargo.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[package]
2+
name = "lightning-http-blocks"
3+
version = "0.0.1"
4+
authors = ["Matt Corallo"]
5+
license = "Apache-2.0"
6+
edition = "2018"
7+
description = """
8+
Utilities to fetch the chain from Bitcoin Core REST/RPC Interfaces and feed them into Rust Lightning.
9+
"""
10+
11+
[dependencies]
12+
bitcoin = "0.23"
13+
lightning = { version = "0.0.11", path = "../lightning" }
14+
tokio = { version = ">=0.2.12", features = [ "io-util", "macros", "rt-core", "sync", "tcp", "time" ] }
15+
hyper = "0.13"
16+
serde = "1"
17+
serde_json = "1"
18+
serde_derive = "1"
19+
futures-util = "0.3"
20+
base64 = "0.9"

0 commit comments

Comments
 (0)