Versions in this module Expand all Collapse all v1 v1.1.0 Mar 19, 2024 Changes in this version + const BlockGossipTopic + const NetworkRendezvous + const ProtocolId + const TxGossipTopic + const TxProtocolId + func GetLogicClock() int64 + type BlockSyncer struct + func NewBlockSyncer(config *BlockSyncerConfig) *BlockSyncer + func (bs *BlockSyncer) AddPeer(p *Peer) + func (bs *BlockSyncer) Start() + type BlockSyncerConfig struct + Chain *core.BlockChain + type P2PManager struct + func GetP2PManager() *P2PManager + func NewP2PManager(config *P2PManagerConfig) (*P2PManager, error) + func (pm *P2PManager) AddTransaction(tx *common.Transaction) + func (pm *P2PManager) CheckAndCreateStream(ctx context.Context, h host.Host, p peer.AddrInfo) + func (pm *P2PManager) Discover(ctx context.Context, h host.Host, dht *dht.IpfsDHT, rendezvous string) + func (pm *P2PManager) GetBlockChain() *core.BlockChain + func (pm *P2PManager) GetConnectNodeInfo() (string, []string) + func (pm *P2PManager) HandleStream(s network.Stream) + func (pm *P2PManager) NewPeer(peerId peer.ID, s *network.Stream, remoteAddr string) (*Peer, error) + func (pm *P2PManager) SetSynced() + func (pm *P2PManager) StatusMessage() *p2p.SyncStatusMsg + func (pm *P2PManager) Synced() bool + func (pm *P2PManager) TransactionUDP() + func (pm *P2PManager) UDPGossipBroadcast(tx *common.Transaction) + type P2PManagerConfig struct + Chain *core.BlockChain + Genesis bool + InitialDelta int64 + TxPool *core.TxPool + type Peer struct + func NewPeer(peerId peer.ID, s *network.Stream, config PeerConfig) (*Peer, error) + func (p *Peer) AsyncSendNewBlock(block *common.Block) + func (p *Peer) AsyncSendNewBlockHash(blockHash common.Hash) + func (p *Peer) AsyncSendTransaction(tx *common.Transaction) + func (p *Peer) AsyncSendTxHash(txHash common.Hash) + func (p *Peer) Handle() + func (p *Peer) KnownBlock(blockHash string) bool + func (p *Peer) KnownTransaction(txHash string) bool + func (p *Peer) MarkBlock(blockHash string) + func (p *Peer) MarkSynced() bool + func (p *Peer) MarkTransaction(txHash string) + func (p *Peer) SetMarkSynced(v bool) + func (p *Peer) Stopped() bool + type PeerConfig struct + type SyncStatus int8 + const CONFIRMING + const INITIAL + const SYNCED + type TimeSyncer struct + func NewTimeSyncer(genesis bool, delta int64) *TimeSyncer + func (ts *TimeSyncer) GetLogicClock() int64 + func (ts *TimeSyncer) ProcessSyncRequest(msg *p2p.TimeSyncMsg, p *Peer) + func (ts *TimeSyncer) ProcessSyncRespond(msg *p2p.TimeSyncMsg, p *Peer) + func (ts *TimeSyncer) Start()