Documentation
¶
Overview ¶
nolint
Index ¶
Constants ¶
const ( // MaxFrameSize is set at 1375000 bytes. MaxFrameSize = uint64(1375000) // VersionLength is number of bytes the version uses. VersionLength = uint64(8) )
const VersionConstraintString = "~0.1.0"
VersionConstraintString represent the needed version.
Variables ¶
var CurrentProtocolVersion = semver.MustParse("0.1.0")
CurrentProtocolVersion indicates the protocol version used.
var NodeVer = &Version{
Major: 0,
Minor: 4,
Patch: 3,
}
NodeVer is the current node version. This is used only in the handshake, need to be removed.
var VersionConstraint, _ = semver.NewConstraint(VersionConstraintString)
VersionConstraint check incoming versions.
Functions ¶
func ExtractVersion ¶ added in v0.5.0
ExtractVersion extracts the version from io.Reader.
func ReadFrame ¶ added in v0.4.0
ReadFrame extract the bytes representing the size of the packet and thus read the amount of bytes specified by such prefix in little endianness.
func VersionAsBuffer ¶ added in v0.5.0
VersionAsBuffer returns protocol version encoded as BytesBuffer.
Types ¶
type Gossip ¶ added in v0.4.0
type Gossip struct { }
Gossip is a preprocessor/reader for gossip messages.
func NewGossip ¶ added in v0.4.0
func NewGossip() *Gossip
NewGossip returns a gossip preprocessor with the specified magic.
func (*Gossip) Process ¶ added in v0.4.0
Process a message that is passing through, by prepending magic and the message checksum, and finally by prepending the length.
func (*Gossip) ReadFrame ¶ added in v0.4.0
ReadFrame extract message from gossip frame, if no errors found.
func (*Gossip) ReadMessage ¶ added in v0.4.0
ReadMessage reads from the connection. TODO: Replace ReadMessage with ReadFrame.
type ServiceFlag ¶
type ServiceFlag uint64
ServiceFlag indicates the services provided by the Node.
const ( // FullNode indicates that a user is running the full node implementation of Dusk. FullNode ServiceFlag = 1 // VoucherNode indicates that a user is running a voucher seeder. VoucherNode ServiceFlag = 3 )