Versions in this module Expand all Collapse all v1 v1.0.1 Oct 12, 2020 Changes in this version + const BftOraclesByNebulaKey + const BlockKey + const CommitKey + const ConsulsCandidateKey + const ConsulsCountKey + const ConsulsKey + const LastHeightKey + const LastRoundApproved + const NebulaInfoKey + const NebulaOraclesIndexKey + const NebulaeByOracleKey + const OraclesByNebulaKey + const OraclesByValidatorKey + const RevealKey + const ScoreKey + const Separator + const SignConsulsResultByConsulKey + const SignOraclesResultByConsulKey + const SignResultKey + const VoteKey + var ErrKeyNotFound = badger.ErrKeyNotFound + type Consul struct + PubKey account.ConsulPubKey + Value uint64 + type Key string + type NebulaInfo struct + ChainType account.ChainType + MaxPulseCountInBlock uint64 + MinScore uint64 + Owner account.ConsulPubKey + type NebulaMap map[string]NebulaInfo + type OraclesByTypeMap map[account.ChainType]account.OraclesPubKey + type OraclesMap map[string]account.ChainType + type ScoresByConsulMap map[account.ConsulPubKey]uint64 + type Storage struct + func New() *Storage + func (storage *Storage) BftOraclesByNebula(nebulaId account.NebulaId) (OraclesMap, error) + func (storage *Storage) Commit() error + func (storage *Storage) CommitHash(nebulaId account.NebulaId, tcHeight int64, pulseId int64, ...) ([]byte, error) + func (storage *Storage) Consuls() ([]Consul, error) + func (storage *Storage) ConsulsCandidate() ([]Consul, error) + func (storage *Storage) ConsulsCount() (int, error) + func (storage *Storage) LastHeight() (uint64, error) + func (storage *Storage) LastRoundApproved() (uint64, error) + func (storage *Storage) NebulaInfo(nebulaId account.NebulaId) (*NebulaInfo, error) + func (storage *Storage) NebulaOraclesIndex(nebulaAddress account.NebulaId) (uint64, error) + func (storage *Storage) Nebulae() (NebulaMap, error) + func (storage *Storage) NebulaeByOracle(pubKey account.OraclesPubKey) ([]account.NebulaId, error) + func (storage *Storage) NewTransaction(db *badger.DB) + func (storage *Storage) OraclesByConsul(pubKey account.ConsulPubKey) (OraclesByTypeMap, error) + func (storage *Storage) OraclesByNebula(nebulaId account.NebulaId) (OraclesMap, error) + func (storage *Storage) Result(nebulaId account.NebulaId, pulseId int64, oraclePubKey account.OraclesPubKey) ([]byte, error) + func (storage *Storage) Results(nebulaId account.NebulaId, pulseId uint64) ([]string, error) + func (storage *Storage) Reveal(nebulaId account.NebulaId, height int64, pulseId int64, commitHash []byte, ...) ([]byte, error) + func (storage *Storage) Reveals(nebulaId account.NebulaId, height int64, pulseId int64) ([]string, error) + func (storage *Storage) RoundHeight(chainType account.ChainType, ledgerHeight uint64) (uint64, error) + func (storage *Storage) Score(pubKey account.ConsulPubKey) (uint64, error) + func (storage *Storage) Scores() (ScoresByConsulMap, error) + func (storage *Storage) SetBftOraclesByNebula(nebulaId account.NebulaId, oracles OraclesMap) error + func (storage *Storage) SetCommitHash(nebulaId account.NebulaId, tcHeight int64, pulseId int64, ...) error + func (storage *Storage) SetConsuls(consuls []Consul) error + func (storage *Storage) SetConsulsCandidate(consuls []Consul) error + func (storage *Storage) SetConsulsCount(consulsCount int) error + func (storage *Storage) SetLastHeight(height uint64) error + func (storage *Storage) SetLastRoundApproved(roundId uint64) error + func (storage *Storage) SetNebula(nebulaId account.NebulaId, info NebulaInfo) error + func (storage *Storage) SetNebulaOraclesIndex(nebulaAddress account.NebulaId, index uint64) error + func (storage *Storage) SetNebulaeByOracle(pubKey account.OraclesPubKey, nebulae []account.NebulaId) error + func (storage *Storage) SetNewRound(chainType account.ChainType, ledgerHeight uint64, tcHeight uint64) error + func (storage *Storage) SetOraclesByConsul(pubKey account.ConsulPubKey, oracles OraclesByTypeMap) error + func (storage *Storage) SetOraclesByNebula(nebulaAddress account.NebulaId, oracles OraclesMap) error + func (storage *Storage) SetResult(nebulaId account.NebulaId, pulseId int64, oraclePubKey account.OraclesPubKey, ...) error + func (storage *Storage) SetReveal(nebulaId account.NebulaId, height int64, pulseId int64, commitHash []byte, ...) error + func (storage *Storage) SetScore(pubKey account.ConsulPubKey, score uint64) error + func (storage *Storage) SetSignConsuls(consulsPubKey account.ConsulPubKey, chainType account.ChainType, roundId int64, ...) error + func (storage *Storage) SetSignOracles(pubKey account.ConsulPubKey, nebulaId account.NebulaId, roundId int64, ...) error + func (storage *Storage) SetVote(pubKey account.ConsulPubKey, votes []Vote) error + func (storage *Storage) SignConsulsByConsul(consulPubKey account.ConsulPubKey, chainType account.ChainType, roundId int64) ([]byte, error) + func (storage *Storage) SignOraclesByConsul(pubKey account.ConsulPubKey, nebulaId account.NebulaId, roundId int64) ([]byte, error) + func (storage *Storage) Vote(pubKey account.ConsulPubKey) ([]Vote, error) + func (storage *Storage) Votes() (VoteByConsulMap, error) + type Vote struct + PubKey account.ConsulPubKey + Score uint64 + type VoteByConsulMap map[account.ConsulPubKey][]Vote