Documentation ¶
Index ¶
Constants ¶
View Source
const ( SyncNode NodeRole = iota CandidateNode = iota ConsensusNode = iota )
View Source
const GovNodeCacheTime = time.Minute * 10
View Source
const HostsResolverCacheTime = time.Minute * 10
Variables ¶
This section is empty.
Functions ¶
func GetGovernanceView ¶
func GetGovernanceView(backend *ledger.Ledger) (*governance.GovernanceView, error)
Types ¶
type GovNodeInfo ¶ added in v1.14.1
type GovNodeInfo struct { ConsNode bool *config.VBFTPeerStakeInfo }
func GetPeersConfig ¶
type GovNodeLedgerResolver ¶
type GovNodeLedgerResolver struct {
// contains filtered or unexported fields
}
func NewGovNodeResolver ¶
func NewGovNodeResolver(db *ledger.Ledger) *GovNodeLedgerResolver
func (*GovNodeLedgerResolver) GetNodeRoleAndView ¶ added in v1.14.1
func (self *GovNodeLedgerResolver) GetNodeRoleAndView(pubKey string) (NodeRole, uint32)
func (*GovNodeLedgerResolver) IsGovNode ¶
func (self *GovNodeLedgerResolver) IsGovNode(pubKey string) bool
func (*GovNodeLedgerResolver) IsGovNodePubKey ¶
func (self *GovNodeLedgerResolver) IsGovNodePubKey(key keypair.PublicKey) bool
type GovNodeMockResolver ¶
type GovNodeMockResolver struct {
// contains filtered or unexported fields
}
func NewGovNodeMockResolver ¶
func NewGovNodeMockResolver(gov []string) *GovNodeMockResolver
func (*GovNodeMockResolver) GetNodeRoleAndView ¶ added in v1.14.1
func (self *GovNodeMockResolver) GetNodeRoleAndView(key string) (NodeRole, uint32)
func (*GovNodeMockResolver) IsGovNode ¶
func (self *GovNodeMockResolver) IsGovNode(key string) bool
func (*GovNodeMockResolver) IsGovNodePubKey ¶
func (self *GovNodeMockResolver) IsGovNodePubKey(key keypair.PublicKey) bool
type GovNodeResolver ¶
type HostsCache ¶
type HostsCache struct {
// contains filtered or unexported fields
}
type HostsResolver ¶
type HostsResolver struct {
// contains filtered or unexported fields
}
host resolver with cache
func NewHostsResolver ¶
func NewHostsResolver(hosts []string) (*HostsResolver, []string)
func (*HostsResolver) GetHostAddrs ¶
func (self *HostsResolver) GetHostAddrs() []string
Click to show internal directories.
Click to hide internal directories.