config

package
v0.76.8 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeFull      = "full"
	TypeValidator = "validator"
)

Variables

View Source
var ErrFileNotFound = errors.New("file not found")

Functions

func ListBlockchainRESTEndpoints

func ListBlockchainRESTEndpoints(cfg Config) []string

func ListDatanodeGRPCEndpoints

func ListDatanodeGRPCEndpoints(cfg Config) []string

func ListDatanodeRESTEndpoints

func ListDatanodeRESTEndpoints(cfg Config) []string

func ListValidatorRESTEndpoints

func ListValidatorRESTEndpoints(cfg Config) []string

func SaveConfig

func SaveConfig(path string, cfg Config) error

Types

type BinaryWallets

type BinaryWallets struct {
	NodewalletPath       string `toml:"nodewallet_path"`
	NodewalletBase64     string `toml:"nodewallet"`
	VegaWalletPath       string `toml:"vegawallet_path"`
	VegaWalletBase64     string `toml:"vegawallet"`
	EthereumWalletPath   string `toml:"ethereumwallet_path"`
	EthereumWalletBase64 string `toml:"ethereumwallet"`
}

type Bots

type Bots struct {
	Trading  BotsAPI `toml:"trading"`
	Research BotsAPI `toml:"research"`
}

type BotsAPI

type BotsAPI struct {
	// RESTURL defines the REST endpoint used to query the bots API.
	RESTURL string `toml:"rest_url"`

	// APIKey defines the authentication key used to query the bots API.
	APIKey string `toml:"api_key"`
}

type BridgeWallets

type BridgeWallets struct {
	Minter EthereumWallet `toml:"minter"`
}

type Bridges

type Bridges struct {
	// Primary configures the primary bridge used by the Vega network, usually
	// Ethereum Mainnet (or equivalent), acting as the primary collateral, multisig,
	// staking, and vesting contracts holder.
	Primary PrimaryBridge `toml:"primary"`

	// EVM configures the EVM bridge used by the Vega network, acting
	// as secondary collateral, and multisig contracts holder.
	EVM EVMBridge `toml:"evm"`
}

Bridges holds the configuration of all the Ethereum bridges used by the Vega network.

type Config

type Config struct {
	// Name of the configuration file used. It's extracted from the filename.
	Name NetworkName

	EnvironmentName NetworkName `toml:"environment_name"`

	// Bridges lists the Ethereum bridges used by the Vega network.
	Bridges Bridges `toml:"bridges"`

	// Nodes lists all the nodes participating to the network.
	Nodes []Node `toml:"nodes"`

	Bots Bots `toml:"bots"`

	Network Network `toml:"network"`

	Explorer Explorer `toml:"explorer"`
}

func Load

func Load(ctx context.Context, path string) (Config, error)

func UpsertNode

func UpsertNode(cfg Config, node Node) Config

type EVMBridge

type EVMBridge struct {
	ClientURL     string        `toml:"client_url"`
	BlockExplorer Etherscan     `toml:"block_explorer"`
	Wallets       BridgeWallets `toml:"wallets"`
	Signers       []string      `toml:"signers"`
}

type EthereumWallet

type EthereumWallet struct {
	Address    string `toml:"address"`
	Mnemonic   string `toml:"mnemonic"`
	PrivateKey string `toml:"private_key"`
	Seed       string `toml:"seed"`
}

type Etherscan

type Etherscan struct {
	// RESTURL defines the REST endpoint used to query the block explorer API.
	RESTURL string `toml:"rest_url"`

	// APIKey defines the authentication key used to query the block explorer API.
	APIKey string `toml:"api_key"`
}

Etherscan describes the Etherscan block explorer API connection.

type Explorer

type Explorer struct {
	RESTURL string `toml:"rest_url"`
}

type Network

type Network struct {
	Wallets NetworkWallets `toml:"wallets"`
}

type NetworkName

type NetworkName string
const (
	NetworkDevnet1    NetworkName = "devnet1"
	NetworkStagnet1   NetworkName = "stagnet1"
	NetworkStagnet3   NetworkName = "stagnet3"
	NetworkFairground NetworkName = "fairground"
	NetworkMainnet    NetworkName = "mainnet"
)

func (NetworkName) String

func (n NetworkName) String() string

type NetworkWallets

type NetworkWallets struct {
	VegaTokenWhale VegaWallet `toml:"vega_token_whale"`
	Faucet         VegaWallet `toml:"faucet"`
}

type Node

type Node struct {
	ID       string       `toml:"id"`
	Type     string       `toml:"type"`
	Metadata NodeMetadata `toml:"metadata"`
	Secrets  NodeSecrets  `toml:"secrets"`
	API      NodeAPI      `toml:"api"`
}

Node describes a node on the network.

func FindNodeByID

func FindNodeByID(cfg Config, id string) (Node, bool)

type NodeAPI

type NodeAPI struct {
	BlockchainRESTURL string `toml:"blockchain_rest_url"`
	VegaRESTURL       string `toml:"vega_rest_url"`
	VegaGRPCURL       string `toml:"vega_grpc_url"`
	DataNodeRESTURL   string `toml:"datanode_rest_url"`
	DataNodeGRPCURL   string `toml:"datanode_grpc_url"`
}

type NodeMetadata

type NodeMetadata struct {
	Name      string `toml:"name"`
	Country   string `toml:"country"`
	InfoURL   string `toml:"info_url"`
	AvatarURL string `toml:"avatar_url"`
}

type NodeSecrets

type NodeSecrets struct {
	// Ethereum
	EthereumAddress    string `toml:"ethereum_address"`
	EthereumPrivateKey string `toml:"ethereum_private_key"`
	EthereumMnemonic   string `toml:"ethereum_mnemonic"`
	// Vega
	VegaId             string  `toml:"vega_id"`
	VegaPubKey         string  `toml:"vega_public_key"`
	VegaPrivateKey     string  `toml:"vega_private_key"`
	VegaRecoveryPhrase string  `toml:"vega_recovery_phrase"`
	VegaPubKeyIndex    *uint64 `toml:"vega_public_key_index"`
	// Data-Node DeHistory
	DeHistoryPeerId          string `toml:"de_history_peer_id"`
	DeHistoryPrivateKey      string `toml:"de_history_private_key"`
	NetworkHistoryPeerId     string `toml:"network_history_peer_id"`
	NetworkHistoryPrivateKey string `toml:"network_history_private_key"`
	// Tendermint
	TendermintNodeId              string `toml:"tendermint_node_id"`
	TendermintNodePubKey          string `toml:"tendermint_node_public_key"`
	TendermintNodePrivateKey      string `toml:"tendermint_node_private_key"`
	TendermintValidatorAddress    string `toml:"tendermint_validator_address"`
	TendermintValidatorPubKey     string `toml:"tendermint_validator_public_key"`
	TendermintValidatorPrivateKey string `toml:"tendermint_validator_private_key"`

	// Binary wallet file passphrase
	WalletBinaryPassphrase string         `toml:"wallet_binary_passphrase"`
	BinaryWallets          *BinaryWallets `toml:"binary_wallets"`
}

type PrimaryBridge

type PrimaryBridge struct {
	ClientURL     string        `toml:"client_url"`
	BlockExplorer Etherscan     `toml:"block_explorer"`
	Wallets       BridgeWallets `toml:"wallets"`
	Signers       []string      `toml:"signers"`
}

type VegaWallet

type VegaWallet struct {
	Name           string `toml:"name"`
	PublicKey      string `toml:"public_key"`
	RecoveryPhrase string `toml:"recovery_phrase"`
}

Jump to

Keyboard shortcuts

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