Posted on

Workshop 1 – Lightning Node Setup

Learning objectives:

  • to be able to setup a sandbox to learn more about LND
    • what is LND?
    • what is c-lightning?
      • why the need to install this on top of LND
    • what are the commands (cli) use for?
    • what are the use cases for the commands?
    • how to do up a simple smart contract?
  • understand what is meant by programmable money
    • give 1 to 2 examples how layer 2 BTC can be used this way
    • roll out a project to illustrate how layer 2 BTC is used this way

Resource materials:

Exercises: assuming that the setup is completed

  • Running
    • bitcoind or
    • bitcoin-qt
      can run either one (bitcoind , bitcoin-qt) not both
  • Test whether bitcoind is running
    • bitcoin-cli getblockchaininfo
    • ps|grep bitcoind
  • shutdown and power up
  • controlling services
    • Start: sudo systemctl start
    • Restart: sudo systemctl restart
    • The services names are: bitcoind,lightningd,btc-rpc-explorer,eps and spark-wallet

Questions:

  • Node address – does the TOR hide the full node address?
  • Tor Hidden Services and other – how to remote access the node and wallet in order to test out cli commands e.g.
  • Node address does not accept incoming connections – do we need to open port and expose IP? –
    • what abt TOR – what purpose does it serve?
  • Test drive commands
    • start lightningd
      • lightning/lightningd/lightningd
        • ~/lightning/cli$ ./lightning-cli []
    • lightning-cli help
      • lightning-cli newaddr
        • pay via any segwit HD (hierarchical deterministic) wallet
      • lightning-cli connect id [host] [port]
      • lightning-cli getinfo
    • hands-on example: how to send lightning payments using the terminal?
      • lightning-cli newaddr
        • Layer 1 BTC transaction
        • Bech32 – a segwit address format specified by BIP 0173)
          • bc1 format
      • lightning-cli listfunds
      • lightning-cli connect 03e5f9d1935c67a029bf0a26af5f63109f4f4c45993a8f45177a8f2f39bcb46144 77.58.162.148 9735
        • nodeId@host:port
      • lightning-cli list peers
      • lightning-cli fundchannel
      • lightning-cli listpeers
      • lightning-cli decodepay
      • lightning-cli pay
      • lightning-cli listpayments
  • Down the rabbit hole … and took a detour
    • need to take a look into bitcoin-cli and bitcoind, together with chapter 3 of Andreas Antonopoulos’ book Mastering Bitcoin
      • elliptic curve cryptography – generating the public key in Python
      • bitcoin scripts
    • using python to test drive the command-line interface (cli)

[ifpaid 0.00001 BTC text=”Please pay 0.00001 BTC to continue reading.” button=”Click here to pay using the Lightning Network”]

  • what is:
    • sudo ufw allow from 192.168.1.0/24 to any port 50002,3002,9737,22 proto tcp