|
| 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