handshake

package
v0.10.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PROTOCOL_NAME = "handshake"
	PROTOCOL_ID   = 0

	DIFFUSION_MODE_INITIATOR_ONLY          = true
	DIFFUSION_MODE_INITIATOR_AND_RESPONDER = false
)
View Source
const (
	MESSAGE_TYPE_PROPOSE_VERSIONS = 0
	MESSAGE_TYPE_ACCEPT_VERSION   = 1
	MESSAGE_TYPE_REFUSE           = 2

	REFUSE_REASON_VERSION_MISMATCH = 0
	REFUSE_REASON_DECODE_ERROR     = 1
	REFUSE_REASON_REFUSED          = 2
)

Variables

View Source
var (
	STATE_PROPOSE = protocol.NewState(1, "Propose")
	STATE_CONFIRM = protocol.NewState(2, "Confirm")
	STATE_DONE    = protocol.NewState(3, "Done")
)

Functions

func NewMsgFromCbor added in v0.5.0

func NewMsgFromCbor(msgType uint, data []byte) (protocol.Message, error)

Types

type Handshake

type Handshake struct {
	Version  uint16
	Finished chan bool
	// contains filtered or unexported fields
}

func New

func New(options protocol.ProtocolOptions, allowedVersions []uint16) *Handshake

func (*Handshake) ProposeVersions added in v0.4.0

func (h *Handshake) ProposeVersions(versions []uint16, networkMagic uint32) error

type MsgAcceptVersion added in v0.10.0

type MsgAcceptVersion struct {
	protocol.MessageBase
	Version     uint16
	VersionData interface{}
}

func NewMsgAcceptVersion added in v0.10.0

func NewMsgAcceptVersion(version uint16, versionData interface{}) *MsgAcceptVersion

type MsgProposeVersions added in v0.10.0

type MsgProposeVersions struct {
	protocol.MessageBase
	VersionMap map[uint16]interface{}
}

func NewMsgProposeVersions added in v0.10.0

func NewMsgProposeVersions(versionMap map[uint16]interface{}) *MsgProposeVersions

type MsgRefuse added in v0.10.0

type MsgRefuse struct {
	protocol.MessageBase
	Reason []interface{}
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL