• Stars
    star
    551
  • Rank 80,726 (Top 2 %)
  • Language
    Go
  • License
    MIT License
  • Created about 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Lightning Network node software

lit - a lightning node you can run on your own

Lit Logo

Build Status

Under development, not for use with real money.

Setup

Prerequisites

  • Git

  • Go

  • make

  • (Optional, Windows) Cygwin

  • (Optional, for full test suite) Python 3 + requests library from PyPI

Downloading

Clone the repo from git

git clone https://github.com/mit-dci/lit
cd lit

or go get it

go get -v github.com/mit-dci/lit

Installation

Linux, macOS, Cygwin, etc.

You can either use Go's built-in dependency management and build tool

cd {GOPATH}/src/github.com/mit-dci/lit
go get -v ./...
go build

or use the Makefile

make # or make all

To run the python integration tests (which requires bitcoind), run make test with-python=false

Windows

Install Cygwin and follow the setup instructions or download prebuilt binaries from

  1. Make sure that environmental variable %GOPATH% is initizlized correctly.

  2. Download required dependencies and then build with:

go get -v ./...
cd %GOPATH%\src\github.com\mit-dci\lit
go build -v .
go build -v .\cmd\lit-af

Running lit

The below command will run Lit on the Bitcoin testnet3 network

(Note: Windows users should take off ./ but need to change lit to lit.exe)

./lit --tn3=true

The words yup, yes, y, true, 1, ok, enable, on can be used to specify that Lit automatically connect to peers fetched from a list of DNS seeds. It can also be replaced by the address of the node you wish to connect to. For example for the btc testnet3:

./lit --tn3=localhost

It will use default port for different nodes. See the "Command line arguments" section.

Packaging

You can make an archive package for any distribution by doing:

./build/releasebuild.sh <os> <arch>

and it will be placed in build/_releasedir. It should support any OS that Go and lit's dependencies support. In place of windows use win and in place of 386 use i386.

You can also package for Linux, macOS, and Windows in both amd64 and i386 architectures by running make package. (NOTE: macOS is amd64 only)

Running ./build/releasebuild.sh clean cleans the directories it generates.

Using Lightning

Once you are done setting up lit, you can read about

Contributing

Pull Requests and Issues are most welcome, checkout Contributing to get started.

Command line arguments

When starting lit, the following command line arguments are available. The following commands may also be specified in lit.conf which is automatically generated on startup with tn3=1 by default.

Connecting to networks

Arguments Details Default Port
--tn3 <nodeHostName> connect to nodeHostName, which is a bitcoin testnet3 node. 18333
--reg <nodeHostName> connect to nodeHostName, which is a bitcoin regtest node. 18444
--lt4 <nodeHostName> connect to nodeHostName, which is a litecoin testnet4 node. 19335

Other settings

Arguments Details
-v or --verbose Verbose; log everything to stdout as well as the lit.log file. Lots of text.
--dir <folderPath> Use folderPath as the directory. By default, saves to ~/.lit/.
-p or --rpcport <portNumber> Listen for RPC clients on port portNumber. Defaults to 8001. Useful when you want to run multiple lit nodes on the same computer (also need the --dir option).
-r or --reSync Try to re-sync to the blockchain.

Folders

Folder Name Details
bech32 Util for the Bech32 format
btcutil Bitcoin-specific libraries
build Tools used for building Lit
cmd Has some rpc client code to interact with the lit node. Not much there yet
coinparam Information and other constants for identifying currencies
consts Global constants
crypto Utility cryptographic libraries
dlc Discreet Log Contracts
docs Writeups for setting up things and screenshots
elkrem A hash-tree for storing log(n) items instead of n
litrpc Websockets based RPC connection
lndc Lightning network data connection -- send encrypted / authenticated messages between nodes
lnutil Widely used utility functions
portxo Portable utxo format, exchangable between node and base wallet (or between wallets). Should make this into a BIP once it's more stable.
powless Introduces a web API chainhook in addition to the uspv one
qln A quick channel implementation with databases. Doesn't do multihop yet.
sig64 Library to make signatures 64 bytes instead of 71 or 72 or something
snap Snapcraft metadata
test Python Integration tests
uspv Deals with the network layer, sending network messages and filtering what to hand over to wallit
wallit Deals with storing and retrieving utxos, creating and signing transactions
watchtower Unlinkable outsourcing of channel monitoring
wire Tools for working with binary data structures in Bitcoin

Hierarchy of packages

One instance of lit has one litNode (package qln).

LitNodes manage lndc connections to other litnodes, manage all channels, rpc listener, and the ln.db. Litnodes then initialize and contol wallits.

