cluster

package
v0.0.0-...-c6ffef3 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

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

Cluster for managing state of the spacemesh cluster.

func Default

func Default(cctx *testcontext.Context, opts ...Opt) (*Cluster, error)

Default deployes bootnodes, one poet and the smeshers according to the cluster size.

func New

func New(cctx *testcontext.Context, opts ...Opt) *Cluster

New initializes Cluster with options.

func (*Cluster) AddBootnodes

func (c *Cluster) AddBootnodes(cctx *testcontext.Context, n int) error

AddBootnodes ...

func (*Cluster) AddPoet

func (c *Cluster) AddPoet(cctx *testcontext.Context) error

AddPoet ...

func (*Cluster) AddSmeshers

func (c *Cluster) AddSmeshers(cctx *testcontext.Context, n int) error

AddSmeshers ...

func (*Cluster) Address

func (a *Cluster) Address(i int) string

func (*Cluster) Client

func (c *Cluster) Client(i int) *NodeClient

Client returns client for i-th node, either bootnode or smesher.

func (*Cluster) Private

func (a *Cluster) Private(i int) ed25519.PrivateKey

func (*Cluster) Total

func (c *Cluster) Total() int

Total returns total number of clients.

func (*Cluster) Wait

func (c *Cluster) Wait(tctx *testcontext.Context, i int) error

Wait for i-th client to be up.

type DeploymentFlag

type DeploymentFlag struct {
	Name, Value string
}

DeploymentFlag allows to configure specific flags for application binaries.

func Accounts

func Accounts(accounts map[string]uint64) DeploymentFlag

Accounts flag.

func Bootnodes

func Bootnodes(bootnodes ...string) DeploymentFlag

Bootnodes flag.

func GenesisTime

func GenesisTime(t time.Time) DeploymentFlag

GenesisTime flag.

func NetworkID

func NetworkID(id uint32) DeploymentFlag

NetworkID flag.

func PoetEndpoint

func PoetEndpoint(endpoint string) DeploymentFlag

PoetEndpoint flag.

func RerunInterval

func RerunInterval(duration time.Duration) DeploymentFlag

RerunInterval flag.

func TargetOutbound

func TargetOutbound(target int) DeploymentFlag

TargetOutbound flag.

func (DeploymentFlag) Flag

func (d DeploymentFlag) Flag() string

Flag returns parseable flag from Name and Value.

type Node

type Node struct {
	Name      string
	IP        string
	P2P, GRPC uint16
	ID        string
}

Node ...

func (Node) GRPCEndpoint

func (n Node) GRPCEndpoint() string

GRPCEndpoint returns grpc endpoint for the Node.

func (Node) P2PEndpoint

func (n Node) P2PEndpoint() string

P2PEndpoint returns full p2p endpoint, including identity.

type NodeClient

type NodeClient struct {
	Node
	*grpc.ClientConn
}

NodeClient is a Node with attached grpc connection.

type Opt

type Opt func(c *Cluster)

Opt is for configuring cluster.

func WithKeys

func WithKeys(n int) Opt

WithKeys generates n prefunded keys.

func WithSmesherFlag

func WithSmesherFlag(flag DeploymentFlag) Opt

WithSmesherFlag adds smesher flag.

Jump to

Keyboard shortcuts

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