Guest User

Untitled

a guest
Apr 17th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. # Lightning Network Workshop Series 1
  2.  
  3. 1. Run btcd
  4. ```bash
  5. ./btcd --simnet --rpcuser=kek --rpcpass=kek --txindex --connect=YOUR_IP
  6. ```
  7.  
  8. 2. Run lnd
  9. ```bash
  10. ./lnd --bitcoin.active --bitcoin.simnet --bitcoin.node=btcd --btcd.rpcuser=kek --btcd.rpcpass=kek --debuglevel=trace --noencryptwallet
  11. ```
  12.  
  13. 3. Check the block height to make sure your Blockchain is in sync
  14. ```bash
  15. ./btcctl --simnet --rpcuser=kek --rpcpass=kek getinfo
  16. ```
  17.  
  18. 4. Make sure lnd is connected, you can check the block height here too
  19. ```bash
  20. ./lncli getinfo
  21. ```
  22.  
  23. 5. Create a new address with lnd
  24. ```bash
  25. ./lncli newaddress p2wkh
  26. ```
  27. Publish your publick key into IRC and ask for free bitcoins from the hubs. The host will send you the bitcoin, then they will mine a few blocks.
  28.  
  29. 6. Now check your wallet balance and make sure you receive them
  30. ```bash
  31. ./lncli walletbalance
  32. ```
  33.  
  34. 7. Here's start the fun part. Connect to the peer on your left in your group, to connect you need the public key and the address:
  35. ```bash
  36. ./lncli connect PUB_KEY@IP
  37. ```
  38. You can find your IP running the following command on Linux and OSX `ifconfig` or running on Windows `ipconfig`, then searching for en0 and inet. You can find your lnd public key with `./lncli getinfo`.
  39.  
  40. 8. More fun. Open a channel funding some money in the channel, and sending some fund to the other side of the channel
  41. ```bash
  42. ./lncli openchannel --block pubkey 50000 50000
  43. ```
  44.  
  45. 9. Make sure the channel is open
  46. ```bash
  47. ./lncli listchannels
  48. ```
  49.  
  50. 10. Now you can create an invoice and send to someone in your group, possibly with less than 5000 satoshis
  51. ```bash
  52. ./lncli addinvoice AMOUNT_IN_SATOSHIS
  53. ```
  54.  
  55. 11. When you receive an invoice from someone remember always to run decodepayreq to check how much they're asking you
  56. ```bash
  57. ./lncli decodepayreq PAYREQ
  58. ```
  59.  
  60. 12. You can also use queryroutes to make sure it exists one or more route to process the payment
  61. ```bash
  62. ./lncli queryroutes PUB_KEY AMOUNT_IN_SATOSHIS
  63. ```
  64.  
  65. 13. And voilà, you can finally pay the invoice!
  66. ```bash
  67. ./lncli payinvoice PAYREQ
  68. ```
  69.  
  70. 14. ... and check the invoices that have been payed to you
  71. ```bash
  72. ./lncli listinvoices
  73. ```
Add Comment
Please, Sign In to add comment