* stake/fees spec updates * staking overview.md revisions, moving files * docs reorganization * staking spec state revisions * transaction stake updates * complete staking spec update * WIP adding unbonding/redelegation commands * added msg types for unbonding, redelegation * stake sub-package reorg * working stake reorg * modify lcd tests to not use hardcoded json strings * add description update * index keys * key managment for unbonding redelegation complete * update stake errors * completed handleMsgCompleteUnbonding fn * updated to use begin/complete unbonding/redelegation * fix token shares bug * develop docs into unbonding * got non-tests compiling after merge develop * working fixing tests * PrivlegedKeeper -> PrivilegedKeeper * tests compile * fix some tests * fixing tests * remove PrivilegedKeeper * get unbonding bug * only rpc sig verification failed tests now * move percent unbonding/redelegation to the CLI and out of handler logic * remove min unbonding height * add lcd txs * add pool sanity checks, fix a buncha tests * fix ante. set lcd log to debug (#1322) * redelegation tests, adding query functionality for bonds * add self-delegations at genesis ref #1165 * PR comments (mostly) addressed * cleanup, added Query LCD functionality * test cleanup/fixes * fix governance test * SlashValidatorSet -> ValidatorSet * changelog * stake lcd fix * x/auth: fix chainID in ante * fix lcd test * fix lint, update lint make command for spelling * lowercase error string * don't expose coinkeeper in staking * remove a few duplicate lines in changelog * chain_id in stake lcd tests * added transient redelegation * 'transient' => 'transitive' * Re-add nolint instruction * Fix tiny linter error
85 lines
2.2 KiB
Go
85 lines
2.2 KiB
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/tendermint/tmlibs/cli"
|
|
|
|
"github.com/cosmos/cosmos-sdk/client"
|
|
"github.com/cosmos/cosmos-sdk/client/keys"
|
|
"github.com/cosmos/cosmos-sdk/client/lcd"
|
|
"github.com/cosmos/cosmos-sdk/client/rpc"
|
|
"github.com/cosmos/cosmos-sdk/client/tx"
|
|
|
|
"github.com/cosmos/cosmos-sdk/version"
|
|
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
|
|
bankcmd "github.com/cosmos/cosmos-sdk/x/bank/client/cli"
|
|
ibccmd "github.com/cosmos/cosmos-sdk/x/ibc/client/cli"
|
|
stakecmd "github.com/cosmos/cosmos-sdk/x/stake/client/cli"
|
|
|
|
"github.com/cosmos/cosmos-sdk/examples/basecoin/app"
|
|
"github.com/cosmos/cosmos-sdk/examples/basecoin/types"
|
|
)
|
|
|
|
// rootCmd is the entry point for this binary
|
|
var (
|
|
rootCmd = &cobra.Command{
|
|
Use: "basecli",
|
|
Short: "Basecoin light-client",
|
|
}
|
|
)
|
|
|
|
func main() {
|
|
// disable sorting
|
|
cobra.EnableCommandSorting = false
|
|
|
|
// get the codec
|
|
cdc := app.MakeCodec()
|
|
|
|
// TODO: setup keybase, viper object, etc. to be passed into
|
|
// the below functions and eliminate global vars, like we do
|
|
// with the cdc
|
|
|
|
// add standard rpc, and tx commands
|
|
rpc.AddCommands(rootCmd)
|
|
rootCmd.AddCommand(client.LineBreak)
|
|
tx.AddCommands(rootCmd, cdc)
|
|
rootCmd.AddCommand(client.LineBreak)
|
|
|
|
// add query/post commands (custom to binary)
|
|
rootCmd.AddCommand(
|
|
client.GetCommands(
|
|
stakecmd.GetCmdQueryValidator("stake", cdc),
|
|
stakecmd.GetCmdQueryValidators("stake", cdc),
|
|
stakecmd.GetCmdQueryDelegation("stake", cdc),
|
|
stakecmd.GetCmdQueryDelegations("stake", cdc),
|
|
authcmd.GetAccountCmd("acc", cdc, types.GetAccountDecoder(cdc)),
|
|
)...)
|
|
|
|
rootCmd.AddCommand(
|
|
client.PostCommands(
|
|
bankcmd.SendTxCmd(cdc),
|
|
ibccmd.IBCTransferCmd(cdc),
|
|
ibccmd.IBCRelayCmd(cdc),
|
|
stakecmd.GetCmdCreateValidator(cdc),
|
|
stakecmd.GetCmdEditValidator(cdc),
|
|
stakecmd.GetCmdDelegate(cdc),
|
|
stakecmd.GetCmdUnbond("stake", cdc),
|
|
)...)
|
|
|
|
// add proxy, version and key info
|
|
rootCmd.AddCommand(
|
|
client.LineBreak,
|
|
lcd.ServeCommand(cdc),
|
|
keys.Commands(),
|
|
client.LineBreak,
|
|
version.VersionCmd,
|
|
)
|
|
|
|
// prepare and add flags
|
|
executor := cli.PrepareMainCmd(rootCmd, "BC", os.ExpandEnv("$HOME/.basecli"))
|
|
executor.Execute()
|
|
}
|