Documentation
¶
Index ¶
- type GetBlocks
- type GetData
- type InvType
- type InvVect
- type ProtocolManager
- func (pm *ProtocolManager) OnBlock(m p2p.Msg, peer *p2p.Peer)
- func (pm *ProtocolManager) OnConsensus(m p2p.Msg, peer *p2p.Peer)
- func (pm *ProtocolManager) OnGetBlocks(m p2p.Msg, peer *p2p.Peer)
- func (pm *ProtocolManager) OnGetData(m p2p.Msg, peer *p2p.Peer)
- func (pm *ProtocolManager) OnInv(m p2p.Msg, peer *p2p.Peer)
- func (pm *ProtocolManager) OnStatus(m p2p.Msg, p *p2p.Peer)
- func (pm *ProtocolManager) OnTx(m p2p.Msg, p *p2p.Peer)
- func (pm *ProtocolManager) Relay(inv types.IInventory)
- func (pm *ProtocolManager) SendMsgnetMessage(src, dst string, msg msgnet.Message) bool
- func (pm ProtocolManager) Sign(data []byte) (*crypto.Signature, error)
- func (pm *ProtocolManager) Start()
- type StatusData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetBlocks ¶
type GetBlocks struct {
Version uint32
//TODO: blockchain support locator
LocatorHashes []crypto.Hash
HashStop crypto.Hash
}
GetBlocks represents a getblocks message
type ProtocolManager ¶
type ProtocolManager struct {
*blockchain.Blockchain
*ledger.Ledger
*keystore.KeyStore
*p2p.Server
// contains filtered or unexported fields
}
ProtocolManager manages the protocol
func NewProtocolManager ¶
func NewProtocolManager(db *db.BlockchainDB, netConfig *p2p.Config, blockchain *blockchain.Blockchain, consenter consensus.Consenter, ledger *ledger.Ledger, ks *keystore.KeyStore, mergeConfig *merge.Config, logDir string) *ProtocolManager
NewProtocolManager returns a new sub protocol manager.
func (*ProtocolManager) OnConsensus ¶
func (pm *ProtocolManager) OnConsensus(m p2p.Msg, peer *p2p.Peer)
OnConsensus processes consensus message
func (*ProtocolManager) OnGetBlocks ¶
func (pm *ProtocolManager) OnGetBlocks(m p2p.Msg, peer *p2p.Peer)
OnGetBlocks processes getblocks message
func (*ProtocolManager) OnGetData ¶
func (pm *ProtocolManager) OnGetData(m p2p.Msg, peer *p2p.Peer)
OnGetData processes getdata message
func (*ProtocolManager) OnInv ¶
func (pm *ProtocolManager) OnInv(m p2p.Msg, peer *p2p.Peer)
OnInv processes inventory message
func (*ProtocolManager) OnStatus ¶
func (pm *ProtocolManager) OnStatus(m p2p.Msg, p *p2p.Peer)
OnStatus handles statusMsg
func (*ProtocolManager) OnTx ¶
func (pm *ProtocolManager) OnTx(m p2p.Msg, p *p2p.Peer)
OnTx processes tx message
func (*ProtocolManager) Relay ¶
func (pm *ProtocolManager) Relay(inv types.IInventory)
Relay relays inventory to remote peers
func (*ProtocolManager) SendMsgnetMessage ¶
func (pm *ProtocolManager) SendMsgnetMessage(src, dst string, msg msgnet.Message) bool
SendMsgnetMessage sends message to msg-net
type StatusData ¶
StatusData represents a status message
Click to show internal directories.
Click to hide internal directories.