lnsocket

A minimal C library for connecting to the lightning network
git clone git://jb55.com/lnsocket
Log | Files | Refs | Submodules | README | LICENSE

README (1288B)


      1 
      2 lnsocket
      3 ========
      4 
      5 A simple C library for sending messages over the lightning network
      6 
      7 Thanks to Rusty and the clightning project for much of this code, I have
      8 adapted it to be more library friendly.
      9 
     10 
     11 Motivation
     12 ----------
     13 
     14 I wanted a way to send custom messages to my lightning node, such as RPC.
     15 Building this as a simple C library will allow you to speak the lightning
     16 network in native applications, like on mobile.
     17 
     18 
     19 Dependencies
     20 ------------
     21 
     22 You'll need libtool/autoconf/automake for the libsodium/secp256k1 submodules,
     23 but otherwise there are no dependencies
     24 
     25 
     26 Building
     27 --------
     28 
     29 $ make
     30 
     31 
     32 iOS
     33 ---
     34 
     35 $ make ios
     36 
     37 This will build lnsocket.a, libsodium.a and libsecp256k1.a under target/ios for
     38 arm64 and ios-sim.
     39 
     40 
     41 WASM/JS/Web
     42 -----------
     43 
     44 $ make wasm
     45 
     46 This will build lnsocket.js and lnsocket_module.wasm so that you can connect to
     47 the lightning network from your browser via websockets. See lnsocket_example.js
     48 for a demo.
     49 
     50 
     51 Examples
     52 --------
     53 
     54 * See test.c for a ping/pong example
     55 
     56 * See lnrpc.c for an RPC example
     57 
     58 Contributing
     59 ------------
     60 
     61 Send patches to jb55@jb55.com:
     62 
     63 $ git config format.subjectPrefix 'PATCH lnsocket'
     64 $ git config sendemail.to 'William Casarin <jb55@jb55.com>'
     65 $ git send-email --annotate HEAD^
     66 
     67 See https://git-send-email.io/ for configuring your mailer