actor

package
v0.3.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsActorCmd

func IsActorCmd(args []string) bool

Types

type Actor

type Actor struct {
	ID ActorID

	*GlobalActorData

	CurrentPeerstore track.DynamicPeerstore

	PeerStatusState   status.PeerStatusState
	PeerMetadataState metadata.PeerMetadataState

	ChainState  chain.ChainState
	BlocksState blocks.DBState
	StatesState states.DBState

	Dv5State dv5.Dv5State

	GossipState gossip.GossipState
	RPCState    rpc.RPCState

	HostState host.HostState

	LazyEnrState enr.LazyEnrState

	ActorCtx context.Context
	// contains filtered or unexported fields
}

func NewActor

func NewActor(id ActorID, globals *GlobalActorData) *Actor

func (*Actor) Close

func (r *Actor) Close()

func (*Actor) GetNode added in v0.2.1

func (r *Actor) GetNode() (n *enode.Node, ok bool)

func (*Actor) GetPriv added in v0.2.1

func (r *Actor) GetPriv() *crypto.Secp256k1PrivateKey

func (*Actor) MakeCmd

func (r *Actor) MakeCmd(log logrus.FieldLogger, control base.Control, out io.Writer) *ActorCmd

func (*Actor) SetPriv added in v0.2.1

func (r *Actor) SetPriv(priv *crypto.Secp256k1PrivateKey) error

type ActorCmd

type ActorCmd struct {
	*Actor
	// To log things while the command runs, including spawned processes
	Log logrus.FieldLogger
	// Control the execution of a command
	Control base.Control
	// Optional std output
	Out io.Writer
}

func (*ActorCmd) Cmd

func (c *ActorCmd) Cmd(route string) (cmd interface{}, err error)

func (*ActorCmd) Help

func (c *ActorCmd) Help() string

func (*ActorCmd) Routes

func (c *ActorCmd) Routes() []string

type ActorID

type ActorID string

type GlobalActorData

type GlobalActorData struct {
	GlobalCtx        context.Context
	GlobalPeerstores track.Peerstores
	GlobalChains     chaindata.Chains
	GlobalBlocksDBs  bdb.DBs
	GlobalStatesDBs  sdb.DBs
}

type SleepCmd

type SleepCmd struct {
	*base.Base
	Time time.Duration `ask:"<time>" help:"How long to sleep, e.g. 3s"`
}

func (*SleepCmd) Default

func (c *SleepCmd) Default()

func (*SleepCmd) Help

func (c *SleepCmd) Help() string

func (*SleepCmd) Run

func (c *SleepCmd) Run(ctx context.Context, args ...string) error

Jump to

Keyboard shortcuts

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