bs_gl_client/lib.rs
1//! Greenlight client library to schedule nodes, interact with them
2//! and sign off on signature requests.
3//!
4
5/// Interact with a node running on greenlight.
6///
7/// The node must be scheduled using [`crate::scheduler::Scheduler`]:
8///
9///
10pub mod node;
11
12/// Generated protobuf messages and client stubs.
13///
14/// Since the client needs to be configured correctly, don't use
15/// [`pb::node_client::NodeClient`] directly, rather use
16/// [`node::Node`] to create a correctly configured client.
17pub mod pb;
18
19use std::time::Duration;
20
21/// Register, recover and schedule your nodes on greenlight.
22pub mod scheduler;
23
24/// Your keys, your coins!
25///
26/// This module implements the logic to stream, verify and respond to
27/// signature requests from the node. Without this the node cannot
28/// move your funds.
29pub mod signer;
30
31pub mod persist;
32
33pub mod lnurl;
34
35/// Helpers to configure the mTLS connection authentication.
36///
37/// mTLS configuration for greenlight clients. Clients are
38/// authenticated by presenting a valid mTLS certificate to the
39/// node. Each node has its own CA. This CA is used to sign both the
40/// device certificates, as well as the node certificate itself. This
41/// ensures that only clients that are authorized can open a
42/// connection to the node.
43pub mod tls;
44
45#[cfg(feature = "export")]
46pub mod export;
47
48/// Tools to interact with a node running on greenlight.
49pub mod utils;
50
51pub mod credentials;
52
53/// Functionality to integrate greenlight with a Lightning Service Provider
54pub mod lsps;
55
56pub mod util;
57
58use thiserror::Error;
59
60#[derive(Error, Debug)]
61pub enum Error {
62 #[error("The signature request does not match any authorized RPC calls")]
63 MissingAuthorization,
64}
65
66pub use lightning_signer::bitcoin;
67pub use lightning_signer::lightning;
68pub use lightning_signer::lightning_invoice;
69
70pub(crate) const TCP_KEEPALIVE: Duration = Duration::from_secs(5);
71pub(crate) const TCP_KEEPALIVE_TIMEOUT: Duration = Duration::from_secs(90);
72
73pub mod runes;