Documentation ¶
Index ¶
- Constants
- func HeightAtVersion(version int64) uint64
- func LoadValidatorRing(version int64, ringSize int, ...) (*validator.Ring, error)
- func VersionAtHeight(height uint64) int64
- type DumpReader
- type FileDumpReader
- type KeyFormatStore
- type ReadState
- func (s *ReadState) GetAccount(address crypto.Address) (*acm.Account, error)
- func (s *ReadState) GetName(name string) (*names.Entry, error)
- func (s *ReadState) GetProposal(proposalHash []byte) (*payload.Ballot, error)
- func (s *ReadState) GetStorage(address crypto.Address, key binary.Word256) (binary.Word256, error)
- func (s *ReadState) IterateAccounts(consumer func(*acm.Account) error) error
- func (s *ReadState) IterateNames(consumer func(*names.Entry) error) error
- func (s *ReadState) IterateProposals(consumer func(proposalHash []byte, proposal *payload.Ballot) error) error
- func (s *ReadState) IterateStorage(address crypto.Address, consumer func(key, value binary.Word256) error) error
- func (s *ReadState) IterateStreamEvents(start, end *exec.StreamKey, consumer func(*exec.StreamEvent) error) error
- func (s *ReadState) IterateValidators(fn func(id crypto.Addressable, power *big.Int) error) error
- func (s *ReadState) Power(id crypto.Address) (*big.Int, error)
- func (s *ReadState) StreamEvent(height, index uint64) (*exec.StreamEvent, error)
- func (s *ReadState) TxByHash(txHash []byte) (*exec.TxExecution, error)
- func (s *ReadState) TxsAtHeight(height uint64) ([]*exec.TxExecution, error)
- type State
- func (s *State) Copy(db dbm.DB) (*State, error)
- func (s *State) Dump() string
- func (s *State) GetAccountStats() acmstate.AccountStats
- func (s *State) Hash() []byte
- func (s *State) InitialCommit() error
- func (s *State) LoadDump(reader DumpReader) error
- func (s *State) LoadHeight(height uint64) (*ReadState, error)
- func (s *State) SetLogger(logger *logging.Logger)
- func (s *State) Update(updater func(up Updatable) error) ([]byte, int64, error)
- func (s *State) Version() int64
- type Updatable
Constants ¶
View Source
const (
DefaultValidatorsWindowSize = 10
)
View Source
const VersionOffset = int64(1)
Since we have an initial save of our state forest we start one version ahead of the block height, but from then on we should track height by this offset.
Variables ¶
This section is empty.
Functions ¶
func HeightAtVersion ¶
func LoadValidatorRing ¶
func LoadValidatorRing(version int64, ringSize int, getImmutable func(version int64) (*storage.ImmutableForest, error)) (*validator.Ring, error)
Initialises the validator Ring from the validator storage in forest
func VersionAtHeight ¶
Types ¶
type DumpReader ¶
func NewFileDumpReader ¶
func NewFileDumpReader(filename string) (DumpReader, error)
type FileDumpReader ¶
type FileDumpReader struct {
// contains filtered or unexported fields
}
type KeyFormatStore ¶
type KeyFormatStore struct { Account *storage.MustKeyFormat Storage *storage.MustKeyFormat Name *storage.MustKeyFormat Proposal *storage.MustKeyFormat Validator *storage.MustKeyFormat Event *storage.MustKeyFormat TxHash *storage.MustKeyFormat }
type ReadState ¶
type ReadState struct { Forest storage.ForestReader validator.History }
func (*ReadState) GetAccount ¶
Returns nil if account does not exist with given address.
func (*ReadState) GetProposal ¶
func (*ReadState) GetStorage ¶
func (*ReadState) IterateAccounts ¶
func (*ReadState) IterateNames ¶
func (*ReadState) IterateProposals ¶
func (*ReadState) IterateStorage ¶
func (*ReadState) IterateStreamEvents ¶
func (*ReadState) IterateValidators ¶
func (*ReadState) StreamEvent ¶
func (s *ReadState) StreamEvent(height, index uint64) (*exec.StreamEvent, error)
func (*ReadState) TxsAtHeight ¶
func (s *ReadState) TxsAtHeight(height uint64) ([]*exec.TxExecution, error)
type State ¶
Writers to state are responsible for calling State.Lock() before calling
func LoadState ¶
Tries to load the execution state from DB, returns nil with no error if no state found
func MakeGenesisState ¶
Make genesis state from GenesisDoc and save to DB
func (*State) GetAccountStats ¶
func (s *State) GetAccountStats() acmstate.AccountStats
func (*State) InitialCommit ¶
func (*State) LoadDump ¶
func (s *State) LoadDump(reader DumpReader) error
Click to show internal directories.
Click to hide internal directories.