Documentation ¶
Overview ¶
Package handshake implements the Ouroboros handshake protocol
Index ¶
Constants ¶
View Source
const ( MessageTypeDone = 2 )
Message types
View Source
const ( ProtocolName = "peer-sharing" ProtocolId = 10 )
Protocol identifiers
Variables ¶
View Source
var StateMap = protocol.StateMap{ // contains filtered or unexported fields }
PeerSharing protocol state machine
Functions ¶
Types ¶
type Client ¶
Client implements the PeerSharing client
type Config ¶
Config is used to configure the PeerSharing protocol instance
func NewConfig ¶
func NewConfig(options ...PeerSharingOptionFunc) Config
NewConfig returns a new PeerSharing config object with the provided options
type MsgDone ¶
type MsgDone struct {
protocol.MessageBase
}
func NewMsgDone ¶
func NewMsgDone() *MsgDone
type MsgSharePeers ¶
type MsgSharePeers struct { /* peerAddress = [0, word32, portNumber] ; ipv6 + portNumber / [1, word32, word32, word32, word32, flowInfo, scopeId, portNumber] portNumber = word16 flowInfo = word32 scopeId = word32 */ PeerAddresses []interface{} }
func NewMsgSharePeers ¶
func NewMsgSharePeers(peerAddresses []interface{}) *MsgSharePeers
type MsgShareRequest ¶
type MsgShareRequest struct {}
func NewMsgShareRequest ¶
func NewMsgShareRequest(amount uint8) *MsgShareRequest
type PeerSharing ¶
PeerSharing is a wrapper object that holds the client and server instances
func New ¶
func New(protoOptions protocol.ProtocolOptions, cfg *Config) *PeerSharing
New returns a new PeerSharing object
type PeerSharingOptionFunc ¶
type PeerSharingOptionFunc func(*Config)
PeerSharingOptionFunc represents a function used to modify the PeerSharing protocol config
func WithTimeout ¶
func WithTimeout(timeout time.Duration) PeerSharingOptionFunc
WithTimeout specifies the timeout for the handshake operation
Click to show internal directories.
Click to hide internal directories.