types

package
v0.77.6 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodeModeValidator = "validator"
	NodeModeFull      = "full"

	NodeWalletChainTypeTendermint = "tendermint"
	NodeWalletChainTypeVega       = "vega"
	NodeWalletChainTypeEthereum   = "ethereum"

	NomadLogsCollectorTaskName = "capsule-logscolletor"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DataNode

type DataNode struct {
	// description: General information about the node.
	GeneratedService `cty:"service"`
	// description: Path to binary used to generate and run the node.
	BinaryPath string
	// description: Unique IPFS swarm key for this network
	UniqueSwarmKey string
}

type Faucet

type Faucet struct {
	GeneratedService
	PublicKey          string
	WalletFilePath     string
	WalletPassFilePath string
	BinaryPath         string
}

type GeneratedService added in v0.2.3

type GeneratedService struct {
	// description: Name of the service.
	Name string `cty:"name"`
	// description: Path to home directory of the service.
	HomeDir string `cty:"home_dir"`
	// description: Path to service configuration.
	ConfigFilePath string `cty:"config_file_path"`
}

description: Represents any generated Capsule service.

type GeneratedServices

type GeneratedServices struct {
	Wallet          *Wallet
	Faucet          *Faucet
	NodeSets        NodeSetMap `cty:"node_sets"`
	PreGenerateJobs []NomadJob
}

func DefaultGeneratedServices added in v0.3.0

func DefaultGeneratedServices() GeneratedServices

func NewGeneratedServices

func NewGeneratedServices(w *Wallet, f *Faucet, ns []NodeSet) *GeneratedServices

func (GeneratedServices) GetByName added in v0.2.3

func (gs GeneratedServices) GetByName(name string) []GeneratedService

func (GeneratedServices) GetNodeSet

func (gs GeneratedServices) GetNodeSet(name string) (*NodeSet, error)

func (GeneratedServices) GetNodeSetsByGroupName

func (gs GeneratedServices) GetNodeSetsByGroupName(groupName string) []NodeSet

func (GeneratedServices) GetNonValidators added in v0.2.2

func (gs GeneratedServices) GetNonValidators() []NodeSet

func (GeneratedServices) GetValidators

func (gs GeneratedServices) GetValidators() []NodeSet

func (GeneratedServices) ListValidators

func (gs GeneratedServices) ListValidators() []VegaNodeOutput

func (GeneratedServices) PreGenerateJobsIDs added in v0.2.0

func (gs GeneratedServices) PreGenerateJobsIDs() []string

PreGenerateJobsIDs returns pre gen jobs ids across all node sets

func (GeneratedServices) ToCtyValue added in v0.3.0

func (gs GeneratedServices) ToCtyValue() (*cty.Value, error)

type HTTPProbe added in v0.3.0

type HTTPProbe struct {
	// description: URL of the HTTP endpoint.
	URL string `hcl:"url" template:""`
}

description: Allows the user to probe HTTP endpoint. example:

type: hcl
value: |
		http {
			url = "http://localhost:8002"
		}

type JobIDMap

type JobIDMap map[string]bool

func (JobIDMap) ToSlice

func (jm JobIDMap) ToSlice() []string

type NetworkJobs

type NetworkJobs struct {
	NodesSetsJobIDs JobIDMap
	ExtraJobIDs     JobIDMap
	FaucetJobID     string
	WalletJobID     string
}

func (*NetworkJobs) AddExtraJobIDs

func (nj *NetworkJobs) AddExtraJobIDs(ids []string)

func (NetworkJobs) Exists

func (nj NetworkJobs) Exists(jobID string) bool

func (*NetworkJobs) MergeNetworkJobs added in v0.3.0

func (nj *NetworkJobs) MergeNetworkJobs(toMerge NetworkJobs)

func (*NetworkJobs) RemoveRunningJobsIDs added in v0.3.0

func (nj *NetworkJobs) RemoveRunningJobsIDs(ids []string)

func (NetworkJobs) ToSlice

