Home

Awesome

Btcli4j

GitHub Workflow Status Esplora support Pruning mode

It is a c-lightning plugin to override Bitcoin backend plugin with esplora powered by Blockstream.

But this plugin is designed make the process to run c-lightning with bitcoind in pruning mode, the idea of this plugin was described inside this issue by lightningd.

It is designed with mediator patter and each command inside the mediator can use esplora or bitcoind or a both in some cases.

So, the plugin will support the complete backend with esplora (only) and the complete backend only with bitcoind or a join of the two option!

Network supported

Status

The plugin is in Beta stage, this mean that is waiting for the User Review and testing, good tested on bitcoin testnet but not on mainet, because I have put inside only small amount of found that available at the moment, if you want support the project consider to look in the section Support

If you want test it all feedback are welcome! Feel free to open an issue or a PR or in addition, you can send email to vincenzopalazzodev@gmail.com

Install

Java produces a jar and c-lightning needs a bash script to run it! The gradle script compiles the plugin and generate a bash script with the command ./gradlew createRunnableScript

After the gradle process, you have the jar inside the build/libs/btcli4j-all.jar and the script btcli4j-gen.sh in the root directory of the project.

Now you can put the gradle script inside the c-lightning plugin directory

How bash script look like

The contains only the command to run the jar with java, in my cases the script contains the following result>

#!/bin/bash
/usr/lib/jvm/jdk-13.0.2/bin/java -jar /home/vincent/Github/btcli4j/build/libs/btcli4j-all.jar

In this case, you can move this bash script inside your ./lightning/plugins the directory or you can add the plugin to the file conf with plugin=/PATH/bash/file or use the command line --plugin=/path/bash/file.

Plugin parameter

P.S: some of Bitcoin propriety are the same of the C-lightning propriety, these mean that yuo need to redefine only a bitcoin-rpcurl propriety, and put at the startup of the lightning node the flag btcli4j-pruned

Esplora API config

A complete example to run with Esplora API is reported below

lightningd --disable-plugin bcli

The command above, run the lightningd with the lightnind configuration, this mean that you don't need to add some additional configuration to the command line.

However, you can use the command line to customize the plugin behaviors.

Bitcoin Pruning mode config

lightningd --disable-plugin bcli --btcli4j-pruned

With the following clightning config

...
bitcoin-rpcuser=user
bitcoin-rpcpassword=pass
bitcoin-rpcurl=http://127.0.0.1:18332
....

Code Style

ktlint

We live in a world where robots can drive a car, so we shouldn't just write code, we should write elegant code.

This repository use ktlint to maintains the code of the repository elegant, so before submit the code check the Kotlin format with the following command on the root of the directory

./gradlew formatKotlin

Built with

Support

If you like the library and want to support it, please considerer to donate with the following system

License

<div align="center"> <img src="https://opensource.org/files/osi_keyhole_300X300_90ppi_0.png" width="150" height="150"/> </div>

It is a c-lightning plugin to override Bitcoin backend plugin with esplora.

Copyright (C) 2020-2021 Vincenzo Palazzo vincenzopalazzodev@gmail.com

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.