lightning-cluster

Crates.iolightning-cluster
lib.rslightning-cluster
version0.1.4
sourcesrc
created_at2023-08-03 20:45:03.737409
updated_at2023-08-10 21:11:50.859541
descriptionLightning Node Load Balancer & Cache
homepage
repositoryhttps://github.com/nodeless-io/lightning-cluster
max_upload_size
id934425
size37,233
utxo.one (utxo-one)

documentation

README

#Lightning Cluster

A load balanching and caching service for production lightning nodes.

#[tokio::main]
async fn main() {
    let node1 = Node {
        pubkey: dotenvy::var("NODE1_PUBKEY").unwrap(),
        ip: dotenvy::var("NODE1_IP").unwrap(),
        port: dotenvy::var("NODE1_PORT").unwrap(),
        network: NodeNetwork::Testnet,
        lightning_impl: NodeLightningImpl::Lnd,
        client: NodeClient::Lnd(LndClient::new(
            dotenvy::var("NODE1_HOST").unwrap(),
            dotenvy::var("NODE1_CERT_PATH").unwrap(),
            dotenvy::var("NODE1_MACAROON_PATH").unwrap(),
        )),
    };

    let nodes = vec![node1];
    let cluster = cluster::Cluster::new(nodes);

    let req = ClusterAddInvoice {
        pubkey: None,
        memo: String::from("test"),
        value: 1000,
        expiry: 1000,
    };

    let invoice = cluster.add_invoice(req, None).await.unwrap();

    let get_invoice = cluster.lookup_invoice(&invoice.r_hash, None).await.unwrap();

    println!("{:?}", get_invoice);
}
Commit count: 19

cargo fmt