This guide shows you how to use `DotNetLightning.ClnRpc` to call c-lightning rpc.
let uri = Uri("tcp://127.0.0.1:9835")
// or Uri("unix:///path/to/your/lightning-rpc")
let client = ClnClient(Network.RegTest, uri)
let getPeerTask = client.GetinfoAsync()
let info = getPeerTask.GetAwaiter().GetResult()
Warning: Output, it-value and value references require --eval
namespace System
namespace NBitcoin
namespace DotNetLightning
namespace DotNetLightning.ClnRpc
val uri: Uri
Multiple items
type Uri =
interface ISerializable
new: uriString: string -> unit + 6 overloads
member Equals: comparand: obj -> bool
member GetComponents: components: UriComponents * format: UriFormat -> string
member GetHashCode: unit -> int
member GetLeftPart: part: UriPartial -> string
member IsBaseOf: uri: Uri -> bool
member IsWellFormedOriginalString: unit -> bool
member MakeRelative: toUri: Uri -> string
member MakeRelativeUri: uri: Uri -> Uri
...
<summary>Provides an object representation of a uniform resource identifier (URI) and easy access to the parts of the URI.</summary>
--------------------
Uri(uriString: string) : Uri
Uri(uriString: string, creationOptions: inref<UriCreationOptions>) : Uri
Uri(uriString: string, uriKind: UriKind) : Uri
Uri(baseUri: Uri, relativeUri: string) : Uri
Uri(baseUri: Uri, relativeUri: Uri) : Uri
val client: ClnClient
Multiple items
type ClnClient =
new: network: Network * address: Uri * jsonLibrary: JsonLibraryType * getTransport: Func<CancellationToken,Task<Stream>> -> ClnClient
member SendCommandAsync: methodName: string * req: obj * noReturn: bool * ct: CancellationToken -> Task<'T>
member SendNotification: methodName: string * req: obj * ct: CancellationToken -> Task
member NewtonSoftJsonConverters: ResizeArray<JsonConverter>
member STJConverters: ResizeArray<JsonConverter>
<summary>
c-lightning rpc client.
</summary>
--------------------
new: network: Network * address: Uri * jsonLibrary: JsonLibraryType * getTransport: Func<Threading.CancellationToken,Threading.Tasks.Task<IO.Stream>> -> ClnClient
type Network =
member CreateAssetId: base58: string -> BitcoinAssetId
member CreateBitcoinAddress: base58: string -> BitcoinAddress + 1 overload
member CreateBitcoinExtKey: key: ExtKey -> BitcoinExtKey + 1 overload
member CreateBitcoinExtPubKey: pubkey: ExtPubKey -> BitcoinExtPubKey
member CreateBitcoinScriptAddress: base58: string -> BitcoinScriptAddress
member CreateBitcoinSecret: base58: string -> BitcoinSecret + 1 overload
member CreateTransaction: unit -> Transaction
member CreateTransactionBuilder: unit -> TransactionBuilder + 1 overload
member GetBase58CheckEncoder: unit -> Base58CheckEncoder
member GetBech32Encoder: ``type`` : Bech32Type * throws: bool -> Bech32Encoder
...
property Network.RegTest: Network with get
val getPeerTask: Threading.Tasks.Task<Responses.GetinfoResponse>
static member ClnClientExtensions.GetinfoAsync: this: ClnClient * ct: Threading.CancellationToken -> Threading.Tasks.Task<Responses.GetinfoResponse>
val info: Responses.GetinfoResponse
Threading.Tasks.Task.GetAwaiter() : Runtime.CompilerServices.TaskAwaiter<Responses.GetinfoResponse>