diff --git a/node_core/src/chain_storage/block_store.rs b/node_core/src/chain_storage/block_store.rs index c48ed06..7084fa8 100644 --- a/node_core/src/chain_storage/block_store.rs +++ b/node_core/src/chain_storage/block_store.rs @@ -88,6 +88,8 @@ impl NodeBlockStore { Ok(serde_json::from_slice( &self.dbio.get_snapshot_transaction()?, )?) + } + pub fn put_snapshot_at_block_id( &self, id: u64, diff --git a/node_core/src/chain_storage/mod.rs b/node_core/src/chain_storage/mod.rs index f28a2ae..1f5c07d 100644 --- a/node_core/src/chain_storage/mod.rs +++ b/node_core/src/chain_storage/mod.rs @@ -30,7 +30,7 @@ pub struct NodeChainStore { } impl NodeChainStore { - pub fn new(home_dir: &Path, genesis_block: Block) -> Result<(Self, u64)> { + pub fn new(config: NodeConfig, genesis_block: Block) -> Result<(Self, u64)> { let mut acc_map = HashMap::new(); let mut nullifier_store = HashSet::new(); let mut utxo_commitments_store = UTXOCommitmentsMerkleTree::new(vec![]); @@ -58,6 +58,7 @@ impl NodeChainStore { nullifier_store, utxo_commitments_store, pub_tx_store, + node_config: config, }, block_id, )) diff --git a/node_core/src/lib.rs b/node_core/src/lib.rs index 3708b82..49f1285 100644 --- a/node_core/src/lib.rs +++ b/node_core/src/lib.rs @@ -98,7 +98,7 @@ impl NodeCore { let genesis_block = client.get_block(genesis_id.genesis_id).await?.block; - let (mut storage, mut chain_height) = NodeChainStore::new(&config.home, genesis_block)?; + let (mut storage, mut chain_height) = NodeChainStore::new(config.clone(), genesis_block)?; pre_start::setup_empty_sc_states(&storage).await?; diff --git a/storage/src/lib.rs b/storage/src/lib.rs index 424acd5..7616842 100644 --- a/storage/src/lib.rs +++ b/storage/src/lib.rs @@ -122,19 +122,19 @@ impl RocksDBIO { .map_err(|rerr| DbError::rocksdb_cast_message(rerr, None)) } - pub fn meta_column(&self) -> Arc { + pub fn meta_column(&self) -> Arc> { self.db.cf_handle(CF_META_NAME).unwrap() } - pub fn block_column(&self) -> Arc { + pub fn block_column(&self) -> Arc> { self.db.cf_handle(CF_BLOCK_NAME).unwrap() } - pub fn sc_column(&self) -> Arc { + pub fn sc_column(&self) -> Arc> { self.db.cf_handle(CF_SC_NAME).unwrap() } - pub fn snapshot_column(&self) -> Arc { + pub fn snapshot_column(&self) -> Arc> { self.db.cf_handle(CF_SNAPSHOT_NAME).unwrap() }