Skip to content

Instantly share code, notes, and snippets.

@Melvillian
Last active August 18, 2018 04:14
Show Gist options
  • Save Melvillian/aeb97233ac9a58b2fe5e4cc8747285bc to your computer and use it in GitHub Desktop.
Save Melvillian/aeb97233ac9a58b2fe5e4cc8747285bc to your computer and use it in GitHub Desktop.
Bash commands for getting lnd (The Lightning Network) *testnet* setup on a Linux machine
#### Steps for downloading btcd: ####
# Run this script on a machine with at least 2 Gb of RAM and 200 GB of disk space
wget https://redirector.gvt1.com/edgedl/go/go1.9.2.linux-amd64.tar.gz
sudo tar -C /usr/local/ -xzf go1.9.2.linux-amd64.tar.gz
cd
mkdir go
export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/go
export PATH=$PATH:$(go env GOPATH)/bin
# add `export PATH=$PATH:/usr/local/go/bin` to .bash_profile
# add `export GOPATH=$HOME/go` to .bash_profile
# add `export PATH=$PATH:$(go env GOPATH)/bin` to .bash_profile
go get -u -v github.com/Masterminds/glide
go get -v -u github.com/roasbeef/btcutil
cd $GOPATH/src/github.com/roasbeef/btcd
glide install
go install . ./cmd/...
# NOTE! If you want to run this securely, don't use 'kek'.
# This will start a full sync of the testnet blockchain as a background task
btcd --testnet --txindex --rpcuser=kek --rpcpass=kek > /dev/null 2>&1 &
# see available commands with:
# $> btcctl --testnet --rpcuser=kek --rpcpass=kek help
# Steps for installing lnd
cd $GOPATH
git clone https://github.com/lightningnetwork/lnd $GOPATH/src/github.com/lightningnetwork/lnd
cd $GOPATH/src/github.com/lightningnetwork/lnd
make && make install
# then run as a background task:
nohup lnd --bitcoin.active --bitcoin.testnet --bitcoin.rpcuser=kek --bitcoin.rpcpass=kek > /dev/null 2>&1 &
# sleep for 10 seconds while lnd sets itself up, so you can successfully run the following call
echo "sleeping 10 seconds, waiting for lnd to start up..."
sleep 10
lncli create # this will create your lnd local account after you've entered your desired wallet password.
# see available commands with:
# $> lncli -h
# You'll have to wait several hours for the btcd and lnd node to sync, and then you're ready to open some channels!
# See http://dev.lightning.community/tutorial/index.html for next steps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment