3 releases (breaking)

0.3.0 Oct 20, 2023
0.2.0 Sep 14, 2023
0.1.0 May 31, 2023

#46 in #slot

Download history 38/week @ 2024-04-20 34/week @ 2024-04-27 27/week @ 2024-05-04 36/week @ 2024-05-11 29/week @ 2024-05-18 43/week @ 2024-05-25 35/week @ 2024-06-01 22/week @ 2024-06-08 24/week @ 2024-06-15 42/week @ 2024-06-22 8/week @ 2024-06-29 10/week @ 2024-07-06 44/week @ 2024-07-13 26/week @ 2024-07-20 38/week @ 2024-07-27 29/week @ 2024-08-03

137 downloads per month
Used in 13 crates (3 directly)

Apache-2.0

185KB
3.5K SLoC

Sovereign DB

This package provides a high-level interface to a Schema DB designed specifically for use with the Sovereign SDK. It exposes two db types: LedgerDB, and StateDB.

LedgerDB

As the name implies, the LedgerDB is designed to store ledger history. It has tables for slots, batches, transactions, and events. The LedgerDB also implements the LedgerRpcProvider trait, allowing it to easily serve chain history over RPC.

StateDB

The StateDB is intended to be used with the Jellyfish Merkle Tree provided by the Module System. If you aren't using the Module System, chances are that you'll want to implement your own State Database.

StateDB is designed to store Jellyfish Merkle Tree data efficiently. It maintains a flat store mapping (Key, Version) tuples to values, as well as a mapping from JMT NodeKeys to JMT Nodes.

In the Module System, StateDB is abstracted behind the Storage interface, so you won't interact with it directly.

Dependencies

~31–44MB
~769K SLoC