Skip to content

Instantly share code, notes, and snippets.

@metalicjames
Created March 9, 2018 04:24
Show Gist options
  • Save metalicjames/e84fccf0c84ddc47b9f4a9c8f9afa8d1 to your computer and use it in GitHub Desktop.
Save metalicjames/e84fccf0c84ddc47b9f4a9c8f9afa8d1 to your computer and use it in GitHub Desktop.
Using lit

Using Lit

Downloading Lit

Unzip the archive to a directory on your computer. You will need to find a terminal to use Lit. If you are unsure how to open a terminal on your computer, your favourite search engine can help you.

Starting Lit

Start lit with ./lit -v --vtc=<vtc fullnode> --tvtc=<tesnet vtc fullnode> --lt4=<testnet ltc fullnode> --tn3=<btc testnet fullnode> --tracker=http://jlovejoy.mit.edu:46580

  • -v make lit print stuff to the console, this is useful to ensure it's working properly and to see when something has gone wrong
  • --tvtc specifies a Vertcoin Testnet node
  • --lt4 specifies a Litecoin Testnet node
  • --tn3 specifies a Bitcoin Testnet node
  • --tracker specifies a lit tracker to use for lightning address lookups

A list of full nodes:

  • BTC Testnet - 54.236.30.55
  • VTC Testnet - tvtc.blkidx.org
  • VTC - vtc.blkidx.org
  • LTC Testnet - 51.15.178.199

Lit is halfway between an SPV and a full node. It syncs all the headers and transactions from a hardcoded checkpoint, but does not verify the transactions for validity. You can omit any of the coin flags to not run that coin.

Controlling Lit

In another terminal start the cli, lit-af: ./lit-af

  1. Use ls to see your channels, addresses and UTXOs

  2. Use lis to start listening and get a lit address

  3. Use con <lit addr> to connect to another lit node. You can connect to my (jamesl22's) lit node with this LN address: ln1jmde0wwtawpcp63wjxhlsjncvlz62wdgdjrp7l (i.e. con ln1jmde0wwtawpcp63wjxhlsjncvlz62wdgdjrp7l).

  4. Use ls to find the id of a peer (shown next to their IP address)

  5. You can send coins to your lit wallet by selecting one of the addresses in brackets at the bottom of the ls output. For VTC this address has a V prefix.

  6. You will need to 'segwitify' the funds you received. You can do this by resending the money to a cool new bech32 P2WPKH address (vtc1 prefixes for VTC). These are shown next to the bracketed legacy P2PKH address you sent to in step 6. You can use send <address> <amount> to do that.

  7. Use fund <peer id> <coin type> <channel capacity> <initial send> to make a channel with a given peer id The coin types are:

    • 28 - VTC
    • 1 - BTC Testnet
    • 65537 - LTC Testnet
    • 65536 - VTC Testnet

    All values are in satoshis.

  8. Use ls to find a channel id (shown next to the channel ie "Channel 1"). You'll need to wait for the channel to confirm to use it. h: -1 or h: 0 will change to the height of the block the fund transaction was mined in.

  9. Use push <channel id> <amount> <times> to send via a given channel id

  10. Use close <channel id> to close a channel cooperatively

  11. Use break <channel id> to close a channel unncooperatively (if you are disconnected. makes you wait 2 days to get coins back)

You can use help to see a full list of commands and what they do.

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