ng

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blocks

type Blocks []interface{}

func NewBlocksFromBlock

func NewBlocksFromBlock(block *proto.Block) Blocks

func (Blocks) AddBlock

func (a Blocks) AddBlock(block *proto.Block) (Blocks, error)

func (Blocks) AddMicro

func (a Blocks) AddMicro(micro *proto.MicroBlock) (Blocks, error)

func (Blocks) Len

func (a Blocks) Len() int

func (Blocks) Row

func (a Blocks) Row() (row, error)

type InvCache

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

func NewInvCache

func NewInvCache(cacheSize int) *InvCache

func (*InvCache) AddInv

func (a *InvCache) AddInv(inv *proto.MicroBlockInv)

func (*InvCache) Inv

type MicroblockCache

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

func NewMicroblockCache

func NewMicroblockCache(cacheSize int) *MicroblockCache

func (*MicroblockCache) AddMicroBlock

func (a *MicroblockCache) AddMicroBlock(microBlock *proto.MicroBlock)

func (MicroblockCache) MicroBlock

type NotifyNewMicroblock

type NotifyNewMicroblock interface {
	AddMicroblock(*proto.MicroBlock)
}

type Runtime

type Runtime interface {
	MinedMicroblock(block *proto.MicroBlock, inv *proto.MicroBlockInv)
}

type RuntimeImpl

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

func NewRuntime

func NewRuntime(services services.Services, ngState *State) *RuntimeImpl

func (*RuntimeImpl) HandleBlockMessage

func (a *RuntimeImpl) HandleBlockMessage(_ peer.Peer, block *proto.Block)

func (*RuntimeImpl) HandleInvMessage

func (a *RuntimeImpl) HandleInvMessage(p peer.Peer, mess *proto.MicroBlockInvMessage)

func (*RuntimeImpl) HandleMicroBlockMessage

func (a *RuntimeImpl) HandleMicroBlockMessage(_ peer.Peer, message *proto.MicroBlockMessage)

func (*RuntimeImpl) HandleMicroBlockRequestMessage

func (a *RuntimeImpl) HandleMicroBlockRequestMessage(p peer.Peer, message *proto.MicroBlockRequestMessage)

func (*RuntimeImpl) MinedMicroblock

func (a *RuntimeImpl) MinedMicroblock(block *proto.MicroBlock, inv *proto.MicroBlockInv)

type State

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

func NewState

func NewState(services services.Services) *State

func (*State) AddBlock

func (a *State) AddBlock(block *proto.Block)

func (*State) AddMicroblock

func (a *State) AddMicroblock(micro *proto.MicroBlock)

func (*State) BlockApplied

func (a *State) BlockApplied()

Jump to

Keyboard shortcuts

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