Documentation
¶
Index ¶
- Constants
- Variables
- type Consul
- type Key
- type NebulaInfo
- type NebulaMap
- type OraclesByTypeMap
- type OraclesMap
- type ScoresByConsulMap
- type 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
- type VoteByConsulMap
Constants ¶
View Source
const ( Separator string = "_" ConsulsKey Key = "consuls" ConsulsCandidateKey Key = "consuls_candidate" LastHeightKey Key = "last_height" LastRoundApproved Key = "last_round_approved" ConsulsCountKey Key = "consuls_count" SignConsulsResultByConsulKey Key = "consuls_sing" SignOraclesResultByConsulKey Key = "oracles_sign" NebulaeByOracleKey Key = "nebulae_by_oracle" NebulaOraclesIndexKey Key = "nebula_oracles_index" OraclesByNebulaKey Key = "oracles_by_nebula" BftOraclesByNebulaKey Key = "bft_oracles_nebula" OraclesByValidatorKey Key = "oracles" BlockKey Key = "block" VoteKey Key = "vote" ScoreKey Key = "score" CommitKey Key = "commit" RevealKey Key = "reveal" SignResultKey Key = "signResult" NebulaInfoKey Key = "nebula_info" )
Variables ¶
View Source
var (
ErrKeyNotFound = badger.ErrKeyNotFound
)
Functions ¶
This section is empty.
Types ¶
type Consul ¶
type Consul struct { PubKey account.ConsulPubKey Value uint64 }
type NebulaInfo ¶
type NebulaMap ¶
type NebulaMap map[string]NebulaInfo
type OraclesByTypeMap ¶
type OraclesByTypeMap map[account.ChainType]account.OraclesPubKey
type OraclesMap ¶
type ScoresByConsulMap ¶
type ScoresByConsulMap map[account.ConsulPubKey]uint64
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func (*Storage) BftOraclesByNebula ¶
func (storage *Storage) BftOraclesByNebula(nebulaId account.NebulaId) (OraclesMap, error)
func (*Storage) CommitHash ¶
func (*Storage) ConsulsCandidate ¶
func (*Storage) ConsulsCount ¶
func (*Storage) LastHeight ¶
func (*Storage) LastRoundApproved ¶
func (*Storage) NebulaInfo ¶
func (storage *Storage) NebulaInfo(nebulaId account.NebulaId) (*NebulaInfo, error)
func (*Storage) NebulaOraclesIndex ¶
func (*Storage) NebulaeByOracle ¶
func (*Storage) NewTransaction ¶
func (*Storage) OraclesByConsul ¶
func (storage *Storage) OraclesByConsul(pubKey account.ConsulPubKey) (OraclesByTypeMap, error)
func (*Storage) OraclesByNebula ¶
func (storage *Storage) OraclesByNebula(nebulaId account.NebulaId) (OraclesMap, error)
func (*Storage) RoundHeight ¶
func (*Storage) Scores ¶
func (storage *Storage) Scores() (ScoresByConsulMap, error)
func (*Storage) SetBftOraclesByNebula ¶
func (storage *Storage) SetBftOraclesByNebula(nebulaId account.NebulaId, oracles OraclesMap) error
func (*Storage) SetCommitHash ¶
func (*Storage) SetConsuls ¶
func (*Storage) SetConsulsCandidate ¶
func (*Storage) SetConsulsCount ¶
func (*Storage) SetLastHeight ¶
func (*Storage) SetLastRoundApproved ¶
func (*Storage) SetNebula ¶
func (storage *Storage) SetNebula(nebulaId account.NebulaId, info NebulaInfo) error
func (*Storage) SetNebulaOraclesIndex ¶
func (*Storage) SetNebulaeByOracle ¶
func (*Storage) SetNewRound ¶
func (*Storage) SetOraclesByConsul ¶
func (storage *Storage) SetOraclesByConsul(pubKey account.ConsulPubKey, oracles OraclesByTypeMap) error
func (*Storage) SetOraclesByNebula ¶
func (storage *Storage) SetOraclesByNebula(nebulaAddress account.NebulaId, oracles OraclesMap) error
func (*Storage) SetScore ¶
func (storage *Storage) SetScore(pubKey account.ConsulPubKey, score uint64) error
func (*Storage) SetSignConsuls ¶
func (*Storage) SetSignOracles ¶
func (*Storage) SetVote ¶
func (storage *Storage) SetVote(pubKey account.ConsulPubKey, votes []Vote) error
func (*Storage) SignConsulsByConsul ¶
func (*Storage) SignOraclesByConsul ¶
func (*Storage) Votes ¶
func (storage *Storage) Votes() (VoteByConsulMap, error)
type Vote ¶
type Vote struct { PubKey account.ConsulPubKey Score uint64 }
type VoteByConsulMap ¶
type VoteByConsulMap map[account.ConsulPubKey][]Vote
Click to show internal directories.
Click to hide internal directories.