[BREAKGLASS] Lightning Network node
Go to file
2021-12-06 18:06:44 +00:00
.idea OPS: .idea files for build 2021-11-10 11:06:46 +00:00
cli REF: leak-tracking binary; FIX: slow fees 2021-12-06 18:06:44 +00:00
example REF: bump java ldk; fixes 2021-12-04 11:56:10 +00:00
gradle/wrapper init 2021-10-23 18:59:31 +01:00
gui ADD: basic gui (should be opened in browser) 2021-11-24 17:14:30 +00:00
libs REF: leak-tracking binary; FIX: slow fees 2021-12-06 18:06:44 +00:00
src/main FIX: usign wrong dir for channel monitors / manager 2021-12-06 12:07:38 +00:00
.gitignore cli + ldk works; dumb rpc server 2021-10-25 20:24:02 +01:00
build.gradle.kts cli + ldk works; dumb rpc server 2021-10-25 20:24:02 +01:00
gradle.properties init 2021-10-23 18:59:31 +01:00
gradlew init 2021-10-23 18:59:31 +01:00
gradlew.bat init 2021-10-23 18:59:31 +01:00
LICENSE DOC 2021-11-05 16:39:06 +00:00
README.md Update README.md 2021-11-19 18:08:18 +00:00
settings.gradle.kts init 2021-10-23 18:59:31 +01:00

status: alpha (not ready for production)

Hello, Lightning!

Cli lightning network server, based on LDK (rust-lightning). Provides HTTP-RPC interface.

Example:

  • build it (or download binary from releases)
  • run it: java -jar ./out/artifacts/hello_main_jar/hello.main.jar
  • now HTTP server listens on port 8310
  • run nodejs control process from ./cli/ directory (npm i && npm start)

Philosophy

Barebone Java-based server cant do much, out of the box it can only do lightning peers networking and disk persistence. All the functionality should be implemented on upper level (like, GUI application, or nodejs cli script, etc), that includes: providing blockchain data, managing onchain coins to open channels (via PSBT), keeping a list of peers to keep connections etc

So currently repo has ldk-server (compiled from kotlin, considered a lower level), which is supposed to run and provide RPC, and a cli nodejs process which controls it (considered upper level). Cli process utilizes following apis:

Whole setup is thus quite lightweight.

Security

Server is intended to run in a secure environment. Thus, on-disk storage is not encrypted, and RPC server handles connections without TLS (plain HTTP). Also, even though RPC listens on 127.0.0.1, it has no auth.

TODO

Available DUMB-RPC/HTTP calls

  • start
  • stop
  • transactionconfirmed
  • transactionunconfirmed
  • getrelevanttxids
  • updatebestblock
  • connectpeer
  • disconnectbynodeid
  • sendpayment
  • addinvoice
  • listpeers
  • getnodeid
  • closechannelcooperatively
  • closechannelforce
  • openchannelstep1
  • openchannelstep2
  • listusablechannels
  • listcChannels
  • setrefundaddressscript
  • setfeerate
  • getmaturingbalance
  • getmaturingheight
  • savenetworkgraph
  • geteventsfundinggenerationready
  • geteventschannelclosed
  • ldkversion
  • help
  • geteventsregistertx
  • geteventsregisteroutput
  • geteventstxbroadcast
  • geteventspaymentsent
  • geteventspaymentpathfailed
  • geteventspaymentreceived
  • geteventspaymentforwarded

Storage

Data is written in ~/.hellolightning (non-configurable). There are files with states per each channel, and one for the channel manager. Upon the first launch of cli control script, given java process is running, HelloLightning will be seeded with a secure entropy, which is then stored in seed.txt. All events that must be passed from lower level (lightning) to upper level (control script) are served through their respective RPCs, and also stored as json files.

License

MIT