Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/interledger-deprecated/ilp-lightning-demo
Demo sending payments between Bitcoin and Litecoin Lightning Networks using Interledger
https://github.com/interledger-deprecated/ilp-lightning-demo
Last synced: 10 days ago
JSON representation
Demo sending payments between Bitcoin and Litecoin Lightning Networks using Interledger
- Host: GitHub
- URL: https://github.com/interledger-deprecated/ilp-lightning-demo
- Owner: interledger-deprecated
- Created: 2017-07-31T11:06:28.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-02T09:33:53.000Z (over 7 years ago)
- Last Synced: 2024-08-06T01:18:52.379Z (3 months ago)
- Language: JavaScript
- Size: 25.4 KB
- Stars: 17
- Watchers: 2
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-lightning-network - ilp-lightning-demo - Demo sending payments between Bitcoin and Litecoin Lightning Networks using Interledger (Developer Resources / Example Projects)
README
# BTC -> LTC Lightning Demo
> Send payments between Lightning Networks using InterledgerThis demo sends payments between instances of the [Lightning Network](https://lightning.network) on Bitcoin and Litecoin using an [Interledger Connector](https://github.com/interledgerjs/ilp-connector) and the [Lightning Ledger Plugin](https://github.com/interledgerjs/ilp-plugin-lightning).
## Prerequisites
- Node.js >= v7.10.0
- Docker (only to run local Lightning nodes)## Running the Demo
### 0. Set Up Lightning Networks
_You can skip this step if you already have 2 lightning nodes setup on the Bitcoin Lightning Network and 2 on the Litecoin Lightning Network._
The following uses BitFury's [`simple-simnet`](https://github.com/BitfuryLightning/simple-simnet) to run local testnets and Lightning daemons for both Bitcoin and Litecoin.
In one terminal run:
```sh
git clone https://github.com/BitfuryLightning/simple-simnet
cd simple-simnet
./bitcoin/build.sh
./bitcoin/start.sh
```In another terminal run:
```sh
cd simple-simnet
./litecoin/build.sh
./litecoin/start.sh
```### 1. Run an Interledger Connector
This will run a connector and automatically configure it to connect to the `lnd` nodes started in the previous step.
In a new terminal run:
```sh
git clone https://github.com/interledgerjs/ilp-lightning-demo
cd ilp-lightning-demo
npm install
node run-connector.js
```To configure the connector to use different `lnd` nodes, set the environment variables `BITCOIN_LND_1`, `BITCOIN_LND_2`, `LITECOIN_LND_1`, `LITECOIN_LND_2` to those `lnd` nodes' RPC endpoints.
### 2. Send a Payment
From another terminal run the following to send a payment from one of the Bitcoin `lnd` nodes to a Litecoin `lnd` node.
```sh
node send.js
```(Run with the environment variable `DEBUG=ilp*` to see additional details of what is happening.)
## How it Works
Interledger is a protocol for connecting payment networks or _ledgers_.
_Connectors_ use [ledger plugins](https://interledger.org/rfcs/0004-ledger-plugin-interface/) to connect to different types of ledgers. This demo uses [`ilp-plugin-lightning`](https://github.com/interledgerjs/ilp-plugin-lightning) to send payments through instances of the Lightning Network.
The [Interledger packet](https://interledger.org/rfcs/0003-interledger-protocol/) is attached to transfers across individual ledgers and instructs connectors where to forward payments. [Hashed-Timelock _Agreements_ (HTLAs)](https://github.com/interledger/rfcs/blob/master/0022-hashed-timelock-agreements/0022-hashed-timelock-agreements.md), a generalization of HTLCs, are used to secure Interledger payments.
For more information on Interledger, see [interledger.org](https://interledger.org) or the [Interledger RFCs](https://github.com/interledger/rfcs) for the protocol specs.