Crates.io | clightningrpc |
lib.rs | clightningrpc |
version | 0.3.0-beta.8 |
source | src |
created_at | 2018-09-05 15:01:01.699739 |
updated_at | 2023-08-24 23:29:41.917653 |
description | Crate that provides a strong typed RPC binding from rust code to the core lightning daemon |
homepage | https://github.com/laanwj/rust-clightning-rpc |
repository | https://github.com/laanwj/rust-clightning-rpc.git |
max_upload_size | |
id | 83066 |
size | 60,708 |
This crate provides an interface from rust to the c-lightning daemon through RPC.
This crate provides an interface from rust to the c-lightning daemon through RPC.
extern crate clightningrpc;
use std::env;
use clightningrpc::LightningRPC;
fn main() {
let sock = env::home_dir().unwrap().join(".lightning/lightning-rpc");
let mut client = LightningRPC::new(&sock);
println!("getinfo result: {:?}", client.getinfo().unwrap());
}
See examples directory for more usage examples. To build and run an example do cargo run --example ex_1
.
API documentation for the lastest version can be found on docs.rs.
Currently implemented (this covers all non-dev commands as of c-lightning v0.6.1rc1):
getinfo
feerates
listnodes
listchannels
help
getlog
listconfigs
listpeers
listinvoices
invoice
delinvoice
delexpiredinvoice
autocleaninvoice
waitanyinvoice
waitinvoice
pay
sendpay
waitsendpay
listpayments
decodepay
getroute
connect
disconnect
fundchannel
close
ping
listfunds
withdraw
newaddr
stop
Be aware that the API (of rust-clighting-rpc, but also that of c-lightning itself) is not finalized. This means that it may change from version to version and break your compile, sorry!
N.B: A good solution if you have some missing compatibility between core lightning and the rust library, considering to use the common crate.
make fmt
before committingIf you want support this library consider to donate with the following methods
This library is based on Andrew Poelstra's rust-jsonrpc.