cluster

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2020 License: Apache-2.0, BSD-2-Clause Imports: 30 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 {
	Config              *ClusterConfig
	SmartContractConfig []SmartContractFinalConfig
	ConfigPath          string // where the cluster configuration is stored - read only
	DataPath            string // where the cluster's volatile data lives
	Started             bool
	NodeClient          nodeclient.NodeClient
	// contains filtered or unexported fields
}

func New

func New(configPath string, dataPath string) (*Cluster, error)

func (*Cluster) ActiveApiHosts

func (cluster *Cluster) ActiveApiHosts() []string

func (*Cluster) ActivePublisherHosts

func (cluster *Cluster) ActivePublisherHosts() []string

func (*Cluster) AllWaspNodes

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

func (*Cluster) ApiHosts

func (cluster *Cluster) ApiHosts() []string

func (*Cluster) CollectMessages

func (cluster *Cluster) CollectMessages(duration time.Duration)

func (*Cluster) ConfigKeysPath

func (cluster *Cluster) ConfigKeysPath() string

func (*Cluster) GenerateDKSetsToFile

func (cluster *Cluster) GenerateDKSetsToFile() error

func (*Cluster) GoshimmerConfigTemplatePath

func (cluster *Cluster) GoshimmerConfigTemplatePath() string

func (*Cluster) GoshimmerDataPath

func (cluster *Cluster) GoshimmerDataPath() string

func (*Cluster) Init

func (cluster *Cluster) Init(resetDataPath bool, name string) error

Init creates in DataPath a directory with config.json for each node

func (*Cluster) IsGoshimmerUp

func (cluster *Cluster) IsGoshimmerUp() bool

func (*Cluster) JoinConfigPath

func (cluster *Cluster) JoinConfigPath(s string) string

func (*Cluster) ListenToMessages

func (cluster *Cluster) ListenToMessages(expectations map[string]int) error

func (*Cluster) NumSmartContracts

func (cluster *Cluster) NumSmartContracts() int

func (*Cluster) PeeringHosts

func (cluster *Cluster) PeeringHosts() []string

func (*Cluster) PostTransaction

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

func (*Cluster) PublisherHosts

func (cluster *Cluster) PublisherHosts() []string

func (*Cluster) Report

func (cluster *Cluster) Report() bool

func (*Cluster) Start

func (cluster *Cluster) Start() error

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

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) VerifySCState

func (cluster *Cluster) VerifySCState(sc *SmartContractFinalConfig, expectedIndex uint32, expectedState map[kv.Key][]byte) bool

func (*Cluster) VerifySCStateVariables

func (cluster *Cluster) VerifySCStateVariables(sc *SmartContractFinalConfig, expectedValues map[kv.Key][]byte) 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) WaitUntilExpectationsMet

func (cluster *Cluster) WaitUntilExpectationsMet() bool

func (*Cluster) WaspConfigTemplatePath

func (cluster *Cluster) WaspConfigTemplatePath() string

func (*Cluster) WaspHosts

func (cluster *Cluster) WaspHosts(nodeIndexes []int, getHost func(w *WaspNodeConfig) string) []string

func (*Cluster) WaspNodeDataPath

func (cluster *Cluster) WaspNodeDataPath(i int) string

func (*Cluster) WithSCState

func (cluster *Cluster) WithSCState(sc *SmartContractFinalConfig, f func(host string, stateIndex uint32, state kv.Map) bool) bool

type ClusterConfig

type ClusterConfig struct {
	Nodes     []*WaspNodeConfig `json:"nodes"`
	Goshimmer *struct {
		ApiPort  int  `json:"api_port"`
		Provided bool `json:"provided"`
		// contains filtered or unexported fields
	} `json:"goshimmer"`
	SmartContracts []SmartContractInitData `json:"smart_contracts"`
}

type SmartContractFinalConfig

type SmartContractFinalConfig struct {
	Address        string   `json:"address"`
	Description    string   `json:"description"`
	ProgramHash    string   `json:"program_hash"`
	CommitteeNodes []int    `json:"committee_nodes"`
	AccessNodes    []int    `json:"access_nodes,omitempty"`
	OwnerSeed      []byte   `json:"owner_seed"`
	DKShares       []string `json:"dkshares"` // [node index]
	// contains filtered or unexported fields
}

func (*SmartContractFinalConfig) AllNodes

func (sc *SmartContractFinalConfig) AllNodes() []int

func (*SmartContractFinalConfig) CreateOrigin

func (*SmartContractFinalConfig) GetColor

func (scdata *SmartContractFinalConfig) GetColor() balance.Color

func (*SmartContractFinalConfig) GetProgramHash

func (scdata *SmartContractFinalConfig) GetProgramHash() *hashing.HashValue

func (*SmartContractFinalConfig) OwnerAddress

func (sc *SmartContractFinalConfig) OwnerAddress() address.Address

func (*SmartContractFinalConfig) OwnerSigScheme

func (*SmartContractFinalConfig) SCAddress

func (sc *SmartContractFinalConfig) SCAddress() address.Address

type SmartContractInitData

type SmartContractInitData struct {
	Description    string `json:"description"`
	CommitteeNodes []int  `json:"committee_nodes"`
	AccessNodes    []int  `json:"access_nodes,omitempty"`
	Quorum         int    `json:"quorum"`
}

type WaspNodeConfig

type WaspNodeConfig struct {
	ApiPort       int `json:"api_port"`
	PeeringPort   int `json:"peering_port"`
	NanomsgPort   int `json:"nanomsg_port"`
	DashboardPort int `json:"dashboard_port"`
	// contains filtered or unexported fields
}

func (*WaspNodeConfig) ApiHost

func (w *WaspNodeConfig) ApiHost() string

func (*WaspNodeConfig) IsUp

func (w *WaspNodeConfig) IsUp() bool

func (*WaspNodeConfig) NanomsgHost

func (w *WaspNodeConfig) NanomsgHost() string

func (*WaspNodeConfig) PeeringHost

func (w *WaspNodeConfig) PeeringHost() string

Directories

Path Synopsis
tests

Jump to

Keyboard shortcuts

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