Documentation ¶
Index ¶
Constants ¶
View Source
const ( // PingSignal represents a ping signal to a peer PingSignal = byte(0x0) // PongSignal represents a pong respond to a peer PongSignal = byte(0x1) )
Variables ¶
This section is empty.
Functions ¶
func GetTestListener ¶
GetTestListener returns a net.Listener instance
func GetTestNetconn ¶
GetTestNetconn returns a net.Conn instance
func GetTestRandPubKey ¶
GetTestRandPubKey returns a randomly generated public key
Types ¶
type Message ¶
type Message struct { PeerID string ChannelID common.ChannelIDEnum Content interface{} }
Message models the message sent/received through the P2P network
type NodeInfo ¶
type NodeInfo struct { PrivKey *crypto.PrivateKey `rlp:"-"` PubKey *crypto.PublicKey `rlp:"-"` PubKeyBytes common.Bytes // needed for RLP serialization Port uint16 }
NodeInfo provides the information of the corresponding blockchain node of the peer
func CreateLocalNodeInfo ¶
func CreateLocalNodeInfo(privateKey *crypto.PrivateKey, port uint16) NodeInfo
CreateLocalNodeInfo creates an instance of NodeInfo
type StackError ¶
type StackError struct { Err interface{} Stack []byte }
func (StackError) Error ¶
func (se StackError) Error() string
func (StackError) String ¶
func (se StackError) String() string
Click to show internal directories.
Click to hide internal directories.