ldk_node/io/
mod.rs

1// This file is Copyright its original authors, visible in version control history.
2//
3// This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
5// http://opensource.org/licenses/MIT>, at your option. You may not use this file except in
6// accordance with one or both of these licenses.
7
8//! Objects and traits for data persistence.
9
10pub mod sqlite_store;
11#[cfg(test)]
12pub(crate) mod test_utils;
13pub(crate) mod utils;
14pub(crate) mod vss_store;
15
16/// The event queue will be persisted under this key.
17pub(crate) const EVENT_QUEUE_PERSISTENCE_PRIMARY_NAMESPACE: &str = "";
18pub(crate) const EVENT_QUEUE_PERSISTENCE_SECONDARY_NAMESPACE: &str = "";
19pub(crate) const EVENT_QUEUE_PERSISTENCE_KEY: &str = "events";
20
21/// The peer information will be persisted under this key.
22pub(crate) const PEER_INFO_PERSISTENCE_PRIMARY_NAMESPACE: &str = "";
23pub(crate) const PEER_INFO_PERSISTENCE_SECONDARY_NAMESPACE: &str = "";
24pub(crate) const PEER_INFO_PERSISTENCE_KEY: &str = "peers";
25
26/// The payment information will be persisted under this prefix.
27pub(crate) const PAYMENT_INFO_PERSISTENCE_PRIMARY_NAMESPACE: &str = "payments";
28pub(crate) const PAYMENT_INFO_PERSISTENCE_SECONDARY_NAMESPACE: &str = "";
29
30/// The node metrics will be persisted under this key.
31pub(crate) const NODE_METRICS_PRIMARY_NAMESPACE: &str = "";
32pub(crate) const NODE_METRICS_SECONDARY_NAMESPACE: &str = "";
33pub(crate) const NODE_METRICS_KEY: &str = "node_metrics";
34
35/// The BDK wallet's [`ChangeSet::descriptor`] will be persisted under this key.
36///
37/// [`ChangeSet::descriptor`]: bdk_wallet::ChangeSet::descriptor
38pub(crate) const BDK_WALLET_DESCRIPTOR_PRIMARY_NAMESPACE: &str = "bdk_wallet";
39pub(crate) const BDK_WALLET_DESCRIPTOR_SECONDARY_NAMESPACE: &str = "";
40pub(crate) const BDK_WALLET_DESCRIPTOR_KEY: &str = "descriptor";
41
42/// The BDK wallet's [`ChangeSet::change_descriptor`] will be persisted under this key.
43///
44/// [`ChangeSet::change_descriptor`]: bdk_wallet::ChangeSet::change_descriptor
45pub(crate) const BDK_WALLET_CHANGE_DESCRIPTOR_PRIMARY_NAMESPACE: &str = "bdk_wallet";
46pub(crate) const BDK_WALLET_CHANGE_DESCRIPTOR_SECONDARY_NAMESPACE: &str = "";
47pub(crate) const BDK_WALLET_CHANGE_DESCRIPTOR_KEY: &str = "change_descriptor";
48
49/// The BDK wallet's [`ChangeSet::network`] will be persisted under this key.
50///
51/// [`ChangeSet::network`]: bdk_wallet::ChangeSet::network
52pub(crate) const BDK_WALLET_NETWORK_PRIMARY_NAMESPACE: &str = "bdk_wallet";
53pub(crate) const BDK_WALLET_NETWORK_SECONDARY_NAMESPACE: &str = "";
54pub(crate) const BDK_WALLET_NETWORK_KEY: &str = "network";
55
56/// The BDK wallet's [`ChangeSet::local_chain`] will be persisted under this key.
57///
58/// [`ChangeSet::local_chain`]: bdk_wallet::ChangeSet::local_chain
59pub(crate) const BDK_WALLET_LOCAL_CHAIN_PRIMARY_NAMESPACE: &str = "bdk_wallet";
60pub(crate) const BDK_WALLET_LOCAL_CHAIN_SECONDARY_NAMESPACE: &str = "";
61pub(crate) const BDK_WALLET_LOCAL_CHAIN_KEY: &str = "local_chain";
62
63/// The BDK wallet's [`ChangeSet::tx_graph`] will be persisted under this key.
64///
65/// [`ChangeSet::tx_graph`]: bdk_wallet::ChangeSet::tx_graph
66pub(crate) const BDK_WALLET_TX_GRAPH_PRIMARY_NAMESPACE: &str = "bdk_wallet";
67pub(crate) const BDK_WALLET_TX_GRAPH_SECONDARY_NAMESPACE: &str = "";
68pub(crate) const BDK_WALLET_TX_GRAPH_KEY: &str = "tx_graph";
69
70/// The BDK wallet's [`ChangeSet::indexer`] will be persisted under this key.
71///
72/// [`ChangeSet::indexer`]: bdk_wallet::ChangeSet::indexer
73pub(crate) const BDK_WALLET_INDEXER_PRIMARY_NAMESPACE: &str = "bdk_wallet";
74pub(crate) const BDK_WALLET_INDEXER_SECONDARY_NAMESPACE: &str = "";
75pub(crate) const BDK_WALLET_INDEXER_KEY: &str = "indexer";
76
77/// [`StaticInvoice`]s will be persisted under this key.
78///
79/// [`StaticInvoice`]: lightning::offers::static_invoice::StaticInvoice
80pub(crate) const STATIC_INVOICE_STORE_PRIMARY_NAMESPACE: &str = "static_invoices";