protocol

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NodeVer = &Version{
	Major: 0,
	Minor: 3,
	Patch: 0,
}

NodeVer is the current node version.

Functions

This section is empty.

Types

type Magic

type Magic uint8

Magic is the network that Dusk is running on

const (
	// MainNet identifies the production network of the Dusk blockchain
	MainNet Magic = iota
	// TestNet identifies the test network of the Dusk blockchain
	TestNet
	// DevNet identifies the development network of the Dusk blockchain
	DevNet
)

func Extract added in v0.2.0

func Extract(r io.Reader) (Magic, error)

Extract the magic from io.Reader. In case of unknown Magic, it returns DevNet

func MagicFromConfig

func MagicFromConfig() Magic

MagicFromConfig reads the loaded magic config and tries to map it to magic identifier. Panic, if no match found.

func (Magic) Len added in v0.2.0

func (m Magic) Len() int

Len returns the amount of bytes of the Magic sequence

func (Magic) String added in v0.2.0

func (m Magic) String() string

String representation of Magic

func (Magic) ToBuffer added in v0.2.0

func (m Magic) ToBuffer() bytes.Buffer

ToBuffer returns the buffer representation of the Magic

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
)

type Version

type Version struct {
	Major uint8
	Minor uint8
	Patch uint16
}

Version is a struct that separates version fields.

func (*Version) Decode

func (v *Version) Decode(r *bytes.Buffer) error

Decode will Decodde a Version struct from r.

func (*Version) Encode

func (v *Version) Encode(w *bytes.Buffer) error

Encode will encode a Version struct to w.

func (Version) String

func (v Version) String() string

Jump to

Keyboard shortcuts

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