func (nj NetworkJobs) ToSlice() []string

type NodeSet

type NodeSet struct {
	// description: Name that represents a group of the same node sets.
	GroupName string `cty:"group_name"`
	// description: Name of a specific node set in a node sets group.
	Name string `cty:"name"`
	// description: Mode of the node set. Can be `validator` or `full` (full means a non validating node).
	Mode string `cty:"mode"`
	/*
		description: |
			Index is a position and order in which the node set has been generated respective to all other created node sets.
			It goes from 0-N where N is the total number of node sets.
	*/
	Index int `cty:"index"`
	// description: RelativeIndex is a counter relative to current node set group. Related to GroupName.
	RelativeIndex int
	// description: GroupIndex is an index of the group that this node set belongs to. Related to GroupName.
	GroupIndex int

	// description: Information about generated Vega node.
	Vega VegaNode `cty:"vega"`
	// description: Information about generated Tendermint node.
	Tendermint TendermintNode `cty:"tendermint"`
	// description: Information about generated Data node.
	DataNode *DataNode `cty:"data_node"`
	// description: Information about generated Visor instance.
	Visor *Visor
	// description: Jobs that have been started before the nodes were generated.
	PreGenerateJobs []NomadJob
	// description: Pre start probes.
	PreStartProbe *ProbesConfig `hcl:"pre_start_probe,optional"  template:""`
	// description: Stores custom Nomad job definition of this node set.
	NomadJobRaw *string `json:",omitempty"`
}

func FilterNodeSets

func FilterNodeSets(nodeSets []NodeSet, filters ...NodeSetFilter) []NodeSet

func (NodeSet) IsValidator added in v0.2.3

func (ns NodeSet) IsValidator() bool

func (NodeSet) PreGenerateJobsIDs added in v0.2.0

func (ns NodeSet) PreGenerateJobsIDs() []string

PreGenerateJobsIDs returns pre gen jobs ids per specific node set

func (NodeSet) PreGenerateRawJobs added in v0.2.0

func (ns NodeSet) PreGenerateRawJobs() []string

PreGenerateRawJobs returns pre gen jobs per specific node set

type NodeSetFilter

type NodeSetFilter func(ns NodeSet) bool

func NodeSetFilterByGroupName

func NodeSetFilterByGroupName(groupName string) NodeSetFilter

func NodeSetFilterByGroupNames

func NodeSetFilterByGroupNames(names []string) NodeSetFilter

func NodeSetFilterByNames

func NodeSetFilterByNames(names []string) NodeSetFilter

type NodeSetMap

type NodeSetMap map[string]NodeSet

func (NodeSetMap) ToSlice

func (nm NodeSetMap) ToSlice() []NodeSet

type NodeWalletInfo

type NodeWalletInfo struct {
	/*
		description: Ethereum account address.
		note: Only available when Key Store wallet is used.
	*/
	EthereumAddress string

	EthereumPrivateKey string
	// description: Path to file where Ethereum wallet key is stored.
	EthereumPassFilePath string
	/*
		description: Address of Clef wallet.
		note: Only available when Clef wallet is used.
	*/
	EthereumClefRPCAddress string

	// description: Name of the Vega wallet.
	VegaWalletName string
	// description: ID of Vega wallet.
	VegaWalletID string
	// description: Public key used from the Vega wallet.
	VegaWalletPublicKey string
	// description: Recovery phrase from the Vega wallet.
	VegaWalletRecoveryPhrase string
	// description: File path of the Vega wallet passphrase.
	VegaWalletPassFilePath string
}

description: Information about node wallets.

type NomadJob added in v0.2.0

type NomadJob struct {
	// description: Custom selected ID - name of the job.
	ID string
	// description: Nomad job definition.
	NomadJobRaw string
}

description: Represents a raw Nomad job.

type PostgresProbe added in v0.3.0

type PostgresProbe struct {
	// description: Postgres connection string.
	Connection string `hcl:"connection" template:""`
	// description: Test query.
	Query string `hcl:"query" template:""`
}

description: Allows the user to probe Postgres database. example:

type: hcl
value: |
		postgres {
			connection = "user=vega dbname=vega password=vega port=5232 sslmode=disable"
			query = "select 10 + 10"
		}

type ProbesConfig added in v0.3.0

type ProbesConfig struct {
	/*
		description: Allows the user to probe HTTP endpoint.
		example:

			type: hcl
			value: |
					http {
						...
					}
	*/
	HTTP *HTTPProbe `hcl:"http,block" template:""`

	/*
		description: Allows the user to probe TCP socker.
		example:

			type: hcl
			value: |
					tcp {
						...
					}
	*/
	TCP *TCPProbe `hcl:"tcp,block" template:""`

	/*
		description: Allows the user to probe Postgres database with a query.
		example:

			type: hcl
			value: |
					postgres {
						...
					}
	*/
	Postgres *PostgresProbe `hcl:"postgres,block" template:""`
}

description: Allows the user to define pre start probes on external services. example:

type: hcl
value: |
		pre_start_probe {
			...
		}

type RawJobWithNomadJob added in v0.2.0

type RawJobWithNomadJob struct {
	RawJob   string
	NomadJob *api.Job
}

type SmartContractsInfo

type SmartContractsInfo struct {
	MultisigControl struct {
		EthereumAddress string `json:"Ethereum"`
	} `json:"MultisigControl"`
	EthereumOwner struct {
		Public  string `json:"pub"`
		Private string `json:"priv"`
	} `json:"addr0"`
	ERC20Bridge struct {
		EthereumAddress string `json:"Ethereum"`
	} `json:"erc20_bridge_1"`
	StakingBridge struct {
		EthereumAddress string `json:"Ethereum"`
	} `json:"staking_bridge"`
}

type SmartContractsToken added in v0.3.0

type SmartContractsToken struct {
	EthereumAddress string `json:"Ethereum"`
	VegaAddress     string `json:"Vega"`
}

type TCPProbe added in v0.3.0

type TCPProbe struct {
	// description: Address of the TCP socket.
	Address string `hcl:"address" template:""`
}

description: Allows the user to probe TCP socket. example:

type: hcl
value: |
		tcp {
			address = "localhost:9009"
		}

type TendermintNode

type TendermintNode struct {
	// description: General information about the node.
	GeneratedService `cty:"service"`

	// description: ID of the Tendermint node.
	NodeID string `cty:"node_id"`
	// description: File path of the genesis file used to bootstrap the network.
	GenesisFilePath string
	// description: Path to binary used to generate and run the node.
	BinaryPath string
	// description: Generated public key of the Tendermint validator.
	ValidatorPublicKey string
}

description: Represents generated Tendermint node.

type TendermintOutput added in v0.3.0

type TendermintOutput struct {
	NodeID             string
	ValidatorPublicKey string
}

type VegaNode

type VegaNode struct {
	// description: General information about the node.
	GeneratedService `cty:"service"`

	// description: Mode of the node - `validator` or `full`.
	Mode string `cty:"mode"`

	/*
		description: Path to generated node wallet passphrase file.
		note: Only present if `mode = validator`.
	*/
	NodeWalletPassFilePath string

	/*
		description: Information about generated/imported node wallets.
		note: Only present if `mode = validator`.
	*/
	NodeWalletInfo *NodeWalletInfo `json:",omitempty"`
	// description: Path to binary used to generate and run the node.
	BinaryPath string
}

description: Represents generated Vega node.

type VegaNodeOutput

type VegaNodeOutput struct {
	NomadJobName string
	Tendermint   TendermintOutput
	VegaNode
}

type Visor added in v0.2.3

type Visor struct {
	// description: General information about Visor.
	GeneratedService
	// description: Path to binary used to generate and run the node.
	BinaryPath string
}

type Wallet

type Wallet struct {
	GeneratedService
	Network             string
	BinaryPath          string
	TokenPassphrasePath string
}

Jump to

Keyboard shortcuts

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