cli

package
v0.27.4 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearContractAdminCmd

func ClearContractAdminCmd() *cobra.Command

ClearContractAdminCmd clears an admin for a contract

func ExecuteContractCmd

func ExecuteContractCmd() *cobra.Command

ExecuteContractCmd will instantiate a contract from previously uploaded code.

func GenesisExecuteContractCmd

func GenesisExecuteContractCmd(defaultNodeHome string, genesisMutator GenesisMutator) *cobra.Command

GenesisExecuteContractCmd cli command to add a `MsgExecuteContract` to the wasm section of the genesis that is executed on block 0.

func GenesisInstantiateContractCmd

func GenesisInstantiateContractCmd(defaultNodeHome string, genesisMutator GenesisMutator) *cobra.Command

GenesisInstantiateContractCmd cli command to add a `MsgInstantiateContract` to the wasm section of the genesis that is executed on block 0.

func GenesisListCodesCmd

func GenesisListCodesCmd(defaultNodeHome string, genReader GenesisReader) *cobra.Command

GenesisListCodesCmd cli command to list all codes stored in the genesis wasm.code section as well as from messages that are queued in the wasm.genMsgs section.

func GenesisListContractsCmd

func GenesisListContractsCmd(defaultNodeHome string, genReader GenesisReader) *cobra.Command

GenesisListContractsCmd cli command to list all contracts stored in the genesis wasm.contract section as well as from messages that are queued in the wasm.genMsgs section.

func GenesisStoreCodeCmd

func GenesisStoreCodeCmd(defaultNodeHome string, genesisMutator GenesisMutator) *cobra.Command

GenesisStoreCodeCmd cli command to add a `MsgStoreCode` to the wasm section of the genesis that is executed on block 0.

func GetCmdGetContractHistory

func GetCmdGetContractHistory() *cobra.Command

GetCmdGetContractHistory prints the code history for a given contract

func GetCmdGetContractInfo

func GetCmdGetContractInfo() *cobra.Command

GetCmdGetContractInfo gets details about a given contract

func GetCmdGetContractState

func GetCmdGetContractState() *cobra.Command

GetCmdGetContractState dumps full internal state of a given contract

func GetCmdGetContractStateAll

func GetCmdGetContractStateAll() *cobra.Command

func GetCmdGetContractStateRaw

func GetCmdGetContractStateRaw() *cobra.Command

func GetCmdGetContractStateSmart

func GetCmdGetContractStateSmart() *cobra.Command

func GetCmdLibVersion

func GetCmdLibVersion() *cobra.Command

GetCmdLibVersion gets current libwasmvm version.

func GetCmdListCode

func GetCmdListCode() *cobra.Command

GetCmdListCode lists all wasm code uploaded

func GetCmdListContractByCode

func GetCmdListContractByCode() *cobra.Command

GetCmdListContractByCode lists all wasm code uploaded for given code id

func GetCmdListPinnedCode

func GetCmdListPinnedCode() *cobra.Command

GetCmdListPinnedCode lists all wasm code ids that are pinned

func GetCmdQueryCode

func GetCmdQueryCode() *cobra.Command

GetCmdQueryCode returns the bytecode for a given contract

func GetCmdQueryCodeInfo

func GetCmdQueryCodeInfo() *cobra.Command

GetCmdQueryCodeInfo returns the code info for a given code id

func GetQueryCmd

func GetQueryCmd() *cobra.Command

func GetTxCmd

func GetTxCmd() *cobra.Command

GetTxCmd returns the transaction commands for this module

func InstantiateContractCmd

func InstantiateContractCmd() *cobra.Command

InstantiateContractCmd will instantiate a contract from previously uploaded code.

func MigrateContractCmd

func MigrateContractCmd() *cobra.Command

MigrateContractCmd will migrate a contract to a new code version

func ProposalClearContractAdminCmd

func ProposalClearContractAdminCmd() *cobra.Command

func ProposalExecuteContractCmd

func ProposalExecuteContractCmd() *cobra.Command

func ProposalInstantiateContractCmd

func ProposalInstantiateContractCmd() *cobra.Command

func ProposalMigrateContractCmd

func ProposalMigrateContractCmd() *cobra.Command

func ProposalPinCodesCmd

func ProposalPinCodesCmd() *cobra.Command

func ProposalStoreCodeCmd

func ProposalStoreCodeCmd() *cobra.Command

func ProposalSudoContractCmd

func ProposalSudoContractCmd() *cobra.Command

func ProposalUnpinCodesCmd

func ProposalUnpinCodesCmd() *cobra.Command

func ProposalUpdateContractAdminCmd

func ProposalUpdateContractAdminCmd() *cobra.Command

func ProposalUpdateInstantiateConfigCmd

func ProposalUpdateInstantiateConfigCmd() *cobra.Command

func StoreCodeCmd

func StoreCodeCmd() *cobra.Command

StoreCodeCmd will upload code to be reused.

func UpdateContractAdminCmd

func UpdateContractAdminCmd() *cobra.Command

UpdateContractAdminCmd sets an new admin for a contract

Types

type CodeMeta

type CodeMeta struct {
	CodeID uint64         `json:"code_id"`
	Info   types.CodeInfo `json:"info"`
}

func GetAllCodes

func GetAllCodes(state *types.GenesisState) ([]CodeMeta, error)

type ContractMeta

type ContractMeta struct {
	ContractAddress string             `json:"contract_address"`
	Info            types.ContractInfo `json:"info"`
}

func GetAllContracts

func GetAllContracts(state *types.GenesisState) []ContractMeta

type DefaultGenesisIO

type DefaultGenesisIO struct {
	DefaultGenesisReader
}

DefaultGenesisIO implements both interfaces to read and modify the genesis state for this module. This implementation uses the default data structure that is used by the module.go genesis import/ export.

func NewDefaultGenesisIO

func NewDefaultGenesisIO() *DefaultGenesisIO

NewDefaultGenesisIO constructor to create a new instance

func (DefaultGenesisIO) AlterWasmModuleState

func (x DefaultGenesisIO) AlterWasmModuleState(cmd *cobra.Command, callback func(state *types.GenesisState, appState map[string]json.RawMessage) error) error

AlterWasmModuleState loads the genesis from the default or set home dir, unmarshalls the wasm module section into the object representation calls the callback function to modify it and marshals the modified state back into the genesis file

type DefaultGenesisReader

type DefaultGenesisReader struct{}

func (DefaultGenesisReader) ReadWasmGenesis

func (d DefaultGenesisReader) ReadWasmGenesis(cmd *cobra.Command) (*GenesisData, error)

type GenesisData

type GenesisData struct {
	GenesisFile     string
	GenDoc          *tmtypes.GenesisDoc
	AppState        map[string]json.RawMessage
	WasmModuleState *types.GenesisState
}

GenesisData contains raw and unmarshalled data from the genesis file

func NewGenesisData

func NewGenesisData(genesisFile string, genDoc *tmtypes.GenesisDoc, appState map[string]json.RawMessage, wasmModuleState *types.GenesisState) *GenesisData

type GenesisMutator

type GenesisMutator interface {
	// AlterWasmModuleState loads the genesis from the default or set home dir,
	// unmarshalls the wasm module section into the object representation
	// calls the callback function to modify it
	// and marshals the modified state back into the genesis file
	AlterWasmModuleState(cmd *cobra.Command, callback func(state *types.GenesisState, appState map[string]json.RawMessage) error) error
}

GenesisMutator extension point to modify the wasm module genesis state. This gives flexibility to customize the data structure in the genesis file a bit.

type GenesisReader

type GenesisReader interface {
	ReadWasmGenesis(cmd *cobra.Command) (*GenesisData, error)
}

GenesisReader reads genesis data. Extension point for custom genesis state readers.

Jump to

Keyboard shortcuts

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