Interledger.js Ledger Plugin for the Lightning Network
This plugin enables Interledger payments through the Bitcoin and Litecoin Lightning Networks.
See the ILP Lightning Demo or the example script to watch this plugin in action.
npm install --save ilp-plugin-lightning
This plugin can be used with the ilp
client module or the ilp-connector
.
See the Ledger Plugin Interface for documentation on available methods.
- Connect to the lightning testnet:
export GOPATH=~/gocode
export PATH=$PATH:$GOPATH/bin
lnd --bitcoin.active --bitcoin.testnet --debuglevel=debug --bitcoin.node=neutrino --neutrino.connect=faucet.lightning.community --datadir=./data --no-macaroons
Check your settings in ~/Library/Application\ Support/Lnd/lnd.conf, you can also set options like --bitcoin.testnet
there instead of on the command line.
- Use lncli to create a wallet, see http://dev.lightning.community/tutorial/01-lncli/ for inspiration on how to do this
lncli --no-macaroons create
lncli --no-macaroons getinfo
lncli --no-macaroons newaddress np2wkh
lncli --no-macaroons walletbalance witness-only=true
-
Run
DEBUG=* node test.js
-
You will see a line saying
Now go to https://interfaucet.ilpdemo.org/?...
- open that URL in your browser. You should see a picture of gummy bears coming out of a faucet (not a picture of a sad faucet).
This plugin can be used by two Interledger nodes (sender to connector, connector to connector, and connector to receiver) to send payments through an instance of the Lightning Network. It uses the Bilateral Transfer Protocol, implemented by the payment channel framework, to send Interledger payment and quote details that cannot currently be communicated through lnd
itself. Because of the need for an additional messaging layer, this plugin implementation only works bilaterally at present.