ng

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2020 License: MIT Imports: 10 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) ContainsID added in v0.5.0

func (a Blocks) ContainsID(blockID proto.BlockID) bool

func (Blocks) Len

func (a Blocks) Len() int

func (Blocks) PreviousRow added in v0.5.0

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

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

func (a *InvCache) Inv(id proto.BlockID) (*proto.MicroBlockInv, bool)

type InvRequesterImpl added in v0.5.0

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

func NewInvRequester added in v0.5.0

func NewInvRequester() *InvRequesterImpl

func (*InvRequesterImpl) Request added in v0.5.0

func (a *InvRequesterImpl) Request(p types.MessageSender, id proto.BlockID)

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

func (a MicroblockCache) MicroBlock(id proto.BlockID) (*proto.MicroBlock, bool)

type NotifyNewMicroblock

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

type Row added in v0.5.0

type Row struct {
	KeyBlock    *proto.Block
	MicroBlocks []*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) HandlePBMicroBlockMessage added in v0.5.0

func (a *RuntimeImpl) HandlePBMicroBlockMessage(_ peer.Peer, message *proto.PBMicroBlockMessage)

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