Documentation ¶
Index ¶
- func MakePoetEndpoint(ith int) string
- type Account
- type Cluster
- func (a *Cluster) Account(i int) Account
- func (a *Cluster) Accounts() int
- func (c *Cluster) AddBootnodes(cctx *testcontext.Context, n int) error
- func (c *Cluster) AddPoet(cctx *testcontext.Context) error
- func (c *Cluster) AddSmeshers(cctx *testcontext.Context, n int) error
- func (a *Cluster) Address(i int) types.Address
- func (c *Cluster) Bootnodes() int
- func (c *Cluster) Client(i int) *NodeClient
- func (c *Cluster) DeletePoets(cctx *testcontext.Context) error
- func (c *Cluster) DeleteSmesher(cctx *testcontext.Context, node *NodeClient) error
- func (a *Cluster) Persist(ctx *testcontext.Context) error
- func (c *Cluster) Poets() int
- func (a *Cluster) Private(i int) ed25519.PrivateKey
- func (a *Cluster) Recover(ctx *testcontext.Context) error
- func (c *Cluster) Total() int
- func (c *Cluster) Wait(tctx *testcontext.Context, i int) error
- type DeploymentFlag
- func Accounts(accounts map[string]uint64) DeploymentFlag
- func Bootnodes(bootnodes ...string) DeploymentFlag
- func CycleGap(d time.Duration) DeploymentFlag
- func DurationFlag(flag string, d time.Duration) DeploymentFlag
- func EpochDuration(d time.Duration) DeploymentFlag
- func GenesisTime(t time.Time) DeploymentFlag
- func GracePeriod(d time.Duration) DeploymentFlag
- func NetworkID(id uint32) DeploymentFlag
- func PhaseShift(d time.Duration) DeploymentFlag
- func PoetEndpoint(endpoint string) DeploymentFlag
- func PoetRestListen(port int) DeploymentFlag
- func RerunInterval(duration time.Duration) DeploymentFlag
- func TargetOutbound(target int) DeploymentFlag
- type Node
- type NodeClient
- type Opt
- type PodType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakePoetEndpoint ¶
MakePoetEndpoint generate a poet endpoint for the ith instance.
Types ¶
type Account ¶
type Account struct { PrivateKey ed25519.PrivateKey Address types.Address }
Account contains address and private key.
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 Reuse ¶
func Reuse(cctx *testcontext.Context, opts ...Opt) (*Cluster, error)
Reuse will try to recover cluster from the given namespace, if not found it will create a new one.
func (*Cluster) AddBootnodes ¶
func (c *Cluster) AddBootnodes(cctx *testcontext.Context, n int) error
AddBootnodes ...
func (*Cluster) AddSmeshers ¶
func (c *Cluster) AddSmeshers(cctx *testcontext.Context, n int) error
AddSmeshers ...
func (*Cluster) Client ¶
func (c *Cluster) Client(i int) *NodeClient
Client returns client for i-th node, either bootnode or smesher.
func (*Cluster) DeletePoets ¶
func (c *Cluster) DeletePoets(cctx *testcontext.Context) error
DeletePoets delete all poet servers.
func (*Cluster) DeleteSmesher ¶
func (c *Cluster) DeleteSmesher(cctx *testcontext.Context, node *NodeClient) error
DeleteSmesher will smesher i from the cluster.
func (*Cluster) Persist ¶
func (a *Cluster) Persist(ctx *testcontext.Context) error
func (*Cluster) Private ¶
func (a *Cluster) Private(i int) ed25519.PrivateKey
func (*Cluster) Recover ¶
func (a *Cluster) Recover(ctx *testcontext.Context) error
type DeploymentFlag ¶
type DeploymentFlag struct {
Name, Value string
}
DeploymentFlag allows to configure specific flags for application binaries.
func DurationFlag ¶
func DurationFlag(flag string, d time.Duration) DeploymentFlag
DurationFlag is a generic duration flag.
func PoetRestListen ¶
func PoetRestListen(port int) DeploymentFlag
PoetRestListen socket pair with http api.
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 Created time.Time Restarted time.Time }
Node ...
func (Node) GRPCEndpoint ¶
GRPCEndpoint returns grpc endpoint for the Node.
func (Node) P2PEndpoint ¶
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 WithSmesherFlag ¶
func WithSmesherFlag(flag DeploymentFlag) Opt
WithSmesherFlag adds smesher flag.