Documentation ¶
Index ¶
- Constants
- func AddGenesisAccountCmd(defaultNodeHome string) *cobra.Command
- func DecodeBase64Cmd(defaultNodeHome string) *cobra.Command
- func GetBuildWasmMsg() *cobra.Command
- func InitCmd(mbm module.BasicManager, defaultNodeHome string) *cobra.Command
- func InitTestnet(clientCtx client.Context, cmd *cobra.Command, nodeConfig *tmconfig.Config, ...) error
- func NewRootCmd() (*cobra.Command, app.EncodingConfig)
- func YieldStargateMsgs(jsonBz []byte) (sgMsgs []wasmvm.StargateMsg, err error)
- type StargateMsgDecoded
Constants ¶
const ( // FlagOverwrite defines a flag to overwrite an existing genesis JSON file. FlagOverwrite = "overwrite" // FlagSeed defines a flag to initialize the private validator key from a specific seed. FlagRecover = "recover" // FlagDefaultBondDenom defines the default denom to use in the genesis file. FlagDefaultBondDenom = "default-denom" )
Variables ¶
This section is empty.
Functions ¶
func AddGenesisAccountCmd ¶
AddGenesisAccountCmd returns add-genesis-account cobra Command.
func DecodeBase64Cmd ¶ added in v1.0.3
DecodeBase64Cmd creates a Cobra command used to decode base64-encoded protobuf messages from a JSON input. This function enables users to input arbitrary JSON strings and parse the contents of base-64 encoded protobuf.Any messages.
func GetBuildWasmMsg ¶ added in v1.0.1
func InitCmd ¶ added in v0.16.1
func InitCmd(mbm module.BasicManager, defaultNodeHome string) *cobra.Command
InitCmd is a stand-in replacement for genutilcli.InitCmd that overwrites the consensus configutation in the `config.toml` prior to writing it to the disk. This helps keep consistency on between nodes without requiring extra work as much manual work for node operators.
InitCmd returns a command that initializes all files needed for Tendermint and the respective application.
Intended usage:
```go import genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" import "github.com/spf13/cobra" func initRootCmd(rootCmd *cobra.Command, encodingConfig app.EncodingConfig) { a := appCreator{encodingConfig} rootCmd.AddCommand( InitCmd(app.ModuleBasics, app.DefaultNodeHome), ) } ```
func InitTestnet ¶
func InitTestnet( clientCtx client.Context, cmd *cobra.Command, nodeConfig *tmconfig.Config, mbm module.BasicManager, genBalIterator banktypes.GenesisBalancesIterator, outputDir, chainID, minGasPrices, nodeDirPrefix, nodeDaemonHome, startingIPAddress, keyringBackend, algoStr string, numValidators int, ) error
Initialize the testnet
func NewRootCmd ¶
func NewRootCmd() (*cobra.Command, app.EncodingConfig)
NewRootCmd creates a new root command for nibid. It is called once in the main function.
func YieldStargateMsgs ¶ added in v1.0.3
func YieldStargateMsgs(jsonBz []byte) (sgMsgs []wasmvm.StargateMsg, err error)
YieldStargateMsgs takes a byte slice of JSON data and converts it into a slice of wasmvm.StargateMsg objects. This function is essential for processing JSON-formatted messages that contain base64-encoded protobuf messages.
Args:
- jsonBz []byte: A byte slice containing the JSON data to be parsed.
Returns:
- sgMsgs []wasmvm.StargateMsg: A slice of wasmvm.StargateMsg objects parsed from the provided JSON data.
- err error: An error object, which is nil if the operation is successful.
Types ¶
type StargateMsgDecoded ¶ added in v1.0.3
StargateMsgDecoded is a struct designed to hold a decoded version of a "wasmvm.StargateMsg".
func DecodeBase64StargateMsgs ¶ added in v1.0.3
func DecodeBase64StargateMsgs( jsonBz []byte, clientCtx client.Context, ) (newSgMsgs []StargateMsgDecoded, err error)
DecodeBase64StargateMsgs decodes a series of base64-encoded wasmvm.StargateMsg objects from the provided JSON byte slice (jsonBz). This function is vital for extracting and interpreting the contents of these protobuf messages.
Args:
- jsonBz []byte: JSON data containing potential base64-encoded messages.
- clientCtx client.Context: Context for the `nibid` CLI.
Returns:
- newSgMsgs []StargateMsgDecoded: The decoded stargate messages.
- err error: An error object, which is nil if the operation is successful.