Documentation ¶
Index ¶
- Constants
- Variables
- func AvailableFrom(tx kv.Tx) (uint64, error)
- func AvailableStorageFrom(tx kv.Tx) (uint64, error)
- func DecodeAccounts(dbKey, dbValue []byte) (uint64, []byte, []byte, error)
- func DecodeStorage(dbKey, dbValue []byte) (uint64, []byte, []byte, error)
- func EncodeAccounts(blockN uint64, s *ChangeSet, f func(k, v []byte) error) error
- func EncodeStorage(blockN uint64, s *ChangeSet, f func(k, v []byte) error) error
- func FindAccount(c kv.CursorDupSort, blockNumber uint64, key []byte) ([]byte, error)
- func FindStorage(c kv.CursorDupSort, blockNumber uint64, k []byte) ([]byte, error)
- func ForEach(db kv.Tx, bucket string, startkey []byte, ...) error
- func ForPrefix(db kv.Tx, bucket string, startkey []byte, ...) error
- func ForRange(db kv.Tx, bucket string, from, to uint64, ...) error
- func FromDBFormat(dbKey, dbValue []byte) (uint64, []byte, []byte, error)
- func GetModifiedAccounts(db kv.Tx, startNum, endNum uint64) ([]types.Address, error)
- func RewindData(db kv.Tx, timestampSrc, timestampDst uint64, changes *etl.Collector, ...) error
- func Truncate(tx kv.RwTx, from uint64) error
- type Change
- type ChangeSet
- func (s *ChangeSet) Add(key []byte, value []byte) error
- func (s *ChangeSet) ChangedKeys() map[string]struct{}
- func (s *ChangeSet) Equals(s2 *ChangeSet) bool
- func (s *ChangeSet) KeySize() int
- func (s *ChangeSet) Len() int
- func (s *ChangeSet) Less(i, j int) bool
- func (s *ChangeSet) String() string
- func (s *ChangeSet) Swap(i, j int)
- type Decoder
- type Encoder
Constants ¶
View Source
const (
DefaultIncarnation = uint64(1)
)
Variables ¶
View Source
var (
ErrNotFound = errors.New("not found")
)
View Source
var Mapper = map[string]struct { IndexBucket string IndexChunkKey func([]byte, uint64) []byte Find func(cursor kv.CursorDupSort, blockNumber uint64, key []byte) ([]byte, error) New func() *ChangeSet Encode Encoder Decode Decoder }{ modules.AccountChangeSet: { IndexBucket: modules.AccountsHistory, IndexChunkKey: modules.AccountIndexChunkKey, New: NewAccountChangeSet, Find: FindAccount, Encode: EncodeAccounts, Decode: DecodeAccounts, }, modules.StorageChangeSet: { IndexBucket: modules.StorageHistory, IndexChunkKey: modules.StorageIndexChunkKey, Find: FindStorage, New: NewStorageChangeSet, Encode: EncodeStorage, Decode: DecodeStorage, }, }
Functions ¶
func EncodeAccounts ¶
func EncodeStorage ¶
func FindAccount ¶
func FindStorage ¶
func ForRange ¶
func ForRange(db kv.Tx, bucket string, from, to uint64, walker func(blockN uint64, k, v []byte) error) error
[from:to)
func FromDBFormat ¶
Encoded Method
func GetModifiedAccounts ¶
GetModifiedAccounts returns a list of addresses that were modified in the block range [startNum:endNum)
Types ¶
type ChangeSet ¶
type ChangeSet struct { // Invariant: all keys are of the same size. Changes []Change // contains filtered or unexported fields }
ChangeSet is a map with keys of the same size. Both keys and values are byte strings.
func NewAccountChangeSet ¶
func NewAccountChangeSet() *ChangeSet
func NewChangeSet ¶
func NewChangeSet() *ChangeSet
func NewStorageChangeSet ¶
func NewStorageChangeSet() *ChangeSet
func (*ChangeSet) Add ¶
Add adds a new entry to the AccountChangeSet. One must not add an existing key and may add keys only of the same size.
func (*ChangeSet) ChangedKeys ¶
Click to show internal directories.
Click to hide internal directories.