node

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockAction added in v0.6.0

func BlockAction(services services.Services, mess peer.ProtoMessage, fsm state_fsm.FSM) (state_fsm.FSM, state_fsm.Async, error)

func BlockIdsAction added in v0.6.0

func BlockIdsAction(_ services.Services, mess peer.ProtoMessage, fsm state_fsm.FSM) (state_fsm.FSM, state_fsm.Async, error)

func CreateActions added in v0.6.0

func CreateActions() map[reflect.Type]Action

func GetBlockAction added in v0.6.0

func GetBlockAction(services services.Services, mess peer.ProtoMessage, fsm state_fsm.FSM) (state_fsm.FSM, state_fsm.Async, error)

func GetBlockIdsAction added in v0.6.0

func GetBlockIdsAction(services services.Services, mess peer.ProtoMessage, fsm state_fsm.FSM) (state_fsm.FSM, state_fsm.Async, error)

func GetPeersAction added in v0.6.0

func GetPeersAction(services services.Services, mess peer.ProtoMessage, fsm state_fsm.FSM) (state_fsm.FSM, state_fsm.Async, error)

func GetSignaturesAction added in v0.6.0

func GetSignaturesAction(services services.Services, mess peer.ProtoMessage, fsm state_fsm.FSM) (state_fsm.FSM, state_fsm.Async, error)

peers asks us about our signatures

func MaybeEnableExtendedApi added in v0.5.0

func MaybeEnableExtendedApi(state state.State, time types.Time) error

func MicroBlockAction added in v0.6.0

func MicroBlockAction(services services.Services, mess peer.ProtoMessage, fsm state_fsm.FSM) (state_fsm.FSM, state_fsm.Async, error)

func MicroBlockInvAction added in v0.6.0

func MicroBlockInvAction(services services.Services, mess peer.ProtoMessage, fsm state_fsm.FSM) (state_fsm.FSM, state_fsm.Async, error)

remote node mined microblock and sent us info about it.

func MicroBlockRequestAction added in v0.6.0

func MicroBlockRequestAction(services services.Services, mess peer.ProtoMessage, fsm state_fsm.FSM) (state_fsm.FSM, state_fsm.Async, error)

Our miner mined microblock, sent MicroblockInv to other nodes, they asked us about Microblock.

func PBBlockAction added in v0.6.0

arrived protobuf block

func PBMicroBlockAction added in v0.6.0

func PBMicroBlockAction(services services.Services, mess peer.ProtoMessage, fsm state_fsm.FSM) (state_fsm.FSM, state_fsm.Async, error)

func PeersAction added in v0.8.0

func PeersAction(services services.Services, mess peer.ProtoMessage, fsm state_fsm.FSM) (state_fsm.FSM, state_fsm.Async, error)

func ScoreAction added in v0.6.0

func SignaturesAction added in v0.6.0

func SignaturesAction(services services.Services, mess peer.ProtoMessage, fsm state_fsm.FSM) (state_fsm.FSM, state_fsm.Async, error)

received asked earlier signatures

func TransactionAction added in v0.6.0

func TransactionAction(s services.Services, mess peer.ProtoMessage, fsm state_fsm.FSM) (state_fsm.FSM, state_fsm.Async, error)

TODO broadcast

Types

type Action added in v0.6.0

type Action func(services services.Services, mess peer.ProtoMessage, fsm state_fsm.FSM) (state_fsm.FSM, state_fsm.Async, error)

type Config

type Config struct {
	AppName  string
	NodeName string
	Listen   string
	DeclAddr string
}

type Node

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

func NewNode

func NewNode(services services.Services, declAddr proto.TCPAddr, bindAddr proto.TCPAddr, outdate proto.Timestamp) *Node

func (*Node) Close

func (a *Node) Close()

func (*Node) Run added in v0.5.0

func (a *Node) Run(ctx context.Context, p peer.Parent, InternalMessageCh chan messages.InternalMessage)

func (*Node) Serve

func (a *Node) Serve(ctx context.Context) error

func (*Node) SpawnOutgoingConnection

func (a *Node) SpawnOutgoingConnection(ctx context.Context, addr proto.TCPAddr) error

func (*Node) SpawnOutgoingConnections

func (a *Node) SpawnOutgoingConnections(ctx context.Context)

Directories

Path Synopsis
Package state_fsm is a generated GoMock package.
Package state_fsm is a generated GoMock package.
ng

Jump to

Keyboard shortcuts

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