cluster

package
v0.4.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: Apache-2.0, BSD-2-Clause Imports: 44 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

	OriginatorKeyPair *cryptolib.KeyPair

	AllPeers       []int
	CommitteeNodes []int
	Quorum         uint16
	StateAddress   iotago.Address

	ChainID isc.ChainID

	Cluster *Cluster
}

func (*Chain) AllAPIHosts added in v0.2.0

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

func (*Chain) AllNodesMultiClient added in v0.3.0

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

func (*Chain) AllPeeringHosts added in v0.2.0

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

func (*Chain) BlockIndex added in v0.2.0

func (ch *Chain) BlockIndex(nodeIndex ...int) (uint32, error)

func (*Chain) ChainAddress added in v0.1.0

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

func (*Chain) Client added in v0.1.0

func (ch *Chain) Client(sigScheme *cryptolib.KeyPair, nodeIndex ...int) *chainclient.Client

func (*Chain) CommitteeAPIHosts added in v0.2.0

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

func (*Chain) CommitteeMultiClient added in v0.1.0

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

func (*Chain) CommitteePeeringHosts added in v0.2.0

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

func (*Chain) ContractRegistry added in v0.2.0

func (ch *Chain) ContractRegistry(nodeIndex ...int) (map[isc.Hname]*root.ContractRecord, error)

func (*Chain) DeployContract added in v0.1.0

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

func (*Chain) DeployWasmContract added in v0.1.0

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

func (*Chain) GetAllBlockInfoRecordsReverse added in v0.2.0

func (ch *Chain) GetAllBlockInfoRecordsReverse(nodeIndex ...int) ([]*blocklog.BlockInfo, error)

func (*Chain) GetBlobFieldValue added in v0.1.0

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

func (*Chain) GetCounterValue added in v0.2.0

func (ch *Chain) GetCounterValue(inccounterSCHname isc.Hname, nodeIndex ...int) (int64, error)

func (*Chain) GetRequestReceipt added in v0.2.0

func (ch *Chain) GetRequestReceipt(reqID isc.RequestID, nodeIndex ...int) (*isc.Receipt, error)

func (*Chain) GetRequestReceiptsForBlock added in v0.2.0

func (ch *Chain) GetRequestReceiptsForBlock(blockIndex *uint32, nodeIndex ...int) ([]*blocklog.RequestReceipt, error)

func (*Chain) GetStateVariable added in v0.2.0

func (ch *Chain) GetStateVariable(contractHname isc.Hname, key string, nodeIndex ...int) ([]byte, error)

func (*Chain) OriginatorAddress added in v0.1.0

func (ch *Chain) OriginatorAddress() iotago.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() isc.AgentID

func (*Chain) SCClient added in v0.1.0

func (ch *Chain) SCClient(contractHname isc.Hname, sigScheme *cryptolib.KeyPair, nodeIndex ...int) *scclient.SCClient

type Cluster

type Cluster struct {
	Name             string
	Config           *ClusterConfig
	Started          bool
	DataPath         string
	ValidatorKeyPair *cryptolib.KeyPair // Default identity for validators, chain owners, etc.
	// contains filtered or unexported fields
}

func New

func New(name string, config *ClusterConfig, dataPath string, t *testing.T, log *logger.Logger) *Cluster

func (*Cluster) ActiveNodes added in v0.1.0

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

func (*Cluster) AddAccessNode added in v0.2.4

func (clu *Cluster) AddAccessNode(accessNodeIndex int, chain *Chain) (*iotago.Transaction, error)

AddAccessNode introduces node at accessNodeIndex as an access node to the chain. This is done by activating the chain on the node and asking the governance contract to consider it as an access node.

func (*Cluster) AddTrustedNode added in v0.3.0

func (clu *Cluster) AddTrustedNode(peerInfo *model.PeeringTrustedNode, onNodes ...[]int) error

func (*Cluster) AddressBalances added in v0.3.0

func (clu *Cluster) AddressBalances(addr iotago.Address) *isc.FungibleTokens

func (*Cluster) AllNodes added in v0.3.0

func (clu *Cluster) AllNodes() []int

func (*Cluster) AssertAddressBalances added in v0.3.0