A litNode can have multiple wallits; each must have different params. For example, there can be a testnet3 wallit, and a regtest wallit. Eventually it might make sense to support a root key per wallit, but right now the litNode gives a rootPrivkey to each wallet on startup. Wallits each have a db file which tracks utxos, addresses, and outpoints to watch for the upper litNode. Wallits do not directly do any network communication. Instead, wallits have one or more chainhooks; a chainhook is an interface that talks to the blockchain.

One package that implements the chainhook interface is uspv. Uspv deals with headers, wire messages to fullnodes, filters, and all the other mess that is contemporary SPV.

(in theory it shouldn't be too hard to write a package that implements the chainhook interface and talks to some block explorer. Maybe if you ran your own explorer and authed and stuff that'd be OK.)

Dependency graph

Dependency Graph

License

MIT

More Repositories

1

opencbdc-tx

A transaction processor for a hypothetical, general-purpose, central bank digital currency
C++
899
star
2

mas.s62

MAS.S62 Spring 2018 course website
Go
331
star
3

utreexo

accumulator for bitcoin utxo set
Go
317
star
4

opencx

An open-source cryptocurrency exchange toolkit for implementing experimental exchange features
Go
201
star
5

CryptoKernel

A SDK for implementing blockchain-based digital currencies
C++
173
star
6

tangled-curl

IOTA's hash function curl is broken
Python
173
star
7

6.892-public

Course information for 6.892 (Spring 2017)
110
star
8

zkledger

Privacy-preserving auditing for distributed ledgers
Go
65
star
9

rustreexo

Utreexo in rust
Rust
43
star
10

resources

Resources for getting started
42
star
11

zksigma

A library for generating non-interactive proofs of knowledge without trusted setup
Go
29
star
12

litpay

Lightning Network Payment Gateway
JavaScript
21
star
13

libutreexo

library for utreexo accumulator in c++
C++
20
star
14

Dictionary

A lisiting of terminology for internal consistent use at the DCI, but published to serve as reference externally. PR's welcome!
17
star
15

dlc-oracle-nodejs

A library for making Discreet Log Contracts oracles in NodeJS
TypeScript
14
star
16

utxohunt

utxohunt assignment for 6.892
Go
12
star
17

CryptoCurrency

Uses the CryptoKernel library to create a modular cryptocurrency.
C++
12
star
18

dlcspec

specification for discreet log contracts
11
star
19

pooldetective

Go
10
star
20

artistry

direct artist payments using blockchain
JavaScript
9
star
21

SmartSolar

Smart contracts to finance and orchestrate energy payments of solar PV systems.
C++
9
star
22

dlcoracle

Go
7
star
23

dlc-oracle-go

Library for making Discreet Log Contract Oracles in Go
Go
7
star
24

terraform-aws-opencbdc-tctl

terraform infrastructure for opencbdc-tctl
HCL
6
star
25

opencbdc-tctl

A large-scale, on-demand test orchestrator for opencbdc-tx
Go
6
star
26

Smart-Property

JavaScript
6
star
27

firmitas

A cryptocurrency market conditions simulator for testing algorithmic interest rate, quantitative easing and block reward changes
C++
5
star
28

cash-disclosure

5
star
29

dlc-oracle-go-samples

Samples of using the Discreet Log Contracts Oracle library
Go
4
star
30

research-guide

3
star
31

go-bverify

B-Verify in Go
Go
3
star
32

ck-wallet

React-native CK wallet
JavaScript
3
star
33

dlc-oracle-nodejs-samples

JavaScript
3
star
34

opencbdc-js

node-js module to interact with opencbdc-tx
JavaScript
2
star
35

lit-rpc-client-dotnet

Client for LIT's RPC server in .NET Core
C#
2
star
36

dlc-oracle-dotnet

Library for making Discreet Log Contract Oracles in .NET Core
C#
2
star
37

TransThunder

music streaming with micropayments
2
star
38

opencbdc-ui

a demo, browser-based wallet for opencbdc
Vue
1
star
39

lit-rpc-client-nodejs-samples

Samples of using the LIT RPC Client for NodeJS
JavaScript
1
star
40

lit-tracker

A node tracker for lit
JavaScript
1
star
41

config-files-archive

Archive of config files used for OpenCBDC instantiation, and tests
1
star
42

poolmonitor

Mining pool monitor
1
star
43

litvending

Making old vending machines Lit compliant
Python
1
star
44

lit-rpc-client-go-samples

Samples of using the LIT RPC Client for Go
Go
1
star
45

lit-rpc-client-nodejs

Client for LIT's RPC server in NodeJS (Typescript)
TypeScript
1
star