Merge PR #4372: Use Build's Client/Server Name
This commit is contained in:
parent
71d71f2206
commit
cfe31c4090
|
@ -51,7 +51,7 @@ func NewContext(config *cfg.Config, logger log.Logger) *Context {
|
||||||
// logger and config object.
|
// logger and config object.
|
||||||
func PersistentPreRunEFn(context *Context) func(*cobra.Command, []string) error {
|
func PersistentPreRunEFn(context *Context) func(*cobra.Command, []string) error {
|
||||||
return func(cmd *cobra.Command, args []string) error {
|
return func(cmd *cobra.Command, args []string) error {
|
||||||
if cmd.Name() == version.VersionCmd.Name() {
|
if cmd.Name() == version.Cmd.Name() {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
config, err := interceptLoadConfig()
|
config, err := interceptLoadConfig()
|
||||||
|
@ -152,7 +152,7 @@ func AddCommands(
|
||||||
tendermintCmd,
|
tendermintCmd,
|
||||||
ExportCmd(ctx, cdc, appExport),
|
ExportCmd(ctx, cdc, appExport),
|
||||||
client.LineBreak,
|
client.LineBreak,
|
||||||
version.VersionCmd,
|
version.Cmd,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,15 +10,14 @@ import (
|
||||||
"github.com/tendermint/tendermint/libs/cli"
|
"github.com/tendermint/tendermint/libs/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const flagLong = "long"
|
||||||
flagLong = "long"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
func init() {
|
||||||
|
Cmd.Flags().Bool(flagLong, false, "Print long version information")
|
||||||
|
}
|
||||||
|
|
||||||
// VersionCmd prints out the application's version
|
// Cmd prints out the application's version information passed via build flags.
|
||||||
// information passed via build flags.
|
var Cmd = &cobra.Command{
|
||||||
VersionCmd = &cobra.Command{
|
|
||||||
Use: "version",
|
Use: "version",
|
||||||
Short: "Print the app version",
|
Short: "Print the app version",
|
||||||
RunE: func(_ *cobra.Command, _ []string) error {
|
RunE: func(_ *cobra.Command, _ []string) error {
|
||||||
|
@ -41,9 +40,4 @@ var (
|
||||||
fmt.Println(string(bz))
|
fmt.Println(string(bz))
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
VersionCmd.Flags().Bool(flagLong, false, "Print long version information")
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// This package is a convenience utility that provides SDK
|
// Package version is a convenience utility that provides SDK
|
||||||
// consumers with a ready-to-use version command that
|
// consumers with a ready-to-use version command that
|
||||||
// produces apps versioning information based on flags
|
// produces apps versioning information based on flags
|
||||||
// passed at compile time.
|
// passed at compile time.
|
||||||
|
@ -9,7 +9,9 @@
|
||||||
// At build time, the variables Name, Version, Commit, and BuildTags
|
// At build time, the variables Name, Version, Commit, and BuildTags
|
||||||
// can be passed as build flags as shown in the following example:
|
// can be passed as build flags as shown in the following example:
|
||||||
//
|
//
|
||||||
// go build -X github.com/cosmos/cosmos-sdk/version.Name=dapp \
|
// go build -X github.com/cosmos/cosmos-sdk/version.Name=gaia \
|
||||||
|
// -X github.com/cosmos/cosmos-sdk/version.ServerName=gaiad \
|
||||||
|
// -X github.com/cosmos/cosmos-sdk/version.ClientName=gaiacli \
|
||||||
// -X github.com/cosmos/cosmos-sdk/version.Version=1.0 \
|
// -X github.com/cosmos/cosmos-sdk/version.Version=1.0 \
|
||||||
// -X github.com/cosmos/cosmos-sdk/version.Commit=f0f7b7dab7e36c20b757cebce0e8f4fc5b95de60 \
|
// -X github.com/cosmos/cosmos-sdk/version.Commit=f0f7b7dab7e36c20b757cebce0e8f4fc5b95de60 \
|
||||||
// -X "github.com/cosmos/cosmos-sdk/version.BuildTags=linux darwin amd64"
|
// -X "github.com/cosmos/cosmos-sdk/version.BuildTags=linux darwin amd64"
|
||||||
|
@ -21,20 +23,26 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// Application's name
|
// application's name
|
||||||
Name = ""
|
Name = ""
|
||||||
// Application's version string
|
// server binary name
|
||||||
|
ServerName = "<appd>"
|
||||||
|
// client binary name
|
||||||
|
ClientName = "<appcli>"
|
||||||
|
// application's version string
|
||||||
Version = ""
|
Version = ""
|
||||||
// Commit
|
// commit
|
||||||
Commit = ""
|
Commit = ""
|
||||||
// Hash of the go.sum file
|
// hash of the go.sum file
|
||||||
GoSumHash = ""
|
GoSumHash = ""
|
||||||
// Build tags
|
// build tags
|
||||||
BuildTags = ""
|
BuildTags = ""
|
||||||
)
|
)
|
||||||
|
|
||||||
type versionInfo struct {
|
type versionInfo struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
|
ServerName string `json:"server_name"`
|
||||||
|
ClientName string `json:"client_name"`
|
||||||
Version string `json:"version"`
|
Version string `json:"version"`
|
||||||
GitCommit string `json:"commit"`
|
GitCommit string `json:"commit"`
|
||||||
BuildTags string `json:"build_tags"`
|
BuildTags string `json:"build_tags"`
|
||||||
|
@ -45,14 +53,19 @@ func (v versionInfo) String() string {
|
||||||
return fmt.Sprintf(`%s: %s
|
return fmt.Sprintf(`%s: %s
|
||||||
git commit: %s
|
git commit: %s
|
||||||
build tags: %s
|
build tags: %s
|
||||||
%s`, v.Name, v.Version, v.GitCommit, v.BuildTags, v.GoVersion)
|
%s`,
|
||||||
|
v.Name, v.Version, v.GitCommit, v.BuildTags, v.GoVersion,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func newVersionInfo() versionInfo {
|
func newVersionInfo() versionInfo {
|
||||||
return versionInfo{
|
return versionInfo{
|
||||||
Name,
|
Name: Name,
|
||||||
Version,
|
ServerName: ServerName,
|
||||||
Commit,
|
ClientName: ClientName,
|
||||||
BuildTags,
|
Version: Version,
|
||||||
fmt.Sprintf("go version %s %s/%s", runtime.Version(), runtime.GOOS, runtime.GOARCH)}
|
GitCommit: Commit,
|
||||||
|
BuildTags: BuildTags,
|
||||||
|
GoVersion: fmt.Sprintf("go version %s %s/%s", runtime.Version(), runtime.GOOS, runtime.GOARCH),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
@ -16,6 +17,7 @@ import (
|
||||||
"github.com/cosmos/cosmos-sdk/client/keys"
|
"github.com/cosmos/cosmos-sdk/client/keys"
|
||||||
"github.com/cosmos/cosmos-sdk/client/utils"
|
"github.com/cosmos/cosmos-sdk/client/utils"
|
||||||
crkeys "github.com/cosmos/cosmos-sdk/crypto/keys"
|
crkeys "github.com/cosmos/cosmos-sdk/crypto/keys"
|
||||||
|
"github.com/cosmos/cosmos-sdk/version"
|
||||||
"github.com/cosmos/cosmos-sdk/x/auth"
|
"github.com/cosmos/cosmos-sdk/x/auth"
|
||||||
authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder"
|
authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder"
|
||||||
)
|
)
|
||||||
|
@ -25,12 +27,14 @@ func GetMultiSignCommand(codec *amino.Codec) *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "multisign [file] [name] [[signature]...]",
|
Use: "multisign [file] [name] [[signature]...]",
|
||||||
Short: "Generate multisig signatures for transactions generated offline",
|
Short: "Generate multisig signatures for transactions generated offline",
|
||||||
Long: `Sign transactions created with the --generate-only flag that require multisig signatures.
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Sign transactions created with the --generate-only flag that require multisig signatures.
|
||||||
|
|
||||||
Read signature(s) from [signature] file(s), generate a multisig signature compliant to the
|
Read signature(s) from [signature] file(s), generate a multisig signature compliant to the
|
||||||
multisig key [name], and attach it to the transaction read from [file]. Example:
|
multisig key [name], and attach it to the transaction read from [file].
|
||||||
|
|
||||||
<appcli> multisign transaction.json k1k2k3 k1sig.json k2sig.json k3sig.json
|
Example:
|
||||||
|
$ %s multisign transaction.json k1k2k3 k1sig.json k2sig.json k3sig.json
|
||||||
|
|
||||||
If the flag --signature-only flag is on, it outputs a JSON representation
|
If the flag --signature-only flag is on, it outputs a JSON representation
|
||||||
of the generated signature only.
|
of the generated signature only.
|
||||||
|
@ -39,9 +43,13 @@ The --offline flag makes sure that the client will not reach out to an external
|
||||||
Thus account number or sequence number lookups will not be performed and it is
|
Thus account number or sequence number lookups will not be performed and it is
|
||||||
recommended to set such parameters manually.
|
recommended to set such parameters manually.
|
||||||
`,
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
RunE: makeMultiSignCmd(codec),
|
RunE: makeMultiSignCmd(codec),
|
||||||
Args: cobra.MinimumNArgs(3),
|
Args: cobra.MinimumNArgs(3),
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd.Flags().Bool(flagSigOnly, false, "Print only the generated signature, then exit")
|
cmd.Flags().Bool(flagSigOnly, false, "Print only the generated signature, then exit")
|
||||||
cmd.Flags().Bool(flagOffline, false, "Offline mode. Do not query a full node")
|
cmd.Flags().Bool(flagOffline, false, "Offline mode. Do not query a full node")
|
||||||
cmd.Flags().String(flagOutfile, "", "The document will be written to the given file instead of STDOUT")
|
cmd.Flags().String(flagOutfile, "", "The document will be written to the given file instead of STDOUT")
|
||||||
|
|
|
@ -10,6 +10,7 @@ import (
|
||||||
"github.com/cosmos/cosmos-sdk/client/context"
|
"github.com/cosmos/cosmos-sdk/client/context"
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/cosmos/cosmos-sdk/version"
|
||||||
distr "github.com/cosmos/cosmos-sdk/x/distribution"
|
distr "github.com/cosmos/cosmos-sdk/x/distribution"
|
||||||
"github.com/cosmos/cosmos-sdk/x/distribution/client/common"
|
"github.com/cosmos/cosmos-sdk/x/distribution/client/common"
|
||||||
"github.com/cosmos/cosmos-sdk/x/distribution/types"
|
"github.com/cosmos/cosmos-sdk/x/distribution/types"
|
||||||
|
@ -60,10 +61,15 @@ func GetCmdQueryValidatorCommission(queryRoute string, cdc *codec.Codec) *cobra.
|
||||||
Use: "commission [validator]",
|
Use: "commission [validator]",
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
Short: "Query distribution validator commission",
|
Short: "Query distribution validator commission",
|
||||||
Long: strings.TrimSpace(`Query validator commission rewards from delegators to that validator:
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Query validator commission rewards from delegators to that validator.
|
||||||
|
|
||||||
$ <appcli> query distr commission cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj
|
Example:
|
||||||
`),
|
$ %s query distr commission cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj
|
||||||
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||||
|
|
||||||
|
@ -90,10 +96,15 @@ func GetCmdQueryValidatorSlashes(queryRoute string, cdc *codec.Codec) *cobra.Com
|
||||||
Use: "slashes [validator] [start-height] [end-height]",
|
Use: "slashes [validator] [start-height] [end-height]",
|
||||||
Args: cobra.ExactArgs(3),
|
Args: cobra.ExactArgs(3),
|
||||||
Short: "Query distribution validator slashes",
|
Short: "Query distribution validator slashes",
|
||||||
Long: strings.TrimSpace(`Query all slashes of a validator for a given block range:
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Query all slashes of a validator for a given block range.
|
||||||
|
|
||||||
$ <appcli> query distr slashes cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj 0 100
|
Example:
|
||||||
`),
|
$ %s query distr slashes cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj 0 100
|
||||||
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||||
|
|
||||||
|
@ -136,11 +147,16 @@ func GetCmdQueryDelegatorRewards(queryRoute string, cdc *codec.Codec) *cobra.Com
|
||||||
Use: "rewards [delegator-addr] [<validator-addr>]",
|
Use: "rewards [delegator-addr] [<validator-addr>]",
|
||||||
Args: cobra.RangeArgs(1, 2),
|
Args: cobra.RangeArgs(1, 2),
|
||||||
Short: "Query all distribution delegator rewards or rewards from a particular validator",
|
Short: "Query all distribution delegator rewards or rewards from a particular validator",
|
||||||
Long: strings.TrimSpace(`Query all rewards earned by a delegator, optionally restrict to rewards from a single validator:
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Query all rewards earned by a delegator, optionally restrict to rewards from a single validator.
|
||||||
|
|
||||||
$ <appcli> query distr rewards cosmos1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p
|
Example:
|
||||||
$ <appcli> query distr rewards cosmos1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj
|
$ %s query distr rewards cosmos1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p
|
||||||
`),
|
$ %s query distr rewards cosmos1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj
|
||||||
|
`,
|
||||||
|
version.ClientName, version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||||
|
|
||||||
|
@ -175,10 +191,15 @@ func GetCmdQueryCommunityPool(queryRoute string, cdc *codec.Codec) *cobra.Comman
|
||||||
Use: "community-pool",
|
Use: "community-pool",
|
||||||
Args: cobra.NoArgs,
|
Args: cobra.NoArgs,
|
||||||
Short: "Query the amount of coins in the community pool",
|
Short: "Query the amount of coins in the community pool",
|
||||||
Long: strings.TrimSpace(`Query all coins in the community pool which is under Governance control.
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Query all coins in the community pool which is under Governance control.
|
||||||
|
|
||||||
$ <appcli> query distr community-pool
|
Example:
|
||||||
`),
|
$ %s query distr community-pool
|
||||||
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
package cli
|
package cli
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
@ -13,6 +14,7 @@ import (
|
||||||
"github.com/cosmos/cosmos-sdk/client/utils"
|
"github.com/cosmos/cosmos-sdk/client/utils"
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/cosmos/cosmos-sdk/version"
|
||||||
authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder"
|
authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/x/distribution/client/common"
|
"github.com/cosmos/cosmos-sdk/x/distribution/client/common"
|
||||||
|
@ -44,12 +46,18 @@ func GetTxCmd(storeKey string, cdc *amino.Codec) *cobra.Command {
|
||||||
func GetCmdWithdrawRewards(cdc *codec.Codec) *cobra.Command {
|
func GetCmdWithdrawRewards(cdc *codec.Codec) *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "withdraw-rewards [validator-addr]",
|
Use: "withdraw-rewards [validator-addr]",
|
||||||
Short: "witdraw rewards from a given delegation address, and optionally withdraw validator commission if the delegation address given is a validator operator",
|
Short: "Withdraw rewards from a given delegation address, and optionally withdraw validator commission if the delegation address given is a validator operator",
|
||||||
Long: strings.TrimSpace(`witdraw rewards from a given delegation address, and optionally withdraw validator commission if the delegation address given is a validator operator:
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Withdraw rewards from a given delegation address,
|
||||||
|
and optionally withdraw validator commission if the delegation address given is a validator operator.
|
||||||
|
|
||||||
$ <appcli> tx distr withdraw-rewards cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj --from mykey
|
Example:
|
||||||
$ <appcli> tx distr withdraw-rewards cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj --from mykey --commission
|
$ %s tx distr withdraw-rewards cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj --from mykey
|
||||||
`),
|
$ %s tx distr withdraw-rewards cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj --from mykey --commission
|
||||||
|
`,
|
||||||
|
version.ClientName, version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
txBldr := authtxb.NewTxBuilderFromCLI().WithTxEncoder(utils.GetTxEncoder(cdc))
|
txBldr := authtxb.NewTxBuilderFromCLI().WithTxEncoder(utils.GetTxEncoder(cdc))
|
||||||
|
@ -80,10 +88,15 @@ func GetCmdWithdrawAllRewards(cdc *codec.Codec, queryRoute string) *cobra.Comman
|
||||||
return &cobra.Command{
|
return &cobra.Command{
|
||||||
Use: "withdraw-all-rewards",
|
Use: "withdraw-all-rewards",
|
||||||
Short: "withdraw all delegations rewards for a delegator",
|
Short: "withdraw all delegations rewards for a delegator",
|
||||||
Long: strings.TrimSpace(`Withdraw all rewards for a single delegator:
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Withdraw all rewards for a single delegator.
|
||||||
|
|
||||||
$ <appcli> tx distr withdraw-all-rewards --from mykey
|
Example:
|
||||||
`),
|
$ %s tx distr withdraw-all-rewards --from mykey
|
||||||
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
Args: cobra.NoArgs,
|
Args: cobra.NoArgs,
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
|
|
||||||
|
@ -108,10 +121,15 @@ func GetCmdSetWithdrawAddr(cdc *codec.Codec) *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "set-withdraw-addr [withdraw-addr]",
|
Use: "set-withdraw-addr [withdraw-addr]",
|
||||||
Short: "change the default withdraw address for rewards associated with an address",
|
Short: "change the default withdraw address for rewards associated with an address",
|
||||||
Long: strings.TrimSpace(`Set the withdraw address for rewards associated with a delegator address:
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Set the withdraw address for rewards associated with a delegator address.
|
||||||
|
|
||||||
$ <appcli> tx set-withdraw-addr cosmos1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p --from mykey
|
Example:
|
||||||
`),
|
$ %s tx set-withdraw-addr cosmos1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p --from mykey
|
||||||
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ import (
|
||||||
"github.com/cosmos/cosmos-sdk/client/context"
|
"github.com/cosmos/cosmos-sdk/client/context"
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/cosmos/cosmos-sdk/version"
|
||||||
"github.com/cosmos/cosmos-sdk/x/gov"
|
"github.com/cosmos/cosmos-sdk/x/gov"
|
||||||
gcutils "github.com/cosmos/cosmos-sdk/x/gov/client/utils"
|
gcutils "github.com/cosmos/cosmos-sdk/x/gov/client/utils"
|
||||||
)
|
)
|
||||||
|
@ -21,11 +22,16 @@ func GetCmdQueryProposal(queryRoute string, cdc *codec.Codec) *cobra.Command {
|
||||||
Use: "proposal [proposal-id]",
|
Use: "proposal [proposal-id]",
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
Short: "Query details of a single proposal",
|
Short: "Query details of a single proposal",
|
||||||
Long: strings.TrimSpace(`
|
Long: strings.TrimSpace(
|
||||||
Query details for a proposal. You can find the proposal-id by running <appcli> query gov proposals:
|
fmt.Sprintf(`Query details for a proposal. You can find the
|
||||||
|
proposal-id by running "%s query gov proposals".
|
||||||
|
|
||||||
$ <appcli> query gov proposal 1
|
Example:
|
||||||
`),
|
$ %s query gov proposal 1
|
||||||
|
`,
|
||||||
|
version.ClientName, version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||||
|
|
||||||
|
@ -53,13 +59,17 @@ func GetCmdQueryProposals(queryRoute string, cdc *codec.Codec) *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "proposals",
|
Use: "proposals",
|
||||||
Short: "Query proposals with optional filters",
|
Short: "Query proposals with optional filters",
|
||||||
Long: strings.TrimSpace(`
|
Long: strings.TrimSpace(
|
||||||
Query for a all proposals. You can filter the returns with the following flags:
|
fmt.Sprintf(`Query for a all proposals. You can filter the returns with the following flags.
|
||||||
|
|
||||||
$ <appcli> query gov proposals --depositor cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk
|
Example:
|
||||||
$ <appcli> query gov proposals --voter cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk
|
$ %s query gov proposals --depositor cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk
|
||||||
$ <appcli> query gov proposals --status (DepositPeriod|VotingPeriod|Passed|Rejected)
|
$ %s query gov proposals --voter cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk
|
||||||
`),
|
$ %s query gov proposals --status (DepositPeriod|VotingPeriod|Passed|Rejected)
|
||||||
|
`,
|
||||||
|
version.ClientName, version.ClientName, version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
bechDepositorAddr := viper.GetString(flagDepositor)
|
bechDepositorAddr := viper.GetString(flagDepositor)
|
||||||
bechVoterAddr := viper.GetString(flagVoter)
|
bechVoterAddr := viper.GetString(flagVoter)
|
||||||
|
@ -137,12 +147,15 @@ func GetCmdQueryVote(queryRoute string, cdc *codec.Codec) *cobra.Command {
|
||||||
Use: "vote [proposal-id] [voter-addr]",
|
Use: "vote [proposal-id] [voter-addr]",
|
||||||
Args: cobra.ExactArgs(2),
|
Args: cobra.ExactArgs(2),
|
||||||
Short: "Query details of a single vote",
|
Short: "Query details of a single vote",
|
||||||
Long: strings.TrimSpace(`
|
Long: strings.TrimSpace(
|
||||||
Query details for a single vote on a proposal given its identifier.
|
fmt.Sprintf(`Query details for a single vote on a proposal given its identifier.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
$ <appcli> query gov vote 1 cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk
|
$ %s query gov vote 1 cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk
|
||||||
`),
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||||
|
|
||||||
|
@ -200,12 +213,15 @@ func GetCmdQueryVotes(queryRoute string, cdc *codec.Codec) *cobra.Command {
|
||||||
Use: "votes [proposal-id]",
|
Use: "votes [proposal-id]",
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
Short: "Query votes on a proposal",
|
Short: "Query votes on a proposal",
|
||||||
Long: strings.TrimSpace(`
|
Long: strings.TrimSpace(
|
||||||
Query vote details for a single proposal by its identifier.
|
fmt.Sprintf(`Query vote details for a single proposal by its identifier.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
$ <appcli> query gov votes 1
|
$ %s query gov votes 1
|
||||||
`),
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||||
|
|
||||||
|
@ -255,12 +271,15 @@ func GetCmdQueryDeposit(queryRoute string, cdc *codec.Codec) *cobra.Command {
|
||||||
Use: "deposit [proposal-id] [depositer-addr]",
|
Use: "deposit [proposal-id] [depositer-addr]",
|
||||||
Args: cobra.ExactArgs(2),
|
Args: cobra.ExactArgs(2),
|
||||||
Short: "Query details of a deposit",
|
Short: "Query details of a deposit",
|
||||||
Long: strings.TrimSpace(`
|
Long: strings.TrimSpace(
|
||||||
Query details for a single proposal deposit on a proposal by its identifier.
|
fmt.Sprintf(`Query details for a single proposal deposit on a proposal by its identifier.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
$ <appcli> query gov deposit 1 cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk
|
$ %s query gov deposit 1 cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk
|
||||||
`),
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||||
|
|
||||||
|
@ -314,11 +333,16 @@ func GetCmdQueryDeposits(queryRoute string, cdc *codec.Codec) *cobra.Command {
|
||||||
Use: "deposits [proposal-id]",
|
Use: "deposits [proposal-id]",
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
Short: "Query deposits on a proposal",
|
Short: "Query deposits on a proposal",
|
||||||
Long: strings.TrimSpace(`
|
Long: strings.TrimSpace(
|
||||||
Query details for all deposits on a proposal. You can find the proposal-id by running <appcli> query gov proposals:
|
fmt.Sprintf(`Query details for all deposits on a proposal.
|
||||||
|
You can find the proposal-id by running "%s query gov proposals".
|
||||||
|
|
||||||
$ <appcli> query gov deposits 1
|
Example:
|
||||||
`),
|
$ %s query gov deposits 1
|
||||||
|
`,
|
||||||
|
version.ClientName, version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||||
|
|
||||||
|
@ -337,7 +361,7 @@ $ <appcli> query gov deposits 1
|
||||||
// check to see if the proposal is in the store
|
// check to see if the proposal is in the store
|
||||||
res, err := gcutils.QueryProposalByID(proposalID, cliCtx, cdc, queryRoute)
|
res, err := gcutils.QueryProposalByID(proposalID, cliCtx, cdc, queryRoute)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Failed to fetch proposal with id %d: %s", proposalID, err)
|
return fmt.Errorf("failed to fetch proposal with id %d: %s", proposalID, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var proposal gov.Proposal
|
var proposal gov.Proposal
|
||||||
|
@ -367,11 +391,16 @@ func GetCmdQueryTally(queryRoute string, cdc *codec.Codec) *cobra.Command {
|
||||||
Use: "tally [proposal-id]",
|
Use: "tally [proposal-id]",
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
Short: "Get the tally of a proposal vote",
|
Short: "Get the tally of a proposal vote",
|
||||||
Long: strings.TrimSpace(`
|
Long: strings.TrimSpace(
|
||||||
Query tally of votes on a proposal. You can find the proposal-id by running <appcli> query gov proposals:
|
fmt.Sprintf(`Query tally of votes on a proposal. You can find
|
||||||
|
the proposal-id by running "%s query gov proposals".
|
||||||
|
|
||||||
$ <appcli> query gov tally 1
|
Example:
|
||||||
`),
|
$ %s query gov tally 1
|
||||||
|
`,
|
||||||
|
version.ClientName, version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||||
|
|
||||||
|
@ -384,7 +413,7 @@ $ <appcli> query gov tally 1
|
||||||
// check to see if the proposal is in the store
|
// check to see if the proposal is in the store
|
||||||
_, err = gcutils.QueryProposalByID(proposalID, cliCtx, cdc, queryRoute)
|
_, err = gcutils.QueryProposalByID(proposalID, cliCtx, cdc, queryRoute)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Failed to fetch proposal-id %d: %s", proposalID, err)
|
return fmt.Errorf("failed to fetch proposal-id %d: %s", proposalID, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Construct query
|
// Construct query
|
||||||
|
@ -412,10 +441,15 @@ func GetCmdQueryParams(queryRoute string, cdc *codec.Codec) *cobra.Command {
|
||||||
return &cobra.Command{
|
return &cobra.Command{
|
||||||
Use: "params",
|
Use: "params",
|
||||||
Short: "Query the parameters of the governance process",
|
Short: "Query the parameters of the governance process",
|
||||||
Long: strings.TrimSpace(`Query the all the parameters for the governance process:
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Query the all the parameters for the governance process.
|
||||||
|
|
||||||
$ <appcli> query gov params
|
Example:
|
||||||
`),
|
$ %s query gov params
|
||||||
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
Args: cobra.NoArgs,
|
Args: cobra.NoArgs,
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||||
|
@ -450,12 +484,17 @@ func GetCmdQueryParam(queryRoute string, cdc *codec.Codec) *cobra.Command {
|
||||||
Use: "param [param-type]",
|
Use: "param [param-type]",
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
Short: "Query the parameters (voting|tallying|deposit) of the governance process",
|
Short: "Query the parameters (voting|tallying|deposit) of the governance process",
|
||||||
Long: strings.TrimSpace(`Query the all the parameters for the governance process:
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Query the all the parameters for the governance process.
|
||||||
|
|
||||||
$ <appcli> query gov param voting
|
Example:
|
||||||
$ <appcli> query gov param tallying
|
$ %s query gov param voting
|
||||||
$ <appcli> query gov param deposit
|
$ %s query gov param tallying
|
||||||
`),
|
$ %s query gov param deposit
|
||||||
|
`,
|
||||||
|
version.ClientName, version.ClientName, version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||||
|
|
||||||
|
@ -493,10 +532,15 @@ func GetCmdQueryProposer(queryRoute string, cdc *codec.Codec) *cobra.Command {
|
||||||
Use: "proposer [proposal-id]",
|
Use: "proposer [proposal-id]",
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
Short: "Query the proposer of a governance proposal",
|
Short: "Query the proposer of a governance proposal",
|
||||||
Long: strings.TrimSpace(`Query which address proposed a proposal with a given ID:
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Query which address proposed a proposal with a given ID.
|
||||||
|
|
||||||
$ <appcli> query gov proposer 1
|
Example:
|
||||||
`),
|
$ %s query gov proposer 1
|
||||||
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ import (
|
||||||
"github.com/cosmos/cosmos-sdk/client/utils"
|
"github.com/cosmos/cosmos-sdk/client/utils"
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/cosmos/cosmos-sdk/version"
|
||||||
authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder"
|
authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder"
|
||||||
"github.com/cosmos/cosmos-sdk/x/gov"
|
"github.com/cosmos/cosmos-sdk/x/gov"
|
||||||
|
|
||||||
|
@ -53,12 +54,14 @@ func GetCmdSubmitProposal(cdc *codec.Codec) *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "submit-proposal",
|
Use: "submit-proposal",
|
||||||
Short: "Submit a proposal along with an initial deposit",
|
Short: "Submit a proposal along with an initial deposit",
|
||||||
Long: strings.TrimSpace(`
|
Long: strings.TrimSpace(
|
||||||
Submit a proposal along with an initial deposit. Proposal title, description, type and deposit can be given directly or through a proposal JSON file. For example:
|
fmt.Sprintf(`Submit a proposal along with an initial deposit.
|
||||||
|
Proposal title, description, type and deposit can be given directly or through a proposal JSON file.
|
||||||
|
|
||||||
$ <appcli> gov submit-proposal --proposal="path/to/proposal.json" --from mykey
|
Example:
|
||||||
|
$ %s tx gov submit-proposal --proposal="path/to/proposal.json" --from mykey
|
||||||
|
|
||||||
where proposal.json contains:
|
Where proposal.json contains:
|
||||||
|
|
||||||
{
|
{
|
||||||
"title": "Test Proposal",
|
"title": "Test Proposal",
|
||||||
|
@ -67,10 +70,13 @@ where proposal.json contains:
|
||||||
"deposit": "10test"
|
"deposit": "10test"
|
||||||
}
|
}
|
||||||
|
|
||||||
is equivalent to
|
Which is equivalent to:
|
||||||
|
|
||||||
$ <appcli> gov submit-proposal --title="Test Proposal" --description="My awesome proposal" --type="Text" --deposit="10test" --from mykey
|
$ %s tx gov submit-proposal --title="Test Proposal" --description="My awesome proposal" --type="Text" --deposit="10test" --from mykey
|
||||||
`),
|
`,
|
||||||
|
version.ClientName, version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
txBldr := authtxb.NewTxBuilderFromCLI().WithTxEncoder(utils.GetTxEncoder(cdc))
|
txBldr := authtxb.NewTxBuilderFromCLI().WithTxEncoder(utils.GetTxEncoder(cdc))
|
||||||
cliCtx := context.NewCLIContext().
|
cliCtx := context.NewCLIContext().
|
||||||
|
@ -113,12 +119,16 @@ func GetCmdDeposit(cdc *codec.Codec) *cobra.Command {
|
||||||
Use: "deposit [proposal-id] [deposit]",
|
Use: "deposit [proposal-id] [deposit]",
|
||||||
Args: cobra.ExactArgs(2),
|
Args: cobra.ExactArgs(2),
|
||||||
Short: "Deposit tokens for an active proposal",
|
Short: "Deposit tokens for an active proposal",
|
||||||
Long: strings.TrimSpace(`
|
Long: strings.TrimSpace(
|
||||||
Submit a deposit for an active proposal. You can find the proposal-id by running "<appcli> query gov proposals":
|
fmt.Sprintf(`Submit a deposit for an active proposal. You can
|
||||||
|
find the proposal-id by running "%s query gov proposals".
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
$ <appcli> tx gov deposit 1 10stake --from mykey
|
$ %s tx gov deposit 1 10stake --from mykey
|
||||||
`),
|
`,
|
||||||
|
version.ClientName, version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
txBldr := authtxb.NewTxBuilderFromCLI().WithTxEncoder(utils.GetTxEncoder(cdc))
|
txBldr := authtxb.NewTxBuilderFromCLI().WithTxEncoder(utils.GetTxEncoder(cdc))
|
||||||
cliCtx := context.NewCLIContext().
|
cliCtx := context.NewCLIContext().
|
||||||
|
@ -157,12 +167,17 @@ func GetCmdVote(cdc *codec.Codec) *cobra.Command {
|
||||||
Use: "vote [proposal-id] [option]",
|
Use: "vote [proposal-id] [option]",
|
||||||
Args: cobra.ExactArgs(2),
|
Args: cobra.ExactArgs(2),
|
||||||
Short: "Vote for an active proposal, options: yes/no/no_with_veto/abstain",
|
Short: "Vote for an active proposal, options: yes/no/no_with_veto/abstain",
|
||||||
Long: strings.TrimSpace(`
|
Long: strings.TrimSpace(
|
||||||
Submit a vote for an active proposal. You can find the proposal-id by running "<appcli> query gov proposals":
|
fmt.Sprintf(`Submit a vote for an active proposal. You can
|
||||||
|
find the proposal-id by running "%s query gov proposals".
|
||||||
|
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
$ <appcli> tx gov vote 1 yes --from mykey
|
$ %s tx gov vote 1 yes --from mykey
|
||||||
`),
|
`,
|
||||||
|
version.ClientName, version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
txBldr := authtxb.NewTxBuilderFromCLI().WithTxEncoder(utils.GetTxEncoder(cdc))
|
txBldr := authtxb.NewTxBuilderFromCLI().WithTxEncoder(utils.GetTxEncoder(cdc))
|
||||||
cliCtx := context.NewCLIContext().
|
cliCtx := context.NewCLIContext().
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package cli
|
package cli
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
@ -9,6 +10,7 @@ import (
|
||||||
"github.com/cosmos/cosmos-sdk/client/utils"
|
"github.com/cosmos/cosmos-sdk/client/utils"
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/cosmos/cosmos-sdk/version"
|
||||||
authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder"
|
authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder"
|
||||||
"github.com/cosmos/cosmos-sdk/x/gov"
|
"github.com/cosmos/cosmos-sdk/x/gov"
|
||||||
"github.com/cosmos/cosmos-sdk/x/params"
|
"github.com/cosmos/cosmos-sdk/x/params"
|
||||||
|
@ -22,9 +24,9 @@ func GetCmdSubmitProposal(cdc *codec.Codec) *cobra.Command {
|
||||||
Use: "param-change [proposal-file]",
|
Use: "param-change [proposal-file]",
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
Short: "Submit a parameter change proposal",
|
Short: "Submit a parameter change proposal",
|
||||||
Long: strings.TrimSpace(`
|
Long: strings.TrimSpace(
|
||||||
Submit a parameter proposal along with an initial deposit. The proposal details
|
fmt.Sprintf(`Submit a parameter proposal along with an initial deposit.
|
||||||
must be supplied via a JSON file.
|
The proposal details must be supplied via a JSON file.
|
||||||
|
|
||||||
IMPORTANT: Currently parameter changes are evaluated but not validated, so it is
|
IMPORTANT: Currently parameter changes are evaluated but not validated, so it is
|
||||||
very important that any "value" change is valid (ie. correct type and within bounds)
|
very important that any "value" change is valid (ie. correct type and within bounds)
|
||||||
|
@ -35,8 +37,10 @@ Proper vetting of a parameter change proposal should prevent this from happening
|
||||||
regardless.
|
regardless.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
$ <appcli> tx gov submit-proposal param-change <path/to/proposal.json> --from=<key_or_address>
|
$ %s tx gov submit-proposal param-change <path/to/proposal.json> --from=<key_or_address>
|
||||||
where proposal.json contains:
|
|
||||||
|
Where proposal.json contains:
|
||||||
|
|
||||||
{
|
{
|
||||||
"title": "Staking Param Change",
|
"title": "Staking Param Change",
|
||||||
"description": "Update max validators",
|
"description": "Update max validators",
|
||||||
|
@ -54,7 +58,10 @@ where proposal.json contains:
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
`),
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
txBldr := authtxb.NewTxBuilderFromCLI().WithTxEncoder(utils.GetTxEncoder(cdc))
|
txBldr := authtxb.NewTxBuilderFromCLI().WithTxEncoder(utils.GetTxEncoder(cdc))
|
||||||
cliCtx := context.NewCLIContext().
|
cliCtx := context.NewCLIContext().
|
||||||
|
|
|
@ -9,6 +9,7 @@ import (
|
||||||
"github.com/cosmos/cosmos-sdk/client/context"
|
"github.com/cosmos/cosmos-sdk/client/context"
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/cosmos/cosmos-sdk/version"
|
||||||
"github.com/cosmos/cosmos-sdk/x/staking"
|
"github.com/cosmos/cosmos-sdk/x/staking"
|
||||||
"github.com/cosmos/cosmos-sdk/x/staking/types"
|
"github.com/cosmos/cosmos-sdk/x/staking/types"
|
||||||
)
|
)
|
||||||
|
@ -18,10 +19,15 @@ func GetCmdQueryValidator(storeName string, cdc *codec.Codec) *cobra.Command {
|
||||||
return &cobra.Command{
|
return &cobra.Command{
|
||||||
Use: "validator [validator-addr]",
|
Use: "validator [validator-addr]",
|
||||||
Short: "Query a validator",
|
Short: "Query a validator",
|
||||||
Long: strings.TrimSpace(`Query details about an individual validator:
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Query details about an individual validator.
|
||||||
|
|
||||||
$ <appcli> query staking validator cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj
|
Example:
|
||||||
`),
|
$ %s query staking validator cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj
|
||||||
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||||
|
@ -51,10 +57,15 @@ func GetCmdQueryValidators(storeName string, cdc *codec.Codec) *cobra.Command {
|
||||||
Use: "validators",
|
Use: "validators",
|
||||||
Short: "Query for all validators",
|
Short: "Query for all validators",
|
||||||
Args: cobra.NoArgs,
|
Args: cobra.NoArgs,
|
||||||
Long: strings.TrimSpace(`Query details about all validators on a network:
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Query details about all validators on a network.
|
||||||
|
|
||||||
$ <appcli> query staking validators
|
Example:
|
||||||
`),
|
$ %s query staking validators
|
||||||
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||||
|
|
||||||
|
@ -78,10 +89,15 @@ func GetCmdQueryValidatorUnbondingDelegations(storeKey string, cdc *codec.Codec)
|
||||||
return &cobra.Command{
|
return &cobra.Command{
|
||||||
Use: "unbonding-delegations-from [validator-addr]",
|
Use: "unbonding-delegations-from [validator-addr]",
|
||||||
Short: "Query all unbonding delegatations from a validator",
|
Short: "Query all unbonding delegatations from a validator",
|
||||||
Long: strings.TrimSpace(`Query delegations that are unbonding _from_ a validator:
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Query delegations that are unbonding _from_ a validator.
|
||||||
|
|
||||||
$ <appcli> query staking unbonding-delegations-from cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj
|
Example:
|
||||||
`),
|
$ %s query staking unbonding-delegations-from cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj
|
||||||
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||||
|
@ -115,10 +131,15 @@ func GetCmdQueryValidatorRedelegations(storeKey string, cdc *codec.Codec) *cobra
|
||||||
return &cobra.Command{
|
return &cobra.Command{
|
||||||
Use: "redelegations-from [validator-addr]",
|
Use: "redelegations-from [validator-addr]",
|
||||||
Short: "Query all outgoing redelegatations from a validator",
|
Short: "Query all outgoing redelegatations from a validator",
|
||||||
Long: strings.TrimSpace(`Query delegations that are redelegating _from_ a validator:
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Query delegations that are redelegating _from_ a validator.
|
||||||
|
|
||||||
$ <appcli> query staking redelegations-from cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj
|
Example:
|
||||||
`),
|
$ %s query staking redelegations-from cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj
|
||||||
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||||
|
@ -154,10 +175,15 @@ func GetCmdQueryDelegation(storeKey string, cdc *codec.Codec) *cobra.Command {
|
||||||
return &cobra.Command{
|
return &cobra.Command{
|
||||||
Use: "delegation [delegator-addr] [validator-addr]",
|
Use: "delegation [delegator-addr] [validator-addr]",
|
||||||
Short: "Query a delegation based on address and validator address",
|
Short: "Query a delegation based on address and validator address",
|
||||||
Long: strings.TrimSpace(`Query delegations for an individual delegator on an individual validator:
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Query delegations for an individual delegator on an individual validator.
|
||||||
|
|
||||||
$ <appcli> query staking delegation cosmos1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj
|
Example:
|
||||||
`),
|
$ %s query staking delegation cosmos1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj
|
||||||
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
Args: cobra.ExactArgs(2),
|
Args: cobra.ExactArgs(2),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||||
|
@ -199,10 +225,15 @@ func GetCmdQueryDelegations(storeKey string, cdc *codec.Codec) *cobra.Command {
|
||||||
return &cobra.Command{
|
return &cobra.Command{
|
||||||
Use: "delegations [delegator-addr]",
|
Use: "delegations [delegator-addr]",
|
||||||
Short: "Query all delegations made by one delegator",
|
Short: "Query all delegations made by one delegator",
|
||||||
Long: strings.TrimSpace(`Query delegations for an individual delegator on all validators:
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Query delegations for an individual delegator on all validators.
|
||||||
|
|
||||||
$ <appcli> query staking delegations cosmos1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p
|
Example:
|
||||||
`),
|
$ %s query staking delegations cosmos1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p
|
||||||
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||||
|
@ -239,10 +270,15 @@ func GetCmdQueryValidatorDelegations(storeKey string, cdc *codec.Codec) *cobra.C
|
||||||
return &cobra.Command{
|
return &cobra.Command{
|
||||||
Use: "delegations-to [validator-addr]",
|
Use: "delegations-to [validator-addr]",
|
||||||
Short: "Query all delegations made to one validator",
|
Short: "Query all delegations made to one validator",
|
||||||
Long: strings.TrimSpace(`Query delegations on an individual validator:
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Query delegations on an individual validator.
|
||||||
|
|
||||||
$ <appcli> query staking delegations-to cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj
|
Example:
|
||||||
`),
|
$ %s query staking delegations-to cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj
|
||||||
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||||
|
@ -279,10 +315,15 @@ func GetCmdQueryUnbondingDelegation(storeName string, cdc *codec.Codec) *cobra.C
|
||||||
return &cobra.Command{
|
return &cobra.Command{
|
||||||
Use: "unbonding-delegation [delegator-addr] [validator-addr]",
|
Use: "unbonding-delegation [delegator-addr] [validator-addr]",
|
||||||
Short: "Query an unbonding-delegation record based on delegator and validator address",
|
Short: "Query an unbonding-delegation record based on delegator and validator address",
|
||||||
Long: strings.TrimSpace(`Query unbonding delegations for an individual delegator on an individual validator:
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Query unbonding delegations for an individual delegator on an individual validator.
|
||||||
|
|
||||||
$ <appcli> query staking unbonding-delegation cosmos1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj
|
Example:
|
||||||
`),
|
$ %s query staking unbonding-delegation cosmos1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj
|
||||||
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
Args: cobra.ExactArgs(2),
|
Args: cobra.ExactArgs(2),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||||
|
@ -314,10 +355,15 @@ func GetCmdQueryUnbondingDelegations(storeName string, cdc *codec.Codec) *cobra.
|
||||||
return &cobra.Command{
|
return &cobra.Command{
|
||||||
Use: "unbonding-delegations [delegator-addr]",
|
Use: "unbonding-delegations [delegator-addr]",
|
||||||
Short: "Query all unbonding-delegations records for one delegator",
|
Short: "Query all unbonding-delegations records for one delegator",
|
||||||
Long: strings.TrimSpace(`Query unbonding delegations for an individual delegator:
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Query unbonding delegations for an individual delegator.
|
||||||
|
|
||||||
$ <appcli> query staking unbonding-delegation cosmos1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p
|
Example:
|
||||||
`),
|
$ %s query staking unbonding-delegation cosmos1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p
|
||||||
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||||
|
@ -348,10 +394,15 @@ func GetCmdQueryRedelegation(storeKey string, cdc *codec.Codec) *cobra.Command {
|
||||||
return &cobra.Command{
|
return &cobra.Command{
|
||||||
Use: "redelegation [delegator-addr] [src-validator-addr] [dst-validator-addr]",
|
Use: "redelegation [delegator-addr] [src-validator-addr] [dst-validator-addr]",
|
||||||
Short: "Query a redelegation record based on delegator and a source and destination validator address",
|
Short: "Query a redelegation record based on delegator and a source and destination validator address",
|
||||||
Long: strings.TrimSpace(`Query a redelegation record for an individual delegator between a source and destination validator:
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Query a redelegation record for an individual delegator between a source and destination validator.
|
||||||
|
|
||||||
$ <appcli> query staking redelegation cosmos1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p cosmosvaloper1l2rsakp388kuv9k8qzq6lrm9taddae7fpx59wm cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj
|
Example:
|
||||||
`),
|
$ %s query staking redelegation cosmos1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p cosmosvaloper1l2rsakp388kuv9k8qzq6lrm9taddae7fpx59wm cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj
|
||||||
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
Args: cobra.ExactArgs(3),
|
Args: cobra.ExactArgs(3),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||||
|
@ -399,10 +450,15 @@ func GetCmdQueryRedelegations(storeKey string, cdc *codec.Codec) *cobra.Command
|
||||||
Use: "redelegations [delegator-addr]",
|
Use: "redelegations [delegator-addr]",
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
Short: "Query all redelegations records for one delegator",
|
Short: "Query all redelegations records for one delegator",
|
||||||
Long: strings.TrimSpace(`Query all redelegation records for an individual delegator:
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Query all redelegation records for an individual delegator.
|
||||||
|
|
||||||
$ <appcli> query staking redelegation cosmos1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p
|
Example:
|
||||||
`),
|
$ %s query staking redelegation cosmos1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p
|
||||||
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||||
|
|
||||||
|
@ -438,10 +494,15 @@ func GetCmdQueryPool(storeName string, cdc *codec.Codec) *cobra.Command {
|
||||||
Use: "pool",
|
Use: "pool",
|
||||||
Args: cobra.NoArgs,
|
Args: cobra.NoArgs,
|
||||||
Short: "Query the current staking pool values",
|
Short: "Query the current staking pool values",
|
||||||
Long: strings.TrimSpace(`Query values for amounts stored in the staking pool:
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Query values for amounts stored in the staking pool.
|
||||||
|
|
||||||
$ <appcli> query staking pool
|
Example:
|
||||||
`),
|
$ %s query staking pool
|
||||||
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||||
|
|
||||||
|
@ -461,10 +522,15 @@ func GetCmdQueryParams(storeName string, cdc *codec.Codec) *cobra.Command {
|
||||||
Use: "params",
|
Use: "params",
|
||||||
Args: cobra.NoArgs,
|
Args: cobra.NoArgs,
|
||||||
Short: "Query the current staking parameters information",
|
Short: "Query the current staking parameters information",
|
||||||
Long: strings.TrimSpace(`Query values set as staking parameters:
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Query values set as staking parameters.
|
||||||
|
|
||||||
$ <appcli> query staking params
|
Example:
|
||||||
`),
|
$ %s query staking params
|
||||||
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/cosmos/cosmos-sdk/version"
|
||||||
"github.com/cosmos/cosmos-sdk/x/auth"
|
"github.com/cosmos/cosmos-sdk/x/auth"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/client"
|
"github.com/cosmos/cosmos-sdk/client"
|
||||||
|
@ -117,11 +118,16 @@ func GetCmdDelegate(cdc *codec.Codec) *cobra.Command {
|
||||||
return &cobra.Command{
|
return &cobra.Command{
|
||||||
Use: "delegate [validator-addr] [amount]",
|
Use: "delegate [validator-addr] [amount]",
|
||||||
Args: cobra.ExactArgs(2),
|
Args: cobra.ExactArgs(2),
|
||||||
Short: "delegate liquid tokens to a validator",
|
Short: "Delegate liquid tokens to a validator",
|
||||||
Long: strings.TrimSpace(`Delegate an amount of liquid coins to a validator from your wallet:
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Delegate an amount of liquid coins to a validator from your wallet.
|
||||||
|
|
||||||
$ $ <appcli> tx staking delegate cosmosvaloper1l2rsakp388kuv9k8qzq6lrm9taddae7fpx59wm 1000stake --from mykey
|
Example:
|
||||||
`),
|
$ %s tx staking delegate cosmosvaloper1l2rsakp388kuv9k8qzq6lrm9taddae7fpx59wm 1000stake --from mykey
|
||||||
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
txBldr := authtxb.NewTxBuilderFromCLI().WithTxEncoder(auth.DefaultTxEncoder(cdc))
|
txBldr := authtxb.NewTxBuilderFromCLI().WithTxEncoder(auth.DefaultTxEncoder(cdc))
|
||||||
cliCtx := context.NewCLIContext().
|
cliCtx := context.NewCLIContext().
|
||||||
|
@ -149,12 +155,17 @@ $ $ <appcli> tx staking delegate cosmosvaloper1l2rsakp388kuv9k8qzq6lrm9taddae7fp
|
||||||
func GetCmdRedelegate(storeName string, cdc *codec.Codec) *cobra.Command {
|
func GetCmdRedelegate(storeName string, cdc *codec.Codec) *cobra.Command {
|
||||||
return &cobra.Command{
|
return &cobra.Command{
|
||||||
Use: "redelegate [src-validator-addr] [dst-validator-addr] [amount]",
|
Use: "redelegate [src-validator-addr] [dst-validator-addr] [amount]",
|
||||||
Short: "redelegate illiquid tokens from one validator to another",
|
Short: "Redelegate illiquid tokens from one validator to another",
|
||||||
Args: cobra.ExactArgs(3),
|
Args: cobra.ExactArgs(3),
|
||||||
Long: strings.TrimSpace(`Redelegate an amount of illiquid staking tokens from one validator to another:
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Redelegate an amount of illiquid staking tokens from one validator to another.
|
||||||
|
|
||||||
$ $ <appcli> tx staking redelegate cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj cosmosvaloper1l2rsakp388kuv9k8qzq6lrm9taddae7fpx59wm 100stake --from mykey
|
Example:
|
||||||
`),
|
$ %s tx staking redelegate cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj cosmosvaloper1l2rsakp388kuv9k8qzq6lrm9taddae7fpx59wm 100stake --from mykey
|
||||||
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
txBldr := authtxb.NewTxBuilderFromCLI().WithTxEncoder(auth.DefaultTxEncoder(cdc))
|
txBldr := authtxb.NewTxBuilderFromCLI().WithTxEncoder(auth.DefaultTxEncoder(cdc))
|
||||||
cliCtx := context.NewCLIContext().
|
cliCtx := context.NewCLIContext().
|
||||||
|
@ -187,12 +198,17 @@ $ $ <appcli> tx staking redelegate cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9l
|
||||||
func GetCmdUnbond(storeName string, cdc *codec.Codec) *cobra.Command {
|
func GetCmdUnbond(storeName string, cdc *codec.Codec) *cobra.Command {
|
||||||
return &cobra.Command{
|
return &cobra.Command{
|
||||||
Use: "unbond [validator-addr] [amount]",
|
Use: "unbond [validator-addr] [amount]",
|
||||||
Short: "unbond shares from a validator",
|
Short: "Unbond shares from a validator",
|
||||||
Args: cobra.ExactArgs(2),
|
Args: cobra.ExactArgs(2),
|
||||||
Long: strings.TrimSpace(`Unbond an amount of bonded shares from a validator:
|
Long: strings.TrimSpace(
|
||||||
|
fmt.Sprintf(`Unbond an amount of bonded shares from a validator.
|
||||||
|
|
||||||
$ $ <appcli> tx staking unbond cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj 100stake --from mykey
|
Example:
|
||||||
`),
|
$ %s tx staking unbond cosmosvaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj 100stake --from mykey
|
||||||
|
`,
|
||||||
|
version.ClientName,
|
||||||
|
),
|
||||||
|
),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
txBldr := authtxb.NewTxBuilderFromCLI().WithTxEncoder(auth.DefaultTxEncoder(cdc))
|
txBldr := authtxb.NewTxBuilderFromCLI().WithTxEncoder(auth.DefaultTxEncoder(cdc))
|
||||||
cliCtx := context.NewCLIContext().
|
cliCtx := context.NewCLIContext().
|
||||||
|
|
Loading…
Reference in New Issue