Copyright | 2018 DFINITY Stiftung |
---|---|
License | GPL-3 |
Maintainer | Enzo Haussecker <enzo@dfinity.org> |
Stability | Stable |
Safe Haskell | None |
Language | Haskell2010 |
A Merkleized key–value data store.
- type RadixRoot = ShortByteString
- data RadixTree
- data RadixError
- createRadixTree :: MonadResource m => Int -> Int -> FilePath -> Maybe RadixRoot -> m RadixTree
- subtreeRadixTree :: MonadIO m => RadixRoot -> RadixTree -> m RadixTree
- insertRadixTree :: MonadIO m => ByteString -> ByteString -> RadixTree -> m RadixTree
- deleteRadixTree :: MonadIO m => ByteString -> RadixTree -> m RadixTree
- merkleizeRadixTree :: MonadIO m => RadixTree -> m (RadixRoot, RadixTree)
- lookupMerkleizedRadixTree :: MonadIO m => ByteString -> RadixTree -> m (Maybe (ByteString, RadixTree))
- lookupNonMerkleizedRadixTree :: MonadIO m => ByteString -> RadixTree -> m (Maybe (ByteString, RadixTree))
- isEmptyRadixTree :: RadixTree -> Bool
- isValidRadixRoot :: MonadIO m => RadixRoot -> RadixTree -> m Bool
- sourceMerkleizedRadixTree :: MonadResource m => [Bool] -> Int -> BoundedChan RadixRoot -> RadixTree -> Source m ByteString
- printMerkleizedRadixTree :: MonadIO m => RadixTree -> m ()
- printNonMerkleizedRadixTree :: MonadIO m => RadixTree -> m ()
Types
type RadixRoot = ShortByteString Source #
data RadixError Source #
Create
:: MonadResource m | |
=> Int | Bloom filter size in bits. |
-> Int | LRU cache size in items. |
-> FilePath | LevelDB database. |
-> Maybe RadixRoot | Last valid state root. |
-> m RadixTree |
Create a radix tree.
Create a radix subtree from a radix tree.
Insert
:: MonadIO m | |
=> ByteString | Key. |
-> ByteString | Value. |
-> RadixTree | Radix tree. |
-> m RadixTree |
Insert a key and value into a radix tree.
Delete
:: MonadIO m | |
=> ByteString | Key. |
-> RadixTree | Radix tree. |
-> m RadixTree |
Delete a value from a radix tree.
Merkleize
Merkleize a radix tree. This will flush the buffer to disk.
Query
lookupMerkleizedRadixTree Source #
:: MonadIO m | |
=> ByteString | Key. |
-> RadixTree | Radix tree. |
-> m (Maybe (ByteString, RadixTree)) |
Lookup a value in a Merkleized radix tree.
lookupNonMerkleizedRadixTree Source #
:: MonadIO m | |
=> ByteString | Key. |
-> RadixTree | Radix tree. |
-> m (Maybe (ByteString, RadixTree)) |
Lookup a value in a non-Merkleized radix tree.
Test
Check if a state root is valid.
Stream
sourceMerkleizedRadixTree Source #
:: MonadResource m | |
=> [Bool] | Bit patten. |
-> Int | LRU cache size in items. |
-> BoundedChan RadixRoot | Terminal state root producer. |
-> RadixTree | Radix tree. |
-> Source m ByteString |
Create a conduit from a Merkleized radix tree.
Debug
printMerkleizedRadixTree Source #
Print a Merkleized radix tree.
printNonMerkleizedRadixTree Source #
Print a non-Merkleized radix tree.