Struct clightningrpc::lightningrpc::LightningRPC[][src]

pub struct LightningRPC { /* fields omitted */ }

Structure providing a high-level interface to the c-lightning daemon RPC

Methods

impl LightningRPC
[src]

Create a new connection from a UNIX socket path.

Arguments

  • sockname - Path of UNIX socket to connect to, by default lightningd will create a socket named .lightning/lightning-rpc in the home directory of the user running lightningd.

Show information about this node.

Supply feerate estimates manually.

Show node {id} (or all, if no {id}), in our local network view.

Show channel {short_channel_id} (or all known channels, if no {short_channel_id}).

List available commands, or give verbose help on one command.

Show logs, with optional log {level} (info|unusual|debug|io).

List all configuration options, or with [config], just that one. Because of the dynamic nature of the returned object, unlike the other methods, this returns a HashMap (from String to Json) instead of a structure.

Show current peers, if {level} is set, include {log}s.

Show invoice {label} (or all, if no {label)).

Create an invoice for {msatoshi} with {label} and {description} with optional {expiry} seconds (default 1 hour).

Create an invoice for {msatoshi} with {label} and {description} with optional {expiry} seconds (default 1 hour).

Delete all expired invoices that expired as of given {maxexpirytime} (a UNIX epoch time), or all expired invoices if not specified.

Set up autoclean of expired invoices. Perform cleanup every {cycle_seconds} (default 3600), or disable autoclean if 0. Clean up expired invoices that have expired for {expired_by} seconds (default 86400).

Wait for the next invoice to be paid, after {lastpay_index}. (if supplied)

Wait for an incoming payment matching the invoice with {label}.

Send a lightning payment.

Arguments

  • bolt11 - A string that holds the payment information in bolt11 format.
  • options - Options for this payment. Use Default::default() to not pass any options.

Send along {route} in return for preimage of {payment_hash}, with optional {description}.

Wait for payment attempt on {payment_hash} to succeed or fail, but only up to {timeout} seconds.

Show outgoing payments.

Decode {bolt11}, using {description} if necessary.

Show route to {id} for {msatoshi}, using {riskfactor} and optional {cltv} (default 9). If specified search from {fromid} otherwise use this node as source. Randomize the route with up to {fuzzpercent} (0.0 -> 100.0, default 5.0) using {seed} as an arbitrary-size string seed.

Connect to {id} at {host} (which can end in ':port' if not default). {id} can also be of the form id@host.

Disconnect from peer with {peer_id}.

Fund channel with {id} using {satoshi} (or 'all') satoshis, at optional {feerate}.

Close the channel with {id} (either peer ID, channel ID, or short channel ID). If {force} (default false) is true, force a unilateral close after {timeout} seconds (default 30), otherwise just schedule a mutual close later and fail after timing out.

Send {peerid} a ping of length {len} (default 128) asking for {pongbytes} (default 128).

Show available funds from the internal wallet.

Send to {destination} address {satoshi} (or 'all') amount via Bitcoin transaction, at optional {feerate}.

Get a new {bech32, p2sh-segwit} address to fund a channel (default is bech32).

Shut down the lightningd process.

Auto Trait Implementations