Skip to content

Instantly share code, notes, and snippets.

@nicolasochem
Last active March 29, 2018 05:52
Show Gist options
  • Save nicolasochem/230d9228fb012b5cc92c55a25ee66f13 to your computer and use it in GitHub Desktop.
Save nicolasochem/230d9228fb012b5cc92c55a25ee66f13 to your computer and use it in GitHub Desktop.
lightning mainnet experiment
  1. setup a bitcoind container following the guide on https://medium.com/@dougvk/run-your-own-mainnet-lightning-node-2d2eab628a8b Also setup bitcoin-cli. sync the chain

  2. clone https://github.com/lightningnetwork/lnd, cd to the folder

  3. do docker-compose run -d --name alice lnd_btc. It will create a lnd container and a btcd container. docker rm them (instead, it would be possible to just create the lnd container and not start it)

  4. go to /scratch, edit the bitcoind configuration following instructions on that other guide: https://gist.github.com/itoonx/618ab3cba41252ccadcbf9ec54ecb71c

(guide to run lnd and bitcoind together, but not in docker)

  1. restart bitcoind to take the new config into account (do not do docker stop because the default timeout is 10 seconds before force kill! you may corrupt your db. Do docker stop --timeout 300)

  2. start lnd the first time with

docker run  --name lnd_mainnet --network container:bitcoind_mainnet  -d \
-v /scratch/bitcoin/mainnet/lnd/:/root/.lnd \
--entrypoint /go/bin/lnd lnd:latest  --bitcoin.active --bitcoin.mainnet \
--externalip=138.68.52.74 --debuglevel=debug \
--bitcoin.node=bitcoind --bitcoind.rpcuser=bitcoin --bitcoind.rpcpass=<redacted> \
--bitcoind.zmqpath=tcp://127.0.0.1:28332

Observation: unlinke clightning, lnd does not require access to bitcoind file storage backend. Instead, it's using a combination of rpc and zeromq pubsub for all its operations.

To be continued...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment