Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save openoms/8fb5bb336a0ec7ab91ef5ee7207b9e6b to your computer and use it in GitHub Desktop.
Save openoms/8fb5bb336a0ec7ab91ef5ee7207b9e6b to your computer and use it in GitHub Desktop.
## Getting LND working with Dojo
## Start Dojo
$ cd /path/to/docker/my-dojo/ && sudo ./dojo.sh start
## Login to the bitcoind docker container as root
$ sudo docker exec -u root -it bitcoind /bin/bash
## Update and install a text editor
$ apt-get update && apt-get install nano
## Modify bitcoin.conf
$ nano /home/bitcoin/.bitcoin/bitcoin.conf
## Add to bitcoin.conf
zmqpubrawblock=tcp://0.0.0.0:28332
## Save and exit
ctrl+x --> y --> return
## Log out of the container
$ exit
## Stop Dojo
$ cd /path/to/docker/my-dojo/ && sudo ./dojo.sh stop
## Modify the docker-compose.yaml file to open docker ports for interaction with bitcoind
$ nano docker-compose.yaml
## Under the section for `bitcoind` add:
ports:
- "127.0.0.1:28256:28256"
- "127.0.0.1:28332:28332"
- "127.0.0.1:28333:9501"
## Save and exit
ctrl+x --> y --> return
#### Your bitcoind section should now look something like the following ####
bitcoind:
image: "samouraiwallet/dojo-bitcoind:1.0.0"
container_name: bitcoind
build:
context: ./bitcoin
env_file:
- ./.env
- ./conf/docker-bitcoind.conf
restart: on-failure
command: "/wait-for-it.sh tor:9050 --timeout=360 --strict -- /restart.sh"
expose:
- "28256"
- "9501"
- "9502"
ports:
- "127.0.0.1:28256:28256"
- "127.0.0.1:28332:28332"
- "127.0.0.1:28333:9501"
volumes:
- data-bitcoind:/home/bitcoin/.bitcoin
depends_on:
- db
- tor
networks:
dojonet:
ipv4_address: 172.28.1.5
########## If you already have LND installed ##############################################################################
## Skip to the bottom and update your ~/.lnd/lnd.conf file to reflect the appropriate changes.
## Note, I installed everything from scratch on this VM and just moved my ~/.lnd/ directory
## over after initially running LND the first time from command line. If you've already got LND
## running, I'm not entirely positive but just updating your lnd.conf file should do the trick.
########## If you are installing LND on this machine for the first time ###################################################
## Head over to --> https://github.com/lightningnetwork/lnd/blob/master/docs/INSTALL.md
## and follow the instructions **up to** and including, executing `make check` (be sure to run
## `$ make check`, it is important...)
## Start Dojo
$ cd /path/to/docker/my-dojo/ && sudo ./dojo.sh start
## Get your external facing IP address by visiting --> https://www.iplocation.net/
## Start lnd ***Be sure in the below code to input your Dojo's RPC username and pass, as well as your external IP address***
$ lnd --bitcoin.active --bitcoin.mainnet --debuglevel=debug --bitcoin.node=bitcoind --bitcoind.rpchost=127.0.0.1:28256 --bitcoind.rpcuser=your_dojo_rpc_username --bitcoind.rpcpass=your_dojo_rpc_password --bitcoind.zmqpubrawblock=127.0.0.1:28332 --bitcoind.zmqpubrawtx=127.0.0.1:28333 --externalip=xxx.xxx.x.xxx --tor.active --tor.socks=172.28.1.4:9050 --tor.streamisolation --tor.control=127.0.0.1:9051 --tor.v3
## Make a wallet (or unlock one if you transferred over your ~/.lnd/ directory)
## Let it run and process block data
## After processing the block data, in another terminal execute
$ lncli stop
## Make a lnd.conf file to save the flags we set when we first started lnd
$ nano ~/.lnd/lnd.conf
## Copy and paste the below text (between the ----------------'s), and then
## update ***alias, bitcoind.rpcuser, bitcoind.rpcpass*** to reflect
## those of your own.
Begin lnd.conf file
------------------------------------------------------------------------------------------------------
alias=your_choice
debuglevel=debug
# Bitcoin Settings
bitcoin.active=1
bitcoin.mainnet=1
bitcoin.node=bitcoind
# Bitcoind Settings
bitcoind.rpchost=127.0.0.1:28256
bitcoind.rpcuser=your_dojo_rpc_username
bitcoind.rpcpass=your_dojo_rpc_password
bitcoind.zmqpubrawblock=127.0.0.1:28332
bitcoind.zmqpubrawtx=127.0.0.1:28333
# Tor Settings
tor.active=1
tor.socks=172.28.1.4:9050
tor.control=127.0.0.1:9051
tor.streamisolation=1
tor.v3=1
listen=localhost
----------------------------------------------------------------------------------------------------------------------------
End lnd.conf file
## Start LND to make sure everything works
$ lnd
## Check info
$ lncli getinfo
## Now go install Zap-Desktop because it rocks
## Done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment