Documentation
¶
Index ¶
- type Config
- type ControlTimer
- type Core
- func (c *Core) AddBlockSignature(bs hg.BlockSignature)
- func (c *Core) AddSelfEvent(otherHead string) error
- func (c *Core) AddTransactions(txs [][]byte)
- func (c *Core) Bootstrap() error
- func (c *Core) EventDiff(known map[int]int) (events []hg.Event, err error)
- func (c *Core) FastForward(peer string, block hg.Block, frame hg.Frame) error
- func (c *Core) FromWire(wireEvents []hg.WireEvent) ([]hg.Event, error)
- func (c *Core) GetAnchorBlockWithFrame() (hg.Block, hg.Frame, error)
- func (c *Core) GetConsensusEvents() []string
- func (c *Core) GetConsensusEventsCount() int
- func (c *Core) GetConsensusTransactions() ([][]byte, error)
- func (c *Core) GetConsensusTransactionsCount() int
- func (c *Core) GetEvent(hash string) (hg.Event, error)
- func (c *Core) GetEventTransactions(hash string) ([][]byte, error)
- func (c *Core) GetHead() (hg.Event, error)
- func (c *Core) GetLastBlockIndex() int
- func (c *Core) GetLastCommitedRoundEventsCount() int
- func (c *Core) GetLastConsensusRoundIndex() *int
- func (c *Core) GetPendingLoadedEvents() int
- func (c *Core) GetUndeterminedEvents() []string
- func (c *Core) HexID() string
- func (c *Core) ID() int
- func (c *Core) InsertEvent(event hg.Event, setWireInfo bool) error
- func (c *Core) KnownEvents() map[int]int
- func (c *Core) NeedGossip() bool
- func (c *Core) OverSyncLimit(knownEvents map[int]int, syncLimit int) bool
- func (c *Core) PubKey() []byte
- func (c *Core) RunConsensus() error
- func (c *Core) SetHeadAndSeq() error
- func (c *Core) SignAndInsertSelfEvent(event hg.Event) error
- func (c *Core) SignBlock(block hg.Block) (hg.BlockSignature, error)
- func (c *Core) Sync(unknownEvents []hg.WireEvent) error
- func (c *Core) ToWire(events []hg.Event) ([]hg.WireEvent, error)
- type Node
- type NodeState
- type PeerSelector
- type RandomPeerSelector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
HeartbeatTimeout time.Duration
TCPTimeout time.Duration
CacheSize int
SyncLimit int
StoreType string
StorePath string
Logger *logrus.Logger
}
func DefaultConfig ¶
func DefaultConfig() *Config
func TestConfig ¶
type ControlTimer ¶
type ControlTimer struct {
// contains filtered or unexported fields
}
func NewControlTimer ¶
func NewControlTimer(timerFactory timerFactory) *ControlTimer
func NewRandomControlTimer ¶
func NewRandomControlTimer(base time.Duration) *ControlTimer
func (*ControlTimer) Run ¶
func (c *ControlTimer) Run()
func (*ControlTimer) Shutdown ¶
func (c *ControlTimer) Shutdown()
type Core ¶
func (*Core) AddBlockSignature ¶
func (c *Core) AddBlockSignature(bs hg.BlockSignature)
func (*Core) AddSelfEvent ¶
func (*Core) AddTransactions ¶
func (*Core) FastForward ¶
func (*Core) GetAnchorBlockWithFrame ¶
func (*Core) GetConsensusEvents ¶
func (*Core) GetConsensusEventsCount ¶
func (*Core) GetConsensusTransactions ¶
func (*Core) GetConsensusTransactionsCount ¶
func (*Core) GetEventTransactions ¶
func (*Core) GetLastBlockIndex ¶
func (*Core) GetLastCommitedRoundEventsCount ¶
func (*Core) GetLastConsensusRoundIndex ¶
func (*Core) GetPendingLoadedEvents ¶
func (*Core) GetUndeterminedEvents ¶
func (*Core) KnownEvents ¶
func (*Core) NeedGossip ¶
func (*Core) OverSyncLimit ¶
func (*Core) RunConsensus ¶
func (*Core) SetHeadAndSeq ¶
type NodeState ¶
type NodeState uint32
NodeState captures the state of a Babble node: Babbling, CatchingUp or Shutdown
type PeerSelector ¶
type RandomPeerSelector ¶
type RandomPeerSelector struct {
// contains filtered or unexported fields
}
func NewRandomPeerSelector ¶
func NewRandomPeerSelector(participants []net.Peer, localAddr string) *RandomPeerSelector
func (*RandomPeerSelector) Next ¶
func (ps *RandomPeerSelector) Next() net.Peer
func (*RandomPeerSelector) Peers ¶
func (ps *RandomPeerSelector) Peers() []net.Peer
func (*RandomPeerSelector) UpdateLast ¶
func (ps *RandomPeerSelector) UpdateLast(peer string)
Click to show internal directories.
Click to hide internal directories.