cluster

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: Apache-2.0, BSD-2-Clause Imports: 45 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigExists added in v0.1.0

func ConfigExists(dataPath string) (bool, error)

Types

type Chain added in v0.1.0

type Chain struct {
	Description string

	OriginatorSeed *seed.Seed

	CommitteeNodes []int
	Quorum         uint16
	Address        address.Address

	ChainID coretypes.ChainID
	Color   balance.Color

	Cluster *Cluster
}

func (*Chain) ApiHosts added in v0.1.0

func (ch *Chain) ApiHosts() []string

func (*Chain) ChainAddress added in v0.1.0

func (ch *Chain) ChainAddress() *address.Address

func (*Chain) Client added in v0.1.0

func (ch *Chain) Client(sigScheme signaturescheme.SignatureScheme) *chainclient.Client

func (*Chain) CommitteeMultiClient added in v0.1.0

func (ch *Chain) CommitteeMultiClient() *multiclient.MultiClient

func (*Chain) ContractID added in v0.1.0

func (ch *Chain) ContractID(contractHname coretypes.Hname) coretypes.ContractID

func (*Chain) DeployContract added in v0.1.0

func (ch *Chain) DeployContract(name string, progHashStr string, description string, initParams map[string]interface{}) (*sctransaction.Transaction, error)

func (*Chain) DeployWasmContract added in v0.1.0

func (ch *Chain) DeployWasmContract(name string, description string, progBinary []byte, initParams map[string]interface{}) (*sctransaction.Transaction, hashing.HashValue, error)

func (*Chain) DeployWasmContractOld added in v0.1.0

func (ch *Chain) DeployWasmContractOld(name string, description string, progBinary []byte, initParams map[string]interface{}) (*sctransaction.Transaction, hashing.HashValue, error)

func (*Chain) GetBlobFieldValue added in v0.1.0

func (ch *Chain) GetBlobFieldValue(blobHash hashing.HashValue, field string) ([]byte, error)

func (*Chain) OriginatorAddress added in v0.1.0

func (ch *Chain) OriginatorAddress() *address.Address

func (*Chain) OriginatorClient added in v0.1.0

func (ch *Chain) OriginatorClient() *chainclient.Client

func (*Chain) OriginatorID added in v0.1.0

func (ch *Chain) OriginatorID() *coretypes.AgentID

func (*Chain) OriginatorSigScheme added in v0.1.0

func (ch *Chain) OriginatorSigScheme() signaturescheme.SignatureScheme

func (*Chain) PeeringHosts added in v0.1.0

func (ch *Chain) PeeringHosts() []string

func (*Chain) SCClient added in v0.1.0

func (ch *Chain) SCClient(contractHname coretypes.Hname, sigScheme signaturescheme.SignatureScheme) *scclient.SCClient

func (*Chain) StartMessageCounter added in v0.1.0

func (ch *Chain) StartMessageCounter(expectations map[string]int) (*MessageCounter, error)

func (*Chain) WithSCState added in v0.1.0

func (ch *Chain) WithSCState(hname coretypes.Hname, f func(host string, blockIndex uint32, state dict.Dict) bool) bool

type Cluster

type Cluster struct {
	Name    string
	Config  *ClusterConfig
	Started bool
	// contains filtered or unexported fields
}

func New

func New(name string, config *ClusterConfig) *Cluster

func (*Cluster) ActiveNodes added in v0.1.0

func (cluster *Cluster) ActiveNodes() []int

func (*Cluster) DeployChain added in v0.1.0

func (clu *Cluster) DeployChain(description string, committeeNodes []int, quorum uint16) (*Chain, error)

func (*Cluster) DeployDefaultChain added in v0.1.0

func (clu *Cluster) DeployDefaultChain() (*Chain, error)

func (*Cluster) InitDataPath added in v0.1.0

func (cluster *Cluster) InitDataPath(templatesPath string, dataPath string, removeExisting bool) error

InitDataPath initializes the cluster data directory (cluster.json + one subdirectory for each node).

func (*Cluster) IsGoshimmerUp

func (cluster *Cluster) IsGoshimmerUp() bool

func (*Cluster) IsNodeUp added in v0.1.0

func (cluster *Cluster) IsNodeUp(i int) bool

func (*Cluster) Level1Client added in v0.1.0

func (clu *Cluster) Level1Client() level1.Level1Client

func (*Cluster) MultiClient added in v0.1.0

func (cluster *Cluster) MultiClient() *multiclient.MultiClient

func (*Cluster) PostTransaction

func (cluster *Cluster) PostTransaction(tx *sctransaction.Transaction) error

