Giter VIP home page Giter VIP logo

hellolightning's Introduction

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

hellolightning's People

Contributors

overtorment avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.