Skip to content

Commit db7da80

Browse files
committed
Initial commit
0 parents  commit db7da80

File tree

8 files changed

+1031
-0
lines changed

8 files changed

+1031
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/target
2+
/Cargo.lock
3+
/tests/__pycache__

Cargo.toml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[package]
2+
name = "rust-bcli"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[features]
7+
default = []
8+
nogetchaininfo = []
9+
noestimatefees = []
10+
nogetrawblockbyheight = []
11+
nogetutxout = []
12+
nosendrawtransaction = []
13+
14+
15+
[dependencies]
16+
anyhow = "1.0"
17+
log = "0.4"
18+
cln-plugin = "0.1.0"
19+
tokio = { version = "1", features = ["rt-multi-thread"] }
20+
bitcoin = { version = "0.28.1", features = [ "use-serde" ] }
21+
bitcoin_hashes = { version = "0.10.0", features = [ "serde" ] }
22+
bitcoincore-rpc = "0.15.0"
23+
serde = "1.0.130"
24+
serde_json = "1.0"
25+
home = "0.5.3"
26+
jsonrpc = "0.12.0"
27+
cfg-if = "1.0.0"
28+
29+
[dev-dependencies]
30+
tokio-test = "0.4.2"

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Rust BCLI
2+
3+
A CoreLightning bitcoin backend plugin written in rust to replace the built-in
4+
bcli.
5+
6+
This plugin implements all five required bitcoin backend methods:
7+
- `getchaininfo`
8+
- `estimatefees`
9+
- `getrawblockbyheight`
10+
- `getutxout`
11+
- `sendrawtransaction`
12+
13+
However, unlike bcli they can be compiled out optionally so only a subset will
14+
be implemented. This allows other plugins which only need to implement one of
15+
the five required methods to be used in conjunction with this plugin.
16+
17+
For instance, using plugin to perform a different sendrawtransaction
18+
implementation to send over tor. Or substitute estimatefees to use mempool.space
19+
for fee estimation.
20+
21+
## Installation
22+
23+
The following commands build the plugin binary:
24+
25+
```
26+
git clone https://github.com/andrewtoth/rust-bcli
27+
cd rust-bcli
28+
cargo install --path .
29+
```
30+
31+
The binary will now be at `$HOME/.cargo/bin/rust-bcli`. You can now place this
32+
binary into the plugins folder, add it to the conf file with
33+
`plugin=$HOME/.cargo/bin/rust-bcli` (replace `$HOME` with your home directory),
34+
or add it as a command line option via
35+
`lightningd --plugin=$HOME/.cargo/bin/rust-bcli --disable-plugin=bcli`. You must
36+
also disable bcli with the `--disable-plugin=bcli` command line option or put
37+
`disable-plugin=bcli` in the conf file.
38+
39+
To remove a specific backend method, install with features specifying which
40+
methods to disable. For example, the following command will remove estimatefees
41+
from the binary installing:
42+
```
43+
cargo install --path . --features noestimatefees
44+
```
45+
In order to use this binary now, another plugin that only implements
46+
`estimatefees` must be used.
47+

0 commit comments

Comments
 (0)