Skip to content

mdunnio/network-lightning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

network-lightning

Library for interfacing with c-lightning API. Currently only works over TCP using socat:

sudo socat TCP-LISTEN:<PORT>,reuseaddr,fork UNIX-CLIENT:/path/to/lightning/lightning-rpc

example

{-# LANGUAGE OverloadedStrings #-}

module Main where

import           Control.Monad.IO.Class             (liftIO)

import           Network.Lightning.API.Invoice      (invoice)
import           Network.Lightning.API.ListInvoices (listInvoices)
import           Network.Lightning.API.NewAddress   (NewAddressType (..),
                                                     newAddr)
import           Network.Lightning.API.NodeInfo     (getInfo)
import           Network.Lightning.Client           (runTCPClient)


main :: IO ()
main = runTCPClient host port $ do
    getInfo >>= liftIO . print
    newAddr Bech32 >>= liftIO . print
    invoice 50000 "test" "testing" Nothing >>= liftIO . print
    listInvoices Nothing >>= liftIO . print
  where
    host = "10.0.0.1"
    port = "9835"

About

Haskell library for c-lightning API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published