func (clu *Cluster) AssertAddressBalances(addr iotago.Address, expected *isc.FungibleTokens) bool

func (*Cluster) DeployChain added in v0.1.0

func (clu *Cluster) DeployChain(description string, allPeers, committeeNodes []int, quorum uint16, stateAddr iotago.Address) (*Chain, error)

func (*Cluster) DeployChainWithDKG added in v0.2.0

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

func (*Cluster) DeployDefaultChain added in v0.1.0

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

func (*Cluster) GetOutputs added in v0.3.0

func (clu *Cluster) GetOutputs(addr iotago.Address) (map[iotago.OutputID]iotago.Output, error)

func (*Cluster) InitDKG added in v0.2.0

func (clu *Cluster) InitDKG(committeeNodeCount int) ([]int, iotago.Address, error)

func (*Cluster) InitDataPath added in v0.1.0

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

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

func (*Cluster) IsNodeUp added in v0.1.0

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

func (*Cluster) KillNodeProcess added in v0.3.0

func (clu *Cluster) KillNodeProcess(nodeIndex int) error

func (*Cluster) L1BaseTokens added in v0.3.0

func (clu *Cluster) L1BaseTokens(addr iotago.Address) uint64

func (*Cluster) L1Client added in v0.3.0

func (clu *Cluster) L1Client() l1connection.Client

func (*Cluster) MultiClient added in v0.1.0

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

func (*Cluster) NewKeyPairWithFunds added in v0.2.0

func (clu *Cluster) NewKeyPairWithFunds() (*cryptolib.KeyPair, iotago.Address, error)

func (*Cluster) NodeDataPath added in v0.3.0

func (clu *Cluster) NodeDataPath(i int) string

func (*Cluster) PostTransaction

func (clu *Cluster) PostTransaction(tx *iotago.Transaction) error

func (*Cluster) RequestFunds added in v0.3.0

func (clu *Cluster) RequestFunds(addr iotago.Address) error

func (*Cluster) RestartNodes added in v0.3.0

func (clu *Cluster) RestartNodes(nodeIndex ...int) error

func (*Cluster) RunDKG added in v0.2.0

func (clu *Cluster) RunDKG(committeeNodes []int, threshold uint16, timeout ...time.Duration) (iotago.Address, error)

func (*Cluster) Start

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

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

func (*Cluster) Stop

func (clu *Cluster) Stop()

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

func (*Cluster) StopNode

func (clu *Cluster) StopNode(nodeIndex int)

func (*Cluster) TrustAll added in v0.2.0

func (clu *Cluster) TrustAll() error

func (*Cluster) ValidatorAddress added in v0.2.4

func (clu *Cluster) ValidatorAddress() iotago.Address

func (*Cluster) Wait

func (clu *Cluster) Wait()

func (*Cluster) WaspClient added in v0.1.0

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

type ClusterConfig

type ClusterConfig struct {
	Wasp []templates.WaspConfigParams
	L1   l1connection.Config
}

func LoadConfig added in v0.1.0

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

func NewConfig added in v0.3.0

func NewConfig(waspConfig WaspConfig, l1Config l1connection.Config, modifyConfig ...templates.ModifyNodesConfigFn) *ClusterConfig

func (*ClusterConfig) APIHost added in v0.2.0

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

func (*ClusterConfig) APIHosts added in v0.2.0

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

func (*ClusterConfig) APIPort added in v0.2.0

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

func (*ClusterConfig) AllNodes added in v0.1.0

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

func (*ClusterConfig) DashboardPort added in v0.1.0

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

func (*ClusterConfig) L1APIAddress added in v0.3.0

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

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) ProfilingPort added in v0.2.0

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

func (*ClusterConfig) PrometheusPort added in v0.2.0

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

func (*ClusterConfig) Save added in v0.1.0

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

func (*ClusterConfig) SetOwnerAddress added in v0.3.0

func (c *ClusterConfig) SetOwnerAddress(address string)

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
	FirstProfilingPort int
	FirstMetricsPort   int
}

func DefaultWaspConfig added in v0.3.0

func DefaultWaspConfig() WaspConfig

func (*WaspConfig) WaspConfigTemplateParams added in v0.3.0

func (w *WaspConfig) WaspConfigTemplateParams(i int) templates.WaspConfigParams

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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