tools

package
v0.75.8 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsIntStringFromFloat added in v0.73.9

func AsIntStringFromFloat(amount *big.Float) string

func CopyDir

func CopyDir(src, dst string) error

CopyDir copies the content of src to dst. src should be a full path.

func CopyFile

func CopyFile(src, dst string) (int64, error)

func CurrentUserHomePath

func CurrentUserHomePath() string

func ExecuteBinary

func ExecuteBinary(binaryPath string, args []string, structuredOutput interface{}) ([]byte, error)

func FileExists

func FileExists(filePath string) bool

func FormatAssetName added in v0.73.9

func FormatAssetName(name string, extension string) string

func GetIP

func GetIP(host string) (string, error)

func RandAlphaNumericString added in v0.73.9

func RandAlphaNumericString(l int) string

func ReadStructuredFileValue

func ReadStructuredFileValue(format, filePath, selector string) (string, error)

func RetryReturn

func RetryReturn[K any](retryAmount int, retryDelay time.Duration, handler func() (K, error)) (K, error)

func RetryRun

func RetryRun(retryAmount int, retryDelay time.Duration, handler func() error) error

func StrToIntOrDefault added in v0.73.9

func StrToIntOrDefault(s string, defaultValue int) int

func StructSize added in v0.73.9

func StructSize[T any](variable T) int

func WhoAmI

func WhoAmI() (string, error)

Types

type NetInfo

type NetInfo struct {
	Peers []struct {
		NodeInfo NodeInfo `json:"node_info"`
		RemoteIp string   `json:"remote_ip"`
	} `json:"peers"`
}

type NodeInfo

type NodeInfo struct {
	TendermintNodeId string `json:"id"`
	Moniker          string `json:"moniker"`
	ListenAddr       string `json:"listen_addr"`
}

type Status

type Status struct {
	NodeInfo      NodeInfo `json:"node_info"`
	ValidatorInfo struct {
		VotingPower int64 `json:"voting_power,string"`
	} `json:"validator_info"`
}

type TendermintRESTClient

type TendermintRESTClient struct {
	// contains filtered or unexported fields
}

func NewTendermintRESTClient

func NewTendermintRESTClient() *TendermintRESTClient

func (*TendermintRESTClient) GetNodeNetInfo

func (c *TendermintRESTClient) GetNodeNetInfo(endpoint string) (*NetInfo, error)

func (*TendermintRESTClient) GetNodeStatus

func (c *TendermintRESTClient) GetNodeStatus(endpoint string) (*Status, error)

Jump to

Keyboard shortcuts

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