func (*Cluster) Start

func (cluster *Cluster) Start(dataPath string) error

Start launches all wasp nodes in the cluster, each running in its own directory

func (*Cluster) StartMessageCounter added in v0.1.0

func (cluster *Cluster) StartMessageCounter(expectations map[string]int) (*MessageCounter, error)

func (*Cluster) Stop

func (cluster *Cluster) Stop()

Stop sends an interrupt signal to all nodes and waits for them to exit

func (*Cluster) StopNode

func (cluster *Cluster) StopNode(nodeIndex int)

func (*Cluster) VerifyAddressBalances

func (cluster *Cluster) VerifyAddressBalances(addr *address.Address, totalExpected int64, expect map[balance.Color]int64, comment ...string) bool

func (*Cluster) VerifySCStateVariables2

func (cluster *Cluster) VerifySCStateVariables2(addr *address.Address, expectedValues map[kv.Key]interface{}) bool

func (*Cluster) Wait

func (cluster *Cluster) Wait()

func (*Cluster) WaspClient added in v0.1.0

func (cluster *Cluster) WaspClient(nodeIndex int) *client.WaspClient

type ClusterConfig

type ClusterConfig struct {
	Wasp      WaspConfig
	Goshimmer GoshimmerConfig
}

func DefaultConfig added in v0.1.0

func DefaultConfig() *ClusterConfig

func LoadConfig added in v0.1.0

func LoadConfig(dataPath string) (*ClusterConfig, error)

func (*ClusterConfig) AllNodes added in v0.1.0

func (c *ClusterConfig) AllNodes() []int

func (*ClusterConfig) ApiHost added in v0.1.0

func (c *ClusterConfig) ApiHost(nodeIndex int) string

func (*ClusterConfig) ApiHosts added in v0.1.0

func (c *ClusterConfig) ApiHosts(nodeIndexes ...[]int) []string

func (*ClusterConfig) ApiPort added in v0.1.0

func (c *ClusterConfig) ApiPort(nodeIndex int) int

func (*ClusterConfig) DashboardPort added in v0.1.0

func (c *ClusterConfig) DashboardPort(nodeIndex int) int

func (*ClusterConfig) GoshimmerConfigTemplateParams added in v0.1.0

func (c *ClusterConfig) GoshimmerConfigTemplateParams() *templates.GoshimmerConfigParams

func (*ClusterConfig) NanomsgHost added in v0.1.0

func (c *ClusterConfig) NanomsgHost(nodeIndex int) string

func (*ClusterConfig) NanomsgHosts added in v0.1.0

func (c *ClusterConfig) NanomsgHosts(nodeIndexes ...[]int) []string

func (*ClusterConfig) NanomsgPort added in v0.1.0

func (c *ClusterConfig) NanomsgPort(nodeIndex int) int

func (*ClusterConfig) PeeringHost added in v0.1.0

func (c *ClusterConfig) PeeringHost(nodeIndex int) string

func (*ClusterConfig) PeeringHosts added in v0.1.0

func (c *ClusterConfig) PeeringHosts(nodeIndexes ...[]int) []string

func (*ClusterConfig) PeeringPort added in v0.1.0

func (c *ClusterConfig) PeeringPort(nodeIndex int) int

func (*ClusterConfig) Save added in v0.1.0

func (c *ClusterConfig) Save(dataPath string) error

func (*ClusterConfig) WaspConfigTemplateParams added in v0.1.0

func (c *ClusterConfig) WaspConfigTemplateParams(i int) *templates.WaspConfigParams

type GoshimmerConfig added in v0.1.0

type GoshimmerConfig struct {
	ApiPort  int
	Provided bool
}

type MessageCounter added in v0.1.0

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

func NewMessageCounter added in v0.1.0

func NewMessageCounter(cluster *Cluster, nodes []int, expectations map[string]int) (*MessageCounter, error)

func (*MessageCounter) Close added in v0.1.0

func (m *MessageCounter) Close()

func (*MessageCounter) CollectMessages added in v0.1.0

func (m *MessageCounter) CollectMessages(duration time.Duration)

func (*MessageCounter) Report added in v0.1.0

func (m *MessageCounter) Report() bool

func (*MessageCounter) WaitUntilExpectationsMet added in v0.1.0

func (m *MessageCounter) WaitUntilExpectationsMet() bool

type WaspConfig added in v0.1.0

type WaspConfig struct {
	NumNodes int

	// node ports are calculated as these values + node index
	FirstApiPort       int
	FirstPeeringPort   int
	FirstNanomsgPort   int
	FirstDashboardPort int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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