Giter Club home page Giter Club logo

lightning_ndk's Introduction

lightning_ndk

Android cross-compilation of c-lightning & bitcoin & tor for Android >= 24 Api.

This project is based on bitcoin_ndk used in ABCore.

GitHub Workflow Status

Get binaries

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.

Build from sources

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 to the device

Push all the binaries inside the archive to the android device, using /data/local/tmp/ as binary folder.

adb push * /data/local/tmp/

Run on the device

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 

Local testing

Run cli command in an adb shell, as the following

./cli/lightning-cli --lightning-dir=/sdcard/tmp/ newaddr

Dependencies

References

  • INSTALL.md of clightning to cross-compile c-lightning for Android
  • bitcoin_ndk: ndk build of bitcoin core, knots and liquid
  • abcore: ABCore - Android Bitcoin Core

Acknowledgement

Thanks domegabri to test this project on Android devices, and dieeasy from inbitcoin to test channels and pay invoices with globular.

lightning_ndk's People

Contributors

darosior avatar fanquake avatar greenaddress avatar lvaccaro avatar vincenzopalazzo avatar

Stargazers

 avatar

Watchers

 avatar  avatar

lightning_ndk's Issues

Release v0.10

Looks like it was already included so building and releasing is the "only" thing left :p

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.