Advertisement
Guest User

latest updated lnd & btcd testnet node setup on ubuntu 16.04

a guest
Jan 21st, 2018
583
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.03 KB | None | 0 0
  1. the following guide is an updated install process from the following which needs some work updating still
  2. https://github.com/lightningnetwork/lnd/blob/master/docs/INSTALL.md
  3.  
  4. It is specific to btcd, lnd, on testnet, running on an ubuntu 16.04 server host.
  5.  
  6. It does not address mainnet, or using bitcoind, or nuetrino.
  7.  
  8. INSTALL
  9. =======
  10.  
  11. install golang
  12. sudo apt-get install golang-1.9-go
  13. mkdir go
  14.  
  15. set go paths
  16. nano .profile
  17.  
  18. add to the end
  19. export GOROOT=/usr/lib/go-1.9/
  20. export GOPATH=$HOME/go
  21. export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
  22.  
  23. logout, log back in
  24.  
  25. check variables with
  26. go env
  27.  
  28. install glide
  29. go get -u github.com/Masterminds/glide
  30.  
  31. install lnd
  32. git clone https://github.com/lightningnetwork/lnd $GOPATH/src/github.com/lightningnetwork/lnd
  33. cd $GOPATH/src/github.com/lightningnetwork/lnd
  34. glide install
  35. go install . ./cmd/...
  36.  
  37. run tests
  38. go install; go test -v -p 1 $(go list ./... | grep -v '/vendor/')
  39.  
  40. install btcd
  41. git clone https://github.com/roasbeef/btcd $GOPATH/src/github.com/roasbeef/btcd
  42. cd $GOPATH/src/github.com/roasbeef/btcd
  43. glide install
  44. go install . ./cmd/...
  45.  
  46. setup a $HOME/.btcd/btcd.conf file from https://github.com/btcsuite/btcd/blob/master/sample-btcd.conf
  47.  
  48. simplest version might be
  49. [Application Options]
  50. ; set debug to error, warn, info, debug
  51. debuglevel=warn
  52. datadir=~/.btcd/data
  53. testnet=1
  54. ; set to your external IP address
  55. externalip=YOURIP
  56. ; add a known external peer if you like
  57. ;addpeer=KNOWNPEERIP
  58. rpcuser=REPLACEME
  59. rpcpass=REPLACEME
  60. txindex=1
  61.  
  62. run btcd and sync (will take a long time)
  63. btcd --testnet --txindex --rpcuser=REPLACEME --rpcpass=REPLACEME
  64.  
  65. monitor progress in another terminal window with
  66. btcctl --testnet --rpcuser=REPLACEME --rpcpass=REPLACEME getinfo
  67. btcctl --testnet --rpcuser=REPLACEME --rpcpass=REPLACEME getpeerinfo | more
  68.  
  69. to run in the background (and tail log file)
  70. btcd --testnet --txindex --rpcuser=REPLACEME --rpcpass=REPLACEME >> btcd.log 2>&1 &
  71.  
  72. view logs by going
  73. tail btcd.log
  74.  
  75. [Please see EXTRA section at end, for supervisor configuration to run btcd automatically]
  76.  
  77. create $HOME/.lnd/lnd.conf from https://github.com/lightningnetwork/lnd/blob/master/sample-lnd.conf
  78.  
  79. simple version might be as follows:
  80.  
  81. [Application Options]
  82. datadir=~/.lnd/data
  83. logdir=~/.lnd/logs
  84. debuglevel=warn
  85. debughtlc=true
  86. maxpendingchannels=10
  87. ; don't encrypt wallet in testing environment, but please consider it mandatory for live
  88. noencryptwallet=true
  89. ; replace with your external IP, same as btcd.conf
  90. externalip=YOURIP
  91.  
  92. [Bitcoin]
  93. bitcoin.active=1
  94. bitcoin.testnet=1
  95. ; Use the btcd back-end if using btcd
  96. bitcoin.node=btcd
  97.  
  98. [Btcd]
  99. ; use the user/pass you setup for btcd
  100. btcd.rpcuser=<btcd rpc username>
  101. btcd.rpcpass=<btcd rpc password>
  102.  
  103. [Neutrino]
  104. # neutrino.active=1
  105. neutrino.connect=faucet.lightning.community
  106.  
  107. [Autopilot]
  108. ; autopilot.active=1
  109. ; The maximum number of channels that should be created.
  110. ; autopilot.maxchannels=5
  111. ; The percentage of total funds that should be committed to automatic channel
  112. ; establishment
  113. ; autopilot.allocation=0.6
  114.  
  115. Once btcd has synced, run lnd using the btcd backend and lnd.conf config file create
  116. lnd --bitcoin.active --bitcoin.testnet
  117.  
  118. to run in the background (and tail log file)
  119. lnd --bitcoin.active --bitcoin.testnet >> lnd.log 2>&1 &
  120.  
  121. tail the log file
  122. tail lnd.log
  123.  
  124. [Please see EXTRA section at end, for supervisor configuration to run automatically]
  125.  
  126. To verify things are operational
  127. lncli getinfo
  128. lncli getnetworkinfo
  129. lncli describegraph
  130.  
  131. Setup a wallet to get testnet coins from faucet (needs a np2wkh segwit format address)
  132. lncli newaddress np2wkh
  133.  
  134. open https://testnet.manu.backend.hamburg/faucet and paste in the address you created and click 'give me some coins' multiple times
  135.  
  136. After a few minutes your coins should have arrived. You can verify with
  137. lncli walletbalance
  138.  
  139. Open a channel to one or more of the following, or another peer you know, or from https://explorer.acinq.co/#/
  140. Yall.org: 02ecafd1d828301da58edacdd61232835940c91767a01b3bfba57240989f9df4da@45.77.115.33:9735
  141. Htlc.me: 02d28c3aac4b4f36746052a735831afbe65bc5698a7be5bd41b42fd1ddf2a1a358@45.63.87.131:9735
  142. Bitrefill: 0298d0c6987e2e64451c7f723e15aff4dfca92f0e3973d214e206257abb0d1dd55@lnd.bitrefill.com:9735
  143. lnd.fun: 02f057867392ba8e9fe2b62b8a21ee36be00a3338d5d34cb1a2ffab3d57d8a2aea@lnd.fun:9735
  144. Eclair: 03933884aaf1d6b108397e5efe5c86bcf2d8ca8d2f700eda99db9214fc2712b134@endurance.acinq.co:9735
  145. LND Faucet: 02c39955c1579afe4824dc0ef4493fdf7f3660b158cf6d367d8570b9f19683afb5@159.203.125.125:9735
  146. lncast.com: 02139a5bc1f1c929c04530a99160f2072e2a731f14c666abf87479510912279c11@lncast.com:9735
  147. Slack Tipbot: 03ba998c7cfc9e48d59bf5350ebb54356b75ba9cce6a6284628eda6bf389ce452c@194.135.83.49:9735
  148. ctrlbreak_1: 03b0d54ece3b31934a96b8c425aa33759ee9acb876cc9b92bbfe8e1c19af6c11a2@47.55.95.227:9735
  149.  
  150. Open a channel by first connection, then opening a channel as follows
  151. lncli connect pubkey@ip:port
  152. lncli openchannel --node_key=<pubkey> --local_amt=100000
  153.  
  154. verify pending & open channels using
  155. lncli pendingchannels
  156. lncli listchannels
  157.  
  158. EXTRA
  159. =====
  160. start btcd and lnd automatically using supervisor. First install supervisor
  161. sudo apt-get install supervisor
  162.  
  163. Then add two configuration files as follows:
  164. cd /etc/supervisor/conf.d
  165.  
  166. nano btcd.conf
  167.  
  168. [program:btcd]
  169. user=REPLACE-WITH-YOUR-USERNAME
  170. command=/home/YOUR-HOME-DIR/go/bin/btcd --testnet --txindex --rpcuser=REPLACEME --rpcpass=REPLACEME
  171. startretries=999999999999999999999999999
  172. autostart = true
  173. autorestart=true
  174.  
  175. nano lnd.conf
  176.  
  177. [program:lnd]
  178. user=REPLACE-WITH-YOUR-USERNAME
  179. command=/home/YOUR-HOME-DIR/go/bin/lnd --bitcoin.active --bitcoin.testnet
  180. startretries=999999999999999999999999999
  181. autostart = true
  182. autorestart=true
  183.  
  184. and start the processes
  185. sudo supervisorctl start btcd
  186. sudo supervisorctl start lnd
  187.  
  188. monitor the log files by tailing them
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement