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) SetOnBlockAddedToDAGHandler(onBlockAddedToDAGHandler flowcontext.OnBlockAddedToDAGHandler)
- func (m *Manager) SetOnNewBlockTemplateHandler(onNewBlockTemplateHandler flowcontext.OnNewBlockTemplateHandler)
- func (m *Manager) SetOnPruningPointUTXOSetOverrideHandler(...)
- func (m *Manager) SetOnTransactionAddedToMempoolHandler(...)
- func (m *Manager) SetOnVirtualChange(onVirtualChangeHandler flowcontext.OnVirtualChangeHandler)
- func (m *Manager) ShouldMine() (bool, error)
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 ¶ added in v0.10.0
func (m *Manager) Close()
Close closes the protocol manager and waits until all p2p flows finish.
func (*Manager) Context ¶ added in v0.11.10
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 ¶ added in v0.11.10
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 ¶ added in v0.11.10
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 ¶ added in v0.11.10
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) SetOnBlockAddedToDAGHandler ¶
func (m *Manager) SetOnBlockAddedToDAGHandler(onBlockAddedToDAGHandler flowcontext.OnBlockAddedToDAGHandler)
SetOnBlockAddedToDAGHandler sets the onBlockAddedToDAG handler
func (*Manager) SetOnNewBlockTemplateHandler ¶ added in v0.11.15
func (m *Manager) SetOnNewBlockTemplateHandler(onNewBlockTemplateHandler flowcontext.OnNewBlockTemplateHandler)
SetOnNewBlockTemplateHandler sets the onNewBlockTemplate handler
func (*Manager) SetOnPruningPointUTXOSetOverrideHandler ¶ added in v0.8.10
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
func (*Manager) SetOnVirtualChange ¶ added in v0.11.7
func (m *Manager) SetOnVirtualChange(onVirtualChangeHandler flowcontext.OnVirtualChangeHandler)
SetOnVirtualChange sets the onVirtualChangeHandler handler
func (*Manager) ShouldMine ¶
ShouldMine returns whether it's ok to use block template from this node for mining purposes.