Android cross-compilation of c-lightning & bitcoin & tor for Android >= 24 Api.
This project is based on bitcoin_ndk used in ABCore.
Download the artifacts from the latest github tagged release.
The package archive .tar.xz
contains: ligthningd
(and ligthning deamons), ligthning plugins, esplora plugin, ligthning-cli
, bitcoind
, bitcoin-cli
and tor.
To build c-lightning with bitcoin follow the instructions:
bash build_deps.sh #download & install android ndk toolchain
export TARGET_HOST=aarch64-linux-android
export BITS=64
./buildenv.sh # set the toolchain variables based on your system
./buildlibs.sh # download & build dependency libraries
./buildlightning.sh # download & build clightning
./buildbitcoin.sh # download & build bitcoin core
./buildtor.sh # download & build bitcoin core
./archive.sh #prepare a compressed archive with the binaries
Push all the binaries inside the archive to the android device, using /data/local/tmp/
as binary folder.
adb push * /data/local/tmp/
Run lightningd
and connect to a bitcoin
node, using /sdcard/tmp/
as datadir.
adb shell
cd /data/local/tmp
chmod -R +x *
./lightningd/lightningd --lightning-dir=/sdcard/tmp/ --testnet --disable-plugin esplora
--bitcoin-rpcconnect=$BITCOIN_HOST --bitcoin-rpcuser=$BITCOIN_USER
--bitcoin-rpcpassword=$BITCOIN_PWD --bitcoin-rpcport=$BITCOIN_PORT
--bitcoin-cli=/data/local/tmp/bitcoin-cli --bitcoin-datadir=/sdcard/tmp/
--plugin-dir=/data/local/tmp/plugins --log-level=debug
If you want to use the esplora plugin as bitcoin backend
./lightningd/lightningd --lightning-dir=/sdcard/tmp/ --testnet --disable-plugin bcli
--esplora-api-endpoint=https://blockstream.info/testnet/api --log-level=debug
Run cli command in an adb shell, as the following
./cli/lightning-cli --lightning-dir=/sdcard/tmp/ newaddr
Thanks domegabri to test this project on Android devices, and dieeasy from inbitcoin to test channels and pay invoices with globular.