1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! Storage layer for Moloch.
//!
//! Provides persistent storage for:
//! - Audit events
//! - Blocks
//! - MMR nodes
//! - Indexes for efficient queries
//!
//! # Batch Operations
//!
//! For efficient bulk writes, use the batch API:
//!
//! ```ignore
//! use moloch_storage::{RocksStorage, StorageBatch, BatchWriter};
//!
//! let storage = RocksStorage::open("./data")?;
//! let mut batch = StorageBatch::new();
//!
//! batch.put_block(block1);
//! batch.put_block(block2);
//! batch.put_mmr_node(0, hash);
//!
//! storage.commit(batch)?; // Atomic write
//! ```
//!
//! # Iterators
//!
//! For efficient traversal, use the iterator API:
//!
//! ```ignore
//! use moloch_storage::{RocksStorage, BlockIterator, EventIterator};
//!
//! let storage = RocksStorage::open("./data")?;
//!
//! // Iterate over all blocks
//! for block in BlockIterator::all(&storage)? {
//! println!("Block {}", block?.header.height);
//! }
//!
//! // Iterate over events in specific block range
//! for event in EventIterator::in_blocks(&storage, 0, 100) {
//! let (height, event) = event?;
//! println!("Event {} in block {}", event.id(), height);
//! }
//! ```
pub use ;
pub use ;
pub use ;
pub use RocksStorage;
pub use ;
pub use ;