cli

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyringBackend = integrationcli.KeyringBackend
	OutputFormat   = integrationcli.OutputFormat
	Gas            = integrationcli.Gas
	GasAdjustment  = integrationcli.GasAdjustment
	GasPrices      = integrationcli.GasPrices

	BootstrapPeriod            = 20
	BootstrapHeight            = 1
	VotingPeriod         int64 = 10
	ExpectedBlockSeconds int64 = 1
	ExtraBlocks          int64 = 5
	UpgradeName                = cheqdapp.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
)

Variables

View Source
var (
	TXParams = []string{
		"--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,
	}
)

Functions

func CalculateUpgradeHeight

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

func CreateDid

func CreateDid(payload cli.DIDDocument, signInputs []cli.SignInput, container, versionID, fees string) (sdk.TxResponse, error)

func CreateDidLegacy

func CreateDidLegacy(payload didtypesv1.MsgCreateDidPayload, signInputs []cli.SignInput, container string) (sdk.TxResponse, error)

func CreateResource

func CreateResource(payload types.MsgCreateResourcePayload, resourceFile string, signInputs []cli.SignInput, container, fees string) (sdk.TxResponse, error)

func CreateResourceLegacy

func CreateResourceLegacy(collectionID string, resourceID string, resourceName string, resourceType string, resourceFile string, signInputs []cli.SignInput, container string) (sdk.TxResponse, error)

func DeactivateDid

func DeactivateDid(payload didtypesv2.MsgDeactivateDidDocPayload, signInputs []cli.SignInput, container string, fees string) (sdk.TxResponse, error)

func DeactivateDidLegacy

func DeactivateDidLegacy(payload didtypesv1.MsgDeactivateDidPayload, signInputs []cli.SignInput, container string) (sdk.TxResponse, error)

func DepositGov

func DepositGov(container string) (sdk.TxResponse, error)

func Exec

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

func ExecDirect

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

func ExecWithEnv

func ExecWithEnv(env []string, args ...string) (string, error)

func GetCurrentBlockHeight

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

func GetVotingEndHeight

func GetVotingEndHeight(currentHeight int64) (int64, 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(container string, binary string, module, query string, queryArgs ...string) (string, error)

func QueryDid

func QueryDid(did string, container string) (didtypesv2.QueryDidDocResponse, error)

func QueryDidFeeParams

func QueryDidFeeParams(container, subspace, key string) (didtypes.FeeParams, error)

func QueryDidLegacy

func QueryDidLegacy(did string, container string) (didtypesv1.QueryGetDidResponse, error)

func QueryModuleVersionMap

func QueryModuleVersionMap(container string) (upgradetypes.QueryModuleVersionsResponse, error)

func QueryParams

func QueryParams(container, subspace, key string) (paramproposal.ParamChange, error)

func QueryProposal

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

func QueryProposalLegacy

func QueryProposalLegacy(container, id string) (govtypesv1beta1.Proposal, error)

func QueryResource

func QueryResource(collectionID string, resourceID string, container string) (resourcetypesv2.QueryResourceResponse, error)

func QueryResourceFeeParams

func QueryResourceFeeParams(container, subspace, key string) (resourcetypes.FeeParams, error)

func QueryResourceLegacy

func QueryResourceLegacy(collectionID string, resourceID string, container string) (resourcetypesv1.QueryResourceResponse, error)

func SubmitParamChangeProposal

func SubmitParamChangeProposal(container string, pathToDir ...string) (sdk.TxResponse, error)

func SubmitUpgradeProposal

func SubmitUpgradeProposal(upgradeHeight int64, container string) (sdk.TxResponse, error)

func TrimExtraLineOffset

func TrimExtraLineOffset(input string, offset int) string

func Tx

func Tx(container string, binary string, module, tx, from string, txArgs ...string) (sdk.TxResponse, error)

func UpdateDid

func UpdateDid(payload cli.DIDDocument, signInputs []cli.SignInput, container, versionID, fees string) (sdk.TxResponse, error)

func UpdateDidLegacy

func UpdateDidLegacy(payload didtypesv1.MsgUpdateDidPayload, signInputs []cli.SignInput, container string) (sdk.TxResponse, error)

func VoteProposal

func VoteProposal(container, id, option 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 DefaultNodeInfo

type DefaultNodeInfo struct {
	ProtocolVersion ProtocolVersion      `json:"protocol_version"`
	ID              string               `json:"id"`
	ListenAddr      string               `json:"listen_addr"`
	Network         string               `json:"network"`
	Version         string               `json:"version"`
	Channels        tmbytes.HexBytes     `json:"channels"`
	Moniker         string               `json:"moniker"`
	Other           DefaultNodeInfoOther `json:"other"`
}

type DefaultNodeInfoOther

type DefaultNodeInfoOther struct {
	TxIndex    string `json:"tx_index"`
	RPCAddress string `json:"rpc_address"`
}

type NodeStatus

type NodeStatus struct {
	NodeInfo      DefaultNodeInfo `json:"NodeInfo"`
	SyncInfo      SyncInfo        `json:"SyncInfo"`
	ValidatorInfo ValidatorInfo   `json:"ValidatorInfo"`
}

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 added in v1.1.0

type OperatorAccountType map[string]string

type ProtocolVersion

type ProtocolVersion struct {
	P2P   uint64 `json:"p2p,string"`
	Block uint64 `json:"block,string"`
	App   uint64 `json:"app,string"`
}

type SyncInfo

type SyncInfo struct {
	LatestBlockHash   tmbytes.HexBytes `json:"latest_block_hash"`
	LatestAppHash     tmbytes.HexBytes `json:"latest_app_hash"`
	LatestBlockHeight int64            `json:"latest_block_height,string"`
	LatestBlockTime   time.Time        `json:"latest_block_time"`

	EarliestBlockHash   tmbytes.HexBytes `json:"earliest_block_hash"`
	EarliestAppHash     tmbytes.HexBytes `json:"earliest_app_hash"`
	EarliestBlockHeight int64            `json:"earliest_block_height,string"`
	EarliestBlockTime   time.Time        `json:"earliest_block_time"`

	CatchingUp bool `json:"catching_up"`
}

type ValidatorInfo

type ValidatorInfo struct {
	Address     tmbytes.HexBytes `json:"Address"`
	PubKey      interface{}      `json:"PubKey"`
	VotingPower int64            `json:"VotingPower,string"`
}

Jump to

Keyboard shortcuts

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