LND Node Installation

Hi guys, i wrote a manual for those who are willing to try lightning network in testnet. I wrote it about a month ago, so maybe few things have changed since then. Feel free to comment below and correct any mistakes. I wrote this manual while i was installing my node and since is up and running, i think its a good guide for new users, like me.

========================================================================
== HOW TO INSTALL ==
== LIGHTNING NETWORK ==
== NODE ==

Chapter 1. Install bitcoin daemon

sudo apt-get install git nano curl

sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils python3

sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8+±dev

sudo apt-get install libzmq3-dev

git clone https://github.com/bitcoin/bitcoin

cd bitcoin

./contrib/install_db4.sh pwd

git checkout v0.15.1

./autogen.sh

export BDB_PREFIX=’/home/akihabara/bitcoin/db4’

./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" --without-gui --with-incompatible-bdb

make

sudo make install

=========================================================================================================================================================

Chapter 2. Install GO

sudo apt-get install curl nano git

  1. DOWNLOAD GO
    curl -O https://storage.googleapis.com/golang/go1.10.linux-amd64.tar.gz

Verify hash taken from: https://golang.org/dl/

sha256sum go1.*.tar.gz

Should look like this :
a4da5f4c07dfda8194c4621611aeb7ceaab98af0b38bfb29e1be2ebb04c3556c
a4da5f4c07dfda8194c4621611aeb7ceaab98af0b38bfb29e1be2ebb04c3556c go1.*.linux-amd64.tar.gz

  1. INSTALL GO

In this case I’m installing Go into /usr/local/, creating a Go tree in /usr/local/go.

sudo tar -C /usr/local -xzf go1.9.3.linux-amd64.tar.gz

  1. CREATE A WORK DIRECTORY FOR YOUR GO PROJECTS
    mkdir $HOME/gocode

  2. SET GOPATH

Add /usr/local/go/bin to the PATH environment variable. You can do this by adding this line to your /etc/profile (for a system-wide installation) or $HOME/.profile:

sudo nano /etc/profile

Add these lines at the end of the file:

export GOPATH=$HOME/gocode
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin

Activate Go:

source /etc/profile

Test to see if Go does work:

~$ go version
go version go1.9.3 linux/amd64

Create a directory to test a small Go program:

mkdir -p gocode/src/my_projects/hello
cd $GOPATH/src/my_projects/hello
nano hello.go

Put this small program on the screen and save, then exit:

package main

import “fmt”

func main() {
fmt.Printf(“hello, world\n”)
}

run:

go install
hello

If you see it prints this line then it means Go has been installed properly:

hello, world

To update Go (in the future), sudo rm -rf /usr/local/go
and then download the new Go and install as above (no need to update the variables)

=========================================================================================================================================================

Chapter 3. Install LND

  1. DOWNLOAD GLIDE

Copy and paste the following line on the screen, press ENTER and wait until it’s done

go get -u -v github.com/Masterminds/glide

  1. INSTALL LND

Copy and paste each of the following lines onto the screen, press ENTER wait till it’s done before copy and paste the next line.

git clone https://github.com/lightningnetwork/lnd $GOPATH/src/github.com/lightningnetwork/lnd

cd $GOPATH/src/github.com/lightningnetwork/lnd

glide install

go install . ./cmd/…

=========================================================================================================================================================

Chapter 4. .bitcoin folder

sudo nano bitcoin.conf

testnet=1
txindex=1
server=1
daemon=1
zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28332
rpcport=18332

Chapter 5. .lnd folder

sudo nano lnd.config

bitcoin.active=1
bitcoin.testnet=1
bitcoin.node=bitcoind
debuglevel=debug
externalip=ip.of.your.machine
alias=Any_ID
color="#ff0000"

Chapter 6. Up and running

Type bitcoind to start the bitcoin daemon synchronizing the testnet chain

When it is synchronized type lnd to start your lightning network node.

Check the node status :

  1. bitcoin-cli getnetworkinfo
  2. lncli getinfo

I am akihabara and this is my node :
https://explorer.acinq.co/#/n/02d13fd0be2a7e3d883b91687fa8244c81cb7001e139cec84fe2b305894d8321a0