networktools

package
v0.74.10 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GreenText = "\033[1;32m%s\033[0m"
	RedText   = "\033[1;31m%s\033[0m"
	InfoText  = "\033[1;36m%s\033[0m"
)

Variables

Functions

This section is empty.

Types

type Checkpoint

type Checkpoint struct {
	ServerHost string `json:"server"`
	Filepath   string `json:"file"`
}

type NetworkGraph

type NetworkGraph struct {
	Nodes map[string]*NetworkGraphNode
}

func (*NetworkGraph) AddNode

func (ng *NetworkGraph) AddNode(
	tendermintNodeId string,
	moniker string,
	validator bool,
	peers []string,
) error

func (*NetworkGraph) Print

func (ng *NetworkGraph) Print()

type NetworkGraphNode

type NetworkGraphNode struct {
	TendermintNodeId string
	Moniker          string
	Validator        bool
	Peers            []string
}

type NetworkTools

type NetworkTools struct {
	Name      string
	DNSSuffix string
	// contains filtered or unexported fields
}

func NewNetworkTools

func NewNetworkTools(
	name string,
	logger *zap.Logger,
) (*NetworkTools, error)

func (*NetworkTools) FindLatestCheckpoint

func (network *NetworkTools) FindLatestCheckpoint(
	vegaHome string,
	sshUsername string,
	sshPrivateKeyfile string,
) (result *Checkpoint, err error)

func (*NetworkTools) GetBlockExplorers

func (network *NetworkTools) GetBlockExplorers(healthyOnly bool) []string

func (*NetworkTools) GetCheckpointPath

func (network *NetworkTools) GetCheckpointPath(vegaHome string) string

func (*NetworkTools) GetDataNodeClient

func (network *NetworkTools) GetDataNodeClient() (vegaapi.DataNodeClient, error)

func (*NetworkTools) GetEthNetwork

func (network *NetworkTools) GetEthNetwork() (types.ETHNetwork, error)

func (*NetworkTools) GetFaucetBaseURL

func (network *NetworkTools) GetFaucetBaseURL() (string, error)

func (*NetworkTools) GetLiqbotBaseURL

func (network *NetworkTools) GetLiqbotBaseURL() (string, error)

func (*NetworkTools) GetLiqbotTraders

func (network *NetworkTools) GetLiqbotTraders() (*Traders, error)

func (*NetworkTools) GetNetworkDataNodes

func (network *NetworkTools) GetNetworkDataNodes(healthyOnly bool) []string

func (*NetworkTools) GetNetworkGRPCDataNodes

func (network *NetworkTools) GetNetworkGRPCDataNodes() []string

func (*NetworkTools) GetNetworkGRPCVegaCore

func (network *NetworkTools) GetNetworkGRPCVegaCore() []string

func (*NetworkTools) GetNetworkGraph

func (network *NetworkTools) GetNetworkGraph() (*NetworkGraph, error)

func (*NetworkTools) GetNetworkHealthyNodes

func (network *NetworkTools) GetNetworkHealthyNodes() []string

func (*NetworkTools) GetNetworkNodes

func (network *NetworkTools) GetNetworkNodes(healthyOnly bool) []string

func (*NetworkTools) GetNetworkParams

func (network *NetworkTools) GetNetworkParams() (*types.NetworkParams, error)

func (*NetworkTools) GetNetworkParamsFromHost

func (network *NetworkTools) GetNetworkParamsFromHost(host string, tlsOnly bool) (*types.NetworkParams, error)

func (*NetworkTools) GetNetworkTendermintRESTEndpoints

func (network *NetworkTools) GetNetworkTendermintRESTEndpoints(healthyOnly bool) []string

func (*NetworkTools) GetNodeURL

func (network *NetworkTools) GetNodeURL(nodeId string) string

func (*NetworkTools) GetRunningStatistics

func (network *NetworkTools) GetRunningStatistics() (*Statistics, error)

func (*NetworkTools) GetRunningStatisticsForAllDataNodes

func (network *NetworkTools) GetRunningStatisticsForAllDataNodes() map[string]Statistics

func (*NetworkTools) GetRunningStatisticsForAllHosts

func (network *NetworkTools) GetRunningStatisticsForAllHosts() map[string]Statistics

func (*NetworkTools) GetRunningStatisticsForHost

func (network *NetworkTools) GetRunningStatisticsForHost(host string, tlsOnly bool) (*Statistics, error)

func (*NetworkTools) GetRunningStatisticsForHosts

func (network *NetworkTools) GetRunningStatisticsForHosts(hosts []string, tlsOnly bool) map[string]Statistics

func (*NetworkTools) GetRunningVersion

func (network *NetworkTools) GetRunningVersion() (string, error)

func (*NetworkTools) GetSmartContracts

func (network *NetworkTools) GetSmartContracts(
	ethClientManager *ethutils.EthereumClientManager,
) (*veganetworksmartcontracts.VegaNetworkSmartContracts, error)

func (*NetworkTools) GetTraderbotBaseURL

func (network *NetworkTools) GetTraderbotBaseURL(traderbotId string) (string, error)

func (*NetworkTools) GetTraderbotTraders

func (network *NetworkTools) GetTraderbotTraders(traderbotId string, traderbotsURL string) (*Traders, error)

func (*NetworkTools) GetVegaCoreClient

func (network *NetworkTools) GetVegaCoreClient() (vegaapi.VegaCoreClient, error)

func (*NetworkTools) GetVegaCoreClientForNode

func (network *NetworkTools) GetVegaCoreClientForNode(nodeId string) (vegaapi.VegaCoreClient, error)

func (*NetworkTools) ListNodes

func (network *NetworkTools) ListNodes(kind []NodeType) []string

func (*NetworkTools) MintFakeTokens

func (network *NetworkTools) MintFakeTokens(
	vegaPubKey string,
	vegaAssetId string,
	amount *big.Int,
) error

func (*NetworkTools) RunCommandOnEveryNode

func (network *NetworkTools) RunCommandOnEveryNode(
	sshUsername string,
	sshPrivateKeyfile string,
	command string,
) map[string]ssh.RunResults

type NodeType

type NodeType string
const (
	TypeValidator NodeType = "validator"
	TypeDataNode  NodeType = "data-node"
	TypeExplorer  NodeType = "block-explorer"
)

type Statistics

type Statistics struct {
	Status      string `json:"status"`
	BlockHeight uint64 `json:"blockHeight,string"`
	CurrentTime string `json:"currentTime"`
	VegaTime    string `json:"vegaTime"`
	AppVersion  string `json:"appVersion"`
}

type TraderbotResponse

type TraderbotResponse struct {
	Traders map[string]struct {
		PubKey     string `json:"pubKey"`
		Parameters struct {
			// MarketBase                              string `json:"marketBase"`
			// MarketQuote                             string `json:"marketQuote"`
			SettlementERC20TokenAddress string `json:"marketSettlementEthereumContractAddress"`
			SettlementVegaAssetID       string `json:"marketSettlementVegaAssetID"`
		} `json:"parameters"`
	} `json:"traders"`
}

type Traders

type Traders struct {
	ByERC20TokenHexAddress map[string][]string
	ByFakeAssetId          map[string][]string
}

Jump to

Keyboard shortcuts

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