network

package
v0.0.0-...-4cd1fa5 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FullNode

type FullNode struct {
	// contains filtered or unexported fields
}

FullNode represents a full-node in the network

func NewFullNode

func NewFullNode(conf *FullNodeConfig) *FullNode

NewFullNode returns a new full-node configured as specified

func (*FullNode) GetShare

func (fn *FullNode) GetShare(rq *ShareRequest) bool

GetShare returns a boolean that represent that the shared was returned

type FullNodeConfig

type FullNodeConfig struct {
	K int
}

Config represents configurations for the full-node

type LightNode

type LightNode struct {
	// contains filtered or unexported fields
}

LightNode represents a light-node in the network

func NewLightNode

func NewLightNode(r *rand.Rand, config *LightNodeConfig) *LightNode

NewLightNode returns a fresh light-node

func (*LightNode) AskForNextShare

func (ln *LightNode) AskForNextShare() (bool, bool)

func (*LightNode) Connect

func (ln *LightNode) Connect(fn *FullNode) error

Connect the light-node to a full-node

func (*LightNode) Run

func (ln *LightNode) Run() (bool, bool)

Run ask for a set of shares to the full-node

type LightNodeConfig

type LightNodeConfig struct {
	K int
	S int
}

LightNodeConfig represents configuration of the light-node

type ShareRequest

type ShareRequest struct {
	X int
	Y int
}

ShareRequest ask for the share in (x,y)

Jump to

Keyboard shortcuts

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