cmd

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeLayout = "2006-01-02 15:04:05"
	Auto       = "auto"
	Manual     = "manual"
)

Define the layout that matches the provided date string Note: the reference time is "Mon Jan 2 15:04:05 MST 2006" in Go

Variables

View Source
var (
	ErrInvalidArgs       = errors.New("invalid args")
	ErrMissingSubcommand = errors.New("must specify a subcommand")
	ErrInvalidAddress    = errors.New("invalid address")
	ErrInvalidKeyType    = errors.New("invalid key type")
	ErrMustFill          = errors.New("must fill")
)

Functions

func Execute

func Execute() error

func ReadCLIFile

func ReadCLIFile(cliPath string) (ids.ID, map[string]string, error)

Types

type ClusterInfo

type ClusterInfo struct {
	ChainID  string `yaml:"CHAIN_ID"` // ids.ID requires "first and last characters to be quotes"
	SubnetID string `yaml:"SUBNET_ID"`
	APIs     []struct {
		CloudID string `yaml:"CLOUD_ID"`
		IP      string `yaml:"IP"`
		Region  string `yaml:"REGION"`
	} `yaml:"API"`
	Validators []struct {
		CloudID string `yaml:"CLOUD_ID"`
		IP      string `yaml:"IP"`
		Region  string `yaml:"REGION"`
		NodeID  string `yaml:"NODE_ID"`
	} `yaml:"VALIDATOR"`
}

type Controller

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

func NewController

func NewController(databasePath string) *Controller

func (*Controller) Address

func (*Controller) Address(addr codec.Address) string

func (*Controller) DatabasePath

func (c *Controller) DatabasePath() string

func (*Controller) Decimals

func (*Controller) Decimals() uint8

func (*Controller) ParseAddress

func (*Controller) ParseAddress(address string) (codec.Address, error)

func (*Controller) Symbol

func (*Controller) Symbol() string

type Handler

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

func NewHandler

func NewHandler(h *cli.Handler) *Handler

func (*Handler) DefaultNuklaiVMJSONRPCClient

func (h *Handler) DefaultNuklaiVMJSONRPCClient(checkAllChains bool) ([]*nrpc.JSONRPCClient, error)

func (*Handler) GetAllValidators

func (*Handler) GetAllValidators(
	ctx context.Context,
	cli *nrpc.JSONRPCClient,
) ([]*emission.Validator, error)

func (*Handler) GetAssetInfo

func (*Handler) GetAssetInfo(
	ctx context.Context,
	ncli *nrpc.JSONRPCClient,
	addr codec.Address,
	assetID ids.ID,
	checkBalance bool,
) ([]byte, uint8, uint64, ids.ID, error)

func (*Handler) GetEmissionInfo

func (*Handler) GetEmissionInfo(
	ctx context.Context,
	cli *nrpc.JSONRPCClient,
) (uint64, uint64, uint64, uint64, uint64, uint64, string, uint64, error)

func (*Handler) GetStakedValidators

func (*Handler) GetStakedValidators(
	ctx context.Context,
	cli *nrpc.JSONRPCClient,
) ([]*emission.Validator, error)

func (*Handler) GetUserStake

func (*Handler) GetUserStake(ctx context.Context,
	cli *nrpc.JSONRPCClient, owner codec.Address, nodeID ids.NodeID,
) (uint64, uint64, uint64, string, string, error)

func (*Handler) GetValidatorStake

func (*Handler) GetValidatorStake(
	ctx context.Context,
	cli *nrpc.JSONRPCClient,
	nodeID ids.NodeID,
) (uint64, uint64, uint64, uint64, string, string, error)

func (*Handler) ImportCLI

func (h *Handler) ImportCLI(cliPath string) error

func (*Handler) Root

func (h *Handler) Root() *cli.Handler

Jump to

Keyboard shortcuts

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