Skip to content

Commit 93ea752

Browse files
Add a sample module FilesystemPersister.
Intended to be a cross-platform implementation of the channelmonitor::Persist trait. This adds a new lightning-persister crate, that uses the newly exposed lightning crate's test utilities. Notably, this crate is pretty small right now. However, due to future plans to add more data persistence (e.g. persisting the ChannelManager, etc) and a desire to avoid pulling in filesystem usage into the core lightning package, it is best for it to be separated out. Note: Windows necessitates the use of OpenOptions with the `write` permission enabled to `sync_all` on a newly opened channel's data file.
1 parent 69dfbdc commit 93ea752

File tree

4 files changed

+437
-0
lines changed

4 files changed

+437
-0
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
members = [
44
"lightning",
55
"lightning-net-tokio",
6+
"lightning-persister",
67
]
78

89
# Our tests do actual crypo and lots of work, the tradeoff for -O1 is well worth it

lightning-persister/Cargo.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[package]
2+
name = "lightning-persister"
3+
version = "0.0.1"
4+
authors = ["Valentine Wallace", "Matt Corallo"]
5+
license = "Apache-2.0"
6+
description = """
7+
Utilities to manage channel data persistence and retrieval.
8+
"""
9+
10+
[dependencies]
11+
bitcoin = "0.24"
12+
lightning = { version = "0.0.11", path = "../lightning" }
13+
libc = "0.2"
14+
15+
[dev-dependencies.bitcoin]
16+
version = "0.24"
17+
features = ["bitcoinconsensus"]
18+
19+
[dev-dependencies]
20+
lightning = { version = "0.0.11", path = "../lightning", features = ["_test_utils"] }

0 commit comments

Comments
 (0)