Getting Started

I had my own Ubuntu 16.04 server which had enough storage to sync up with the bitcoin blockchain. You will need bitcoind and lightningd also. Here are the steps:

Install bitcoind:

$ sudo apt-get install software-properties-common

$ sudo add-apt-repository ppa:bitcoin/bitcoin

$ sudo apt-get update

$ sudo apt-get install -y bitcoind

$ bitcoind --daemon --datadir=<optional/path/to/bitcoind>

You can specify an optional data directory where the blockchain data will be downloaded. In my setup, I used my external mounted storage as my data directory due to the space requirements (169 GB and increasing by ~1 MB every 10 mins).

2. Allow the node to fully sync with the blockchain. Monitor the progress:

$ bitcoin-cli --datadir=<optional/path/to/bitcoin> getinfo {

"deprecation-warning": "WARNING: getinfo is deprecated and will be fully removed in 0.16. Projects should transition to using getblockchaininfo, getnetworkinfo, and getwalletinfo before upgrading to 0.16",

"version": 150100,

"protocolversion": 70015,

"walletversion": 139900,

"balance": 0.00000000,

"blocks": 507134,

"timeoffset": -1,

"connections": 42,

"proxy": "",

"difficulty": 2603077300218.593,

"testnet": false,

"keypoololdest": 1516978369,

"keypoolsize": 2000,

"paytxfee": 0.00000000,

"relayfee": 0.00001000,

"errors": ""

}

Look out for the number of blocks. You will need to be synced up to the current block height. You can check the current height here.

3. Install lightningd:

$ git clone https://github.com/ElementsProject/lightning.git

$ cd lightning

$ make

$ screen -S lightningd

$ lightningd --alias=<your_alias> --rgb=<your_hex_color_value> --network=bitcoin --lightning-dir=<optional/path/to/lightningd> --bitcoin-datadir <optional/path/to/bitcoind> --log-level=debug [CTRL A, then D] to detach the screen session. You can reattach with: screen -r lightningd

You can specify an optional data directory for lightning also. You will also need to specify your bitcoind data directory.

Initial Setup of your Lightning Node

4. Get a lightning deposit address so that you send funds to it (I put in 0.003BTC). Think of this address as your hot wallet:

You can check your balance/funds:

$ lightning-cli --lightning-dir=<optional/path/to/lightning> listfunds

{ "outputs" :

[

{ "txid" : "a7f2741a0950019c020caad26f0c3600d2f20e8f85344bf23b0153c7973489a6", "output" : 0, "value" : 49117 },

{ "txid" : "42da2d234675e08ea21ab64ec63638529bdef29d560cf53d54b78771376a0654", "output" : 0, "value" : 221965 }

]

}

Setup your Lightning Payment Channels

5. Connect to another lightning node to create a payment channel (I connected to SLEEPYARK which looks very well connected):

$ lightning-cli --lightning-dir=<optional/path/to/lightning> connect 02f6725f9c1c40333b67faea92fd211c183050f28df32cac3f9d69685fe9665432 104.198.32.198 9735

Check out the present deployment of the lightning network. At this time, we are up to 417 nodes on mainnet!