dbfs 0.1.8

This commit is contained in:
Evan Feenstra
2022-07-18 09:48:18 -07:00
parent 203c87ac4c
commit a1769feb16
2 changed files with 7 additions and 16 deletions

View File

@@ -10,4 +10,4 @@ lightning-signer-core = { git = "https://gitlab.com/Evanfeenstra/validating-ligh
lightning-signer-server = { git = "https://gitlab.com/Evanfeenstra/validating-lightning-signer", branch = "patch-sign-chan", default-features = false, features = ["persist"] }
serde = { version = "1.0.105" }
hex = "0.4.3"
fsdb = "0.1.7"
fsdb = "0.1.8"

View File

@@ -32,22 +32,13 @@ pub struct FsPersister {
impl FsPersister {
pub fn new() -> Self {
let db = Fsdb::new("home/ubuntu/sdcard").expect("could not create db");
let mut nodes = db.bucket("nodes").expect("fail nodes");
nodes.set_max_file_name(FAT32_MAXFILENAMESIZE);
let mut channels = db.double_bucket("channel").expect("fail channel");
channels.set_max_file_name(FAT32_MAXFILENAMESIZE);
let mut allowlist = db.bucket("allowlis").expect("fail allowlis");
allowlist.set_max_file_name(FAT32_MAXFILENAMESIZE);
let mut chaintracker = db.bucket("chaintra").expect("fail chaintra");
chaintracker.set_max_file_name(FAT32_MAXFILENAMESIZE);
let mut pubkeys = db.bucket("pubkey").expect("fail pubkey");
pubkeys.set_max_file_name(FAT32_MAXFILENAMESIZE);
let max = Some(FAT32_MAXFILENAMESIZE);
Self {
nodes,
channels,
allowlist,
chaintracker,
pubkeys,
nodes: db.bucket("nodes", max).expect("fail nodes"),
channels: db.double_bucket("channel", max).expect("fail channel"),
allowlist: db.bucket("allowlis", max).expect("fail allowlis"),
chaintracker: db.bucket("chaintra", max).expect("fail chaintra"),
pubkeys: db.bucket("pubkey", max).expect("fail pubkey"),
}
}
}