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 Services() uint64 GetAddr() string GetPort() uint16 GetAddrStr() string GetAddr16() ([16]byte, error) GetHttpInfoPort() uint16 SetHttpInfoPort(uint16) GetHttpJsonPort() uint16 //TODO SetHttpJsonPort(uint16) GetWebSockPort() uint16 //TODO SetWebSockPort(uint16) GetChordPort() uint16 //TODO SetChordPort(uint16) GetHttpInfoState() bool SetHttpInfoState(bool) GetState() uint32 SetState(state uint32) GetSyncState() SyncState SetSyncState(s SyncState) SetSyncStopHash(hash Uint256, height uint32) SyncBlock(bool) SyncBlockMonitor(bool) StopSyncBlock(bool) GetRelay() bool GetPubKey() *crypto.PubKey CompareAndSetState(old, new uint32) bool UpdateRXTime(t time.Time) LocalNode() Noder DelNbrNode(id uint64) (Noder, bool) AddNbrNode(Noder) GetConn() net.Conn 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() UpdateInfo(t time.Time, version uint32, services uint64, port uint16, nonce uint64, relay uint8, height uint32) ConnectNeighbors() Connect(nodeAddr string) error Tx(buf []byte) GetTime() int64 NodeEstablished(uid uint64) bool GetEvent(eventName string) *events.Event GetNeighborAddrs() ([]NodeAddr, uint) GetTransaction(hash Uint256) *transaction.Transaction IncRxTxnCnt() GetTxnCnt() uint64 GetRxTxnCnt() uint64 Xmit(interface{}) error BroadcastTransaction(from Noder, txn *transaction.Transaction) error GetBookKeeperAddr() *crypto.PubKey GetBookKeepersAddrs() ([]*crypto.PubKey, uint64) SetBookKeeperAddr(pk *crypto.PubKey) GetNeighborHeights() ([]uint32, uint) CleanSubmittedTransactions(txns []*transaction.Transaction) error GetNeighborNoder() []Noder GetSyncFinishedNeighbors() []Noder GetNbrNodeCnt() uint32 StoreFlightHeight(height uint32) GetFlightHeightCnt() int RemoveFlightHeightLessThan(height uint32) RemoveFlightHeight(height uint32) GetLastRXTime() time.Time SetHeight(height uint32) WaitForSyncBlkFinish() GetFlightHeights() []uint32 IsAddrInNeighbors(addr string) bool IsChordAddrInNeighbors(chordAddr []byte) bool ShouldChordAddrInNeighbors(addr []byte) (bool, error) SetAddrInConnectingList(addr string) bool RemoveAddrInConnectingList(addr string) AddInRetryList(addr string) RemoveFromRetryList(addr string) AcquireMsgHandlerChan() ReleaseMsgHandlerChan() AcquireHeaderReqChan() ReleaseHeaderReqChan() GetChordAddr() []byte SetChordAddr([]byte) GetChordRing() *chord.Ring StartRelayer(wallet vault.Wallet) NextHop(key []byte) (Noder, error) SendRelayPacket(srcAddr, destAddr string, payload, signature []byte) error SendRelayPacketsInBuffer(clientId []byte) error }
Click to show internal directories.
Click to hide internal directories.