cli

package
v1.4.6-pseudo-version-... Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyringBackend = "test"
	OutputFormat   = "json"
	Gas            = "auto"
	GasAdjustment  = "3.5"
	GasPrices      = "10000ncheq"
)
View Source
const (
	Green  = "\033[32m"
	Purple = "\033[35m"
)
View Source
const (
	BootstrapPeriod            = 20
	BootstrapHeight            = 1
	VotingPeriod         int64 = 10
	ExpectedBlockSeconds int64 = 1
	ExtraBlocks          int64 = 10
	UpgradeName                = upgradeV3.UpgradeName
	DepositAmount              = "10000000ncheq"
	NetworkConfigDir           = "network-config"
	KeyringDir                 = "keyring-test"
)
View Source
const (
	DockerLocalnetPath = "../../docker/localnet"
	DockerComposeFile  = "docker-compose.yml"
	DockerComposeEnvML = "mainnet-latest.env"
	DockerComposeEnvBL = "build-latest.env"
	Docker             = "docker"
	DockerCompose      = "compose"
	DockerHome         = "/home/cheqd"
	DockerUser         = "cheqd"
	DockerUserGroup    = "cheqd"
	Operator0          = "operator-0"
	Operator1          = "operator-1"
	Operator2          = "operator-2"
	Operator3          = "operator-3"
	Validator0         = "validator-0"
	Validator1         = "validator-1"
	Validator2         = "validator-2"
	Validator3         = "validator-3"
	ValidatorsCount    = 4
)
View Source
const CliBinaryName = "cheqd-noded"
View Source
const (
	FlagVersionID = "--version-id"
)

Variables

View Source
var (
	TXParams = []string{
		"--output", OutputFormat,
		"--keyring-backend", KeyringBackend,
		"--chain-id", integrationnetwork.ChainID,
		"-y",
	}
	GasParams = []string{
		"--gas", Gas,
		"--gas-adjustment", GasAdjustment,
		"--gas-prices", GasPrices,
	}
	QueryParamsConst = []string{
		"--chain-id", integrationnetwork.ChainID,
		"--output", OutputFormat,
	}
)
View Source
var CLIQueryParams = []string{
	"--chain-id", network.ChainID,
	"--output", OutputFormat,
}
View Source
var CLITxParams = []string{
	"--chain-id", network.ChainID,
	"--keyring-backend", KeyringBackend,
	"--output", OutputFormat,
	"--yes",
}
View Source
var CliGasParams = []string{
	"--gas", Gas,
	"--gas-adjustment", GasAdjustment,
	"--gas-prices", GasPrices,
}
View Source
var KeyParams = []string{
	"--output", OutputFormat,
	"--keyring-backend", KeyringBackend,
}

Functions

func BroadcastTx

func BroadcastTx(tmpDir, signedTxJSON string) (sdk.TxResponse, error)

func BurnMsg

func BurnMsg(from string, coins string, feeParams []string) (sdk.TxResponse, error)

func CalculateUpgradeHeight

func CalculateUpgradeHeight(container string, binary string) (int64, int64, error)

func CreateDidDoc

func CreateDidDoc(tmpDir string, payload cli.DIDDocument, signInputs []cli.SignInput, versionID, from string, feeParams []string) (sdk.TxResponse, error)

func CreateResource

func CreateResource(tmpDir string, payload resourcetypes.MsgCreateResourcePayload, signInputs []cli.SignInput, dataFile, from string, feeParams []string) (sdk.TxResponse, error)

func DeactivateDidDoc

func DeactivateDidDoc(tmpDir string, payload types.MsgDeactivateDidDocPayload, signInputs []cli.SignInput, versionID, from string, feeParams []string) (sdk.TxResponse, error)

func Exec

func Exec(args ...string) (string, error)

func GetCurrentBlockHeight

func GetCurrentBlockHeight(container string, binary string) (int64, error)

func GetProposalID

func GetProposalID(events []abcitypes.Event) (string, error)

func GetVotingEndHeight

func GetVotingEndHeight(currentHeight int64) (int64, error)

func GrantFees

func GrantFees(granter, grantee string, feeParams []string) (sdk.TxResponse, error)

func IBCAcknowledgementTx

func IBCAcknowledgementTx(tmpDir string, from string, ack json.RawMessage, gasLimit uint64) (sdk.TxResponse, error)

func IBCRecvPacketTx

func IBCRecvPacketTx(tmpDir string, from string, msg json.RawMessage, gasLimit uint64) (sdk.TxResponse, error)

func IBCTimeoutTx

func IBCTimeoutTx(tmpDir string, from string, msg json.RawMessage, gasLimit uint64) (sdk.TxResponse, error)

func IBCUpdateClientTx

func IBCUpdateClientTx(tmpDir string, from string, msg json.RawMessage, gasLimit uint64) (sdk.TxResponse, error)

func LocalnetExec

func LocalnetExec(envArgs []string, args ...string) (string, error)

func LocalnetExecCopyAbsoluteWithPermissions

func LocalnetExecCopyAbsoluteWithPermissions(path string, destination string, container string) (string, error)

func LocalnetExecDown

func LocalnetExecDown() (string, error)

func LocalnetExecExec

func LocalnetExecExec(container string, args ...string) (string, error)

func LocalnetExecRestorePermissions

func LocalnetExecRestorePermissions(path string, container string) (string, error)

func LocalnetExecUp

func LocalnetExecUp() (string, error)

func MakeCodecWithExtendedRegistry

func MakeCodecWithExtendedRegistry() codec.Codec

func Query

func Query(module, query string, queryArgs ...string) (string, error)

func QueryBalance

func QueryBalance(address, denom string) (sdk.Coin, error)

func QueryBypassMessages

func QueryBypassMessages() ([]string, error)

func QueryDidDoc

func QueryDidDoc(did string) (didtypes.QueryDidDocResponse, error)

func QueryDidParams

func QueryDidParams() (didtypes.QueryParamsResponse, error)

func QueryFeemarketGasPrice

func QueryFeemarketGasPrice(denom string) (feemarkettypes.GasPriceResponse, error)

func QueryFeemarketGasPrices

func QueryFeemarketGasPrices() (feemarkettypes.GasPricesResponse, error)

func QueryFeemarketParams

func QueryFeemarketParams() (feemarkettypes.Params, error)

func QueryKeys

func QueryKeys(name string) (string, error)

QueryKeys retrieves the key information and extracts the address

func QueryProposal

func QueryProposal(container, id string) (govtypesv1.Proposal, error)

func QueryResource

func QueryResource(collectionID string, resourceID string) (resourcetypes.QueryResourceResponse, error)

func QueryResourceCollection

func QueryResourceCollection(collectionID string) (resourcetypes.QueryCollectionResourcesResponse, error)

func QueryResourceMetadata

func QueryResourceMetadata(collectionID string, resourceID string) (resourcetypes.QueryResourceMetadataResponse, error)

func QueryResourceParams

func QueryResourceParams() (resourcetypes.QueryParamsResponse, error)

func QueryTxn

func QueryTxn(hash string) (sdk.TxResponse, error)

func RevokeFeeGrant

func RevokeFeeGrant(granter, grantee string, feeParams []string) (sdk.TxResponse, error)

func SendTokensTx

func SendTokensTx(from, to, amount string, feeParams []string) (sdk.TxResponse, error)

func SignTx

func SignTx(tmpDir, from string, msg json.RawMessage, fee sdk.Coins, gasLimit uint64) (string, error)

func SubmitProposalTx

func SubmitProposalTx(from, pathToDir string, feeParams []string) (sdk.TxResponse, error)

func TrimExtraLineOffset

func TrimExtraLineOffset(input string, offset int) string

func Tx

func Tx(module, tx, from string, feeParams []string, txArgs ...string) (sdk.TxResponse, error)

func UpdateDidDoc

func UpdateDidDoc(tmpDir string, payload cli.DIDDocument, signInputs []cli.SignInput, versionID, from string, feeParams []string) (sdk.TxResponse, error)

func VoteProposalTx

func VoteProposalTx(from, option, id string, feeParams []string) (sdk.TxResponse, error)

func WaitForCaughtUp

func WaitForCaughtUp(container string, binary string, period int64) error

func WaitForChainHeight

func WaitForChainHeight(container string, binary string, height int64, period int64) error

Added to wait for the upgrade to be applied. NOTE: This can be extended to run concurrent waits for multiple containers.

Types

type NodeStatus

type NodeStatus struct {
	SyncInfo SyncInfo `json:"sync_info"`
}

The following structs are overridden from the tendermint codebase. They are used to parse the output of the `status` command. We need to override them because the tendermint codebase types are overridden by the cosmos-sdk codebase types. Also, ValidatorInfo.PubKey is replaced with cosmos-sdk crypto.PubKey, hence it needs to be parsed accordingly.

func GetNodeStatus

func GetNodeStatus(container string, binary string) (NodeStatus, error)

type OperatorAccountType

type OperatorAccountType map[string]string

type SyncInfo

type SyncInfo struct {
	LatestBlockHeight int64 `json:"latest_block_height,string"`
	CatchingUp        bool  `json:"catching_up"`
}

Jump to

Keyboard shortcuts

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