This crate provides an generic interface from rust to the core lightning daemon through RPC with a generic interface.
This crate provides an generic interface from rust to the c-lightning daemon through RPC with a generic interface.
From the crate clightningrpc you can find this quote
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!
This crate solve the versioning with core lightning by offering a strongly type library with a generic interface, an example can be:
```rust extern crate clightningrpc_common;
use serde::{Deserialize, Serialize}; use std::env;
use clightningrpccommon::client; use clightningrpccommon::types::Response;
/// Example of type definition
struct GetInfoResponse { pub id: String, }
/// Example of type definition
struct GetInfoRequest {}
fn main() {
let sock = env::homedir().unwrap().join(".lightning/lightning-rpc");
println!("Using socket {}", sock.display());
let client = client::Client::new(&sock);
let method = "getinfo";
let params = GetInfoRequest {};
match client
.sendrequest(method, params)
.andthen(|res: Response
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.