reactor

package
v0.9.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// BHMsgChannel id
	BHMsgChannel = byte(0x70)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BHReactor

type BHReactor struct {
	p2p.BaseReactor // BaseService + p2p.Switch
	// contains filtered or unexported fields
}

BHReactor defines a reactor for the key manager service.

func NewBHReactor

func NewBHReactor(logger log.Logger) *BHReactor

NewBHReactor returns a new BHReactor.

func (*BHReactor) AddPeer

func (bhR *BHReactor) AddPeer(peer p2p.Peer)

AddPeer implements Reactor

func (*BHReactor) Communicate

func (bhR *BHReactor) Communicate(stream pb.P2PService_CommunicateServer) error

func (*BHReactor) GetChannels

func (bhR *BHReactor) GetChannels() []*p2p.ChannelDescriptor

GetChannels implements Reactor

func (*BHReactor) OnStart

func (bhR *BHReactor) OnStart() error

OnStart implements BaseService by subscribing to events, which later will be broadcasted to other peers and starting state if we're not in fast sync.

func (*BHReactor) OnStop

func (bhR *BHReactor) OnStop()

OnStop implements BaseService by unsubscribing from events and stopping state.

func (*BHReactor) Receive

func (bhR *BHReactor) Receive(chID byte, src p2p.Peer, msgBytes []byte)

Receive implements Reactor NOTE: We process these messages even when we're fast_syncing. Messages affect either a peer state or the consensus state. Peer state updates can happen in parallel, but processing of proposals, block parts, and votes are ordered by the receiveRoutine NOTE: blocks on consensus state for proposals, block parts, and votes

func (*BHReactor) RemovePeer

func (bhR *BHReactor) RemovePeer(peer p2p.Peer, reason interface{})

RemovePeer implements Reactor

type Hash

type Hash [32]byte

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL