Documentation ¶
Index ¶
Constants ¶
View Source
const ( INIT = 0 HAND = 1 HANDSHAKE = 2 HANDSHAKED = 3 ESTABLISH = 4 INACTIVITY = 5 )
node connection state
Variables ¶
View Source
var SyncStateString = []string{"SyncStarted", "SyncFinished", "PersistFinished"}
SyncStateString is the string of SyncState enum
Functions ¶
This section is empty.
Types ¶
type Noder ¶
type Noder interface { Version() uint32 GetID() uint64 GetAddr() string GetPort() uint16 GetAddrStr() string GetAddr16() ([16]byte, error) GetHttpJsonPort() uint16 //TODO SetHttpJsonPort(uint16) GetWsPort() uint16 //TODO SetWsPort(uint16) GetSyncState() SyncState SetSyncState(s SyncState) SetSyncStopHash(hash Uint256, height uint32) SyncBlock(bool) SyncBlockMonitor(bool) StopSyncBlock(bool) GetPubKey() *crypto.PubKey LocalNode() Noder DelNbrNode(id uint64) (Noder, bool) AddNbrNode(Noder) CloseConn() GetHeight() uint32 GetConnectionCnt() uint GetTxnByCount(int, Uint256) (map[Uint256]*transaction.Transaction, error) GetTxnPool() *pool.TxnPool AppendTxnPool(*transaction.Transaction) ErrCode ExistHash(hash Uint256) bool DumpInfo() Tx(buf []byte) GetTime() int64 GetEvent(eventName string) *events.Event GetNeighborAddrs() ([]NodeAddr, uint) GetTransaction(hash Uint256) *transaction.Transaction IncRxTxnCnt() GetTxnCnt() uint64 GetRxTxnCnt() uint64 Xmit(interface{}) error Broadcast([]byte) error GetNeighborHeights() ([]uint32, uint) CleanSubmittedTransactions(txns []*transaction.Transaction) error GetNeighborNoder() []Noder GetSyncFinishedNeighbors() []Noder StoreFlightHeight(height uint32) GetFlightHeightCnt() int RemoveFlightHeightLessThan(height uint32) RemoveFlightHeight(height uint32) SetHeight(height uint32) WaitForSyncBlkFinish() GetFlightHeights() []uint32 GetChordAddr() []byte StartRelayer(wallet vault.Wallet) SendRelayPacket(srcAddr, destAddr string, payload, signature []byte, maxHoldingSeconds uint32) error SendRelayPacketsInBuffer(clientId []byte) error GetWsAddr() string FindWsAddr([]byte) (string, error) FindSuccessorAddrs([]byte, int) ([]string, error) }
Click to show internal directories.
Click to hide internal directories.