Documentation ¶
Index ¶
- type Manager
- func (m *Manager) AddBlock(block *externalapi.DomainBlock) error
- func (m *Manager) AddTransaction(tx *externalapi.DomainTransaction, allowOrphan bool) error
- func (m *Manager) Close()
- func (m *Manager) Context() *flowcontext.FlowContext
- func (m *Manager) IBDPeer() *peerpkg.Peer
- func (m *Manager) IsIBDRunning() bool
- func (m *Manager) Peers() []*peerpkg.Peer
- func (m *Manager) RegisterFlow(name string, router *routerpkg.Router, ...) *common.Flow
- func (m *Manager) RegisterFlowWithCapacity(name string, capacity int, router *routerpkg.Router, ...) *common.Flow
- func (m *Manager) RegisterOneTimeFlow(name string, router *routerpkg.Router, ...) *common.Flow
- func (m *Manager) SetOnNewBlockTemplateHandler(onNewBlockTemplateHandler flowcontext.OnNewBlockTemplateHandler)
- func (m *Manager) SetOnPruningPointUTXOSetOverrideHandler(...)
- func (m *Manager) SetOnTransactionAddedToMempoolHandler(...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages the p2p protocol
func NewManager ¶
func NewManager(cfg *config.Config, domain domain.Domain, netAdapter *netadapter.NetAdapter, addressManager *addressmanager.AddressManager, connectionManager *connmanager.ConnectionManager) (*Manager, error)
NewManager creates a new instance of the p2p protocol manager
func (*Manager) AddBlock ¶
func (m *Manager) AddBlock(block *externalapi.DomainBlock) error
AddBlock adds the given block to the DAG and propagates it.
func (*Manager) AddTransaction ¶
func (m *Manager) AddTransaction(tx *externalapi.DomainTransaction, allowOrphan bool) error
AddTransaction adds transaction to the mempool and propagates it.
func (*Manager) Close ¶
func (m *Manager) Close()
Close closes the protocol manager and waits until all p2p flows finish.
func (*Manager) Context ¶
func (m *Manager) Context() *flowcontext.FlowContext
Context returns the manager's flow context
func (*Manager) IsIBDRunning ¶
IsIBDRunning returns true if IBD is currently marked as running
func (*Manager) RegisterFlow ¶
func (m *Manager) RegisterFlow(name string, router *routerpkg.Router, messageTypes []appmessage.MessageCommand, isStopping *uint32, errChan chan error, initializeFunc common.FlowInitializeFunc) *common.Flow
RegisterFlow registers a flow to the given router.
func (*Manager) RegisterFlowWithCapacity ¶
func (m *Manager) RegisterFlowWithCapacity(name string, capacity int, router *routerpkg.Router, messageTypes []appmessage.MessageCommand, isStopping *uint32, errChan chan error, initializeFunc common.FlowInitializeFunc) *common.Flow
RegisterFlowWithCapacity registers a flow to the given router with a custom capacity.
func (*Manager) RegisterOneTimeFlow ¶
func (m *Manager) RegisterOneTimeFlow(name string, router *routerpkg.Router, messageTypes []appmessage.MessageCommand, isStopping *uint32, stopChan chan error, initializeFunc common.FlowInitializeFunc) *common.Flow
RegisterOneTimeFlow registers a one-time flow (that exits once some operations are done) to the given router.
func (*Manager) SetOnNewBlockTemplateHandler ¶
func (m *Manager) SetOnNewBlockTemplateHandler(onNewBlockTemplateHandler flowcontext.OnNewBlockTemplateHandler)
SetOnNewBlockTemplateHandler sets the onNewBlockTemplate handler
func (*Manager) SetOnPruningPointUTXOSetOverrideHandler ¶
func (m *Manager) SetOnPruningPointUTXOSetOverrideHandler(onPruningPointUTXOSetOverrideHandler flowcontext.OnPruningPointUTXOSetOverrideHandler)
SetOnPruningPointUTXOSetOverrideHandler sets the OnPruningPointUTXOSetOverride handler
func (*Manager) SetOnTransactionAddedToMempoolHandler ¶
func (m *Manager) SetOnTransactionAddedToMempoolHandler(onTransactionAddedToMempoolHandler flowcontext.OnTransactionAddedToMempoolHandler)
SetOnTransactionAddedToMempoolHandler sets the onTransactionAddedToMempool handler