Documentation ¶
Overview ¶
Package muxdb implements the storage layer for block-chain. It manages instance of merkle-patricia-trie, and general purpose named kv-store.
Index ¶
- type MuxDB
- func (db *MuxDB) CleanTrieHistory(ctx context.Context, startCommitNum, limitCommitNum uint32) error
- func (db *MuxDB) Close() error
- func (db *MuxDB) IsNotFound(err error) bool
- func (db *MuxDB) NewNonCryptoTrie(name string, root workshare.Bytes32, commitNum, distinctNum uint32) *Trie
- func (db *MuxDB) NewStore(name string) kv.Store
- func (db *MuxDB) NewTrie(name string, root workshare.Bytes32, commitNum, distinctNum uint32) *Trie
- type Options
- type Trie
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MuxDB ¶
type MuxDB struct {
// contains filtered or unexported fields
}
MuxDB is the database to efficiently store state trie and block-chain data.
func (*MuxDB) CleanTrieHistory ¶
CleanTrieHistory clean trie history within [startCommitNum, limitCommitNum).
func (*MuxDB) IsNotFound ¶
IsNotFound returns if the error indicates key not found.
func (*MuxDB) NewNonCryptoTrie ¶
func (db *MuxDB) NewNonCryptoTrie(name string, root workshare.Bytes32, commitNum, distinctNum uint32) *Trie
NewNonCryptoTrie creates non-crypto trie with existing root node.
If root is zero or blake2b hash of an empty string, the trie is initially empty.
type Options ¶
type Options struct { // TrieNodeCacheSizeMB is the size of the cache for trie node blobs. TrieNodeCacheSizeMB int // TrieRootCacheCapacity is the capacity of the cache for trie root nodes. TrieRootCacheCapacity int // TrieCachedNodeTTL defines the life time(times of commit) of cached trie nodes. TrieCachedNodeTTL uint16 // TrieLeafBankSlotCapacity defines max count of cached slot for leaf bank. TrieLeafBankSlotCapacity int // TrieHistPartitionFactor is the partition factor for historical trie nodes. TrieHistPartitionFactor uint32 // TrieDedupedPartitionFactor is the partition factor for deduped trie nodes. TrieDedupedPartitionFactor uint32 // TrieWillCleanHistory is the hint to tell if historical nodes will be cleaned. TrieWillCleanHistory bool // OpenFilesCacheCapacity is the capacity of open files caching for underlying database. OpenFilesCacheCapacity int // ReadCacheMB is the size of read cache for underlying database. ReadCacheMB int // WriteBufferMB is the size of write buffer for underlying database. WriteBufferMB int }
Options optional parameters for MuxDB.
Click to show internal directories.
Click to hide internal directories.