make install works
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"path"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/client/keys"
|
||||
"github.com/cosmos/cosmos-sdk/client/lcd"
|
||||
"github.com/cosmos/cosmos-sdk/client/rpc"
|
||||
@@ -51,7 +52,7 @@ func main() {
|
||||
}
|
||||
|
||||
// Add --chain-id to persistent flags and mark it required
|
||||
rootCmd.PersistentFlags().String(client.FlagChainID, "", "Chain ID of tendermint node")
|
||||
rootCmd.PersistentFlags().String(flags.FlagChainID, "", "Chain ID of tendermint node")
|
||||
rootCmd.PersistentPreRunE = func(_ *cobra.Command, _ []string) error {
|
||||
return initConfig(rootCmd)
|
||||
}
|
||||
@@ -62,13 +63,13 @@ func main() {
|
||||
client.ConfigCmd(app.DefaultCLIHome),
|
||||
queryCmd(cdc),
|
||||
txCmd(cdc),
|
||||
client.LineBreak,
|
||||
flags.LineBreak,
|
||||
lcd.ServeCommand(cdc, registerRoutes),
|
||||
client.LineBreak,
|
||||
flags.LineBreak,
|
||||
keys.Commands(),
|
||||
client.LineBreak,
|
||||
flags.LineBreak,
|
||||
version.Cmd,
|
||||
client.NewCompletionCmd(rootCmd, true),
|
||||
flags.NewCompletionCmd(rootCmd, true),
|
||||
)
|
||||
|
||||
// Add flags and prefix all env exposed with WM
|
||||
@@ -90,12 +91,12 @@ func queryCmd(cdc *amino.Codec) *cobra.Command {
|
||||
|
||||
queryCmd.AddCommand(
|
||||
authcmd.GetAccountCmd(cdc),
|
||||
client.LineBreak,
|
||||
flags.LineBreak,
|
||||
rpc.ValidatorCommand(cdc),
|
||||
rpc.BlockCommand(),
|
||||
authcmd.QueryTxsByEventsCmd(cdc),
|
||||
authcmd.QueryTxCmd(cdc),
|
||||
client.LineBreak,
|
||||
flags.LineBreak,
|
||||
)
|
||||
|
||||
// add modules' query commands
|
||||
@@ -112,15 +113,16 @@ func txCmd(cdc *amino.Codec) *cobra.Command {
|
||||
|
||||
txCmd.AddCommand(
|
||||
bankcmd.SendTxCmd(cdc),
|
||||
client.LineBreak,
|
||||
flags.LineBreak,
|
||||
authcmd.GetSignCommand(cdc),
|
||||
authcmd.GetMultiSignCommand(cdc),
|
||||
client.LineBreak,
|
||||
flags.LineBreak,
|
||||
authcmd.GetBroadcastCommand(cdc),
|
||||
authcmd.GetEncodeCommand(cdc),
|
||||
authcmd.GetDecodeCommand(cdc),
|
||||
authcmd.GetDecodeTxCmd(cdc),
|
||||
client.LineBreak,
|
||||
// TODO: I think it is safe to remove
|
||||
// authcmd.GetDecodeTxCmd(cdc),
|
||||
flags.LineBreak,
|
||||
)
|
||||
|
||||
// add modules' tx commands
|
||||
@@ -163,7 +165,7 @@ func initConfig(cmd *cobra.Command) error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := viper.BindPFlag(client.FlagChainID, cmd.PersistentFlags().Lookup(client.FlagChainID)); err != nil {
|
||||
if err := viper.BindPFlag(flags.FlagChainID, cmd.PersistentFlags().Lookup(flags.FlagChainID)); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := viper.BindPFlag(cli.EncodingFlag, cmd.PersistentFlags().Lookup(cli.EncodingFlag)); err != nil {
|
||||
|
||||
@@ -10,8 +10,9 @@ import (
|
||||
|
||||
"github.com/tendermint/tendermint/libs/cli"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client/keys"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keys"
|
||||
"github.com/cosmos/cosmos-sdk/server"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/auth"
|
||||
@@ -49,7 +50,12 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa
|
||||
inBuf := bufio.NewReader(cmd.InOrStdin())
|
||||
if err != nil {
|
||||
// attempt to lookup address from Keybase if no address was provided
|
||||
kb, err := keys.NewKeyringFromDir(viper.GetString(flagClientHome), inBuf)
|
||||
kb, err := keys.NewKeyring(
|
||||
sdk.GetConfig().GetKeyringServiceName(),
|
||||
viper.GetString(flags.FlagKeyringBackend),
|
||||
viper.GetString(flagClientHome),
|
||||
inBuf,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ import (
|
||||
"github.com/cosmwasm/wasmd/app"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/baseapp"
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/debug"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/server"
|
||||
"github.com/cosmos/cosmos-sdk/store"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
@@ -59,7 +59,7 @@ func main() {
|
||||
)
|
||||
rootCmd.AddCommand(genutilcli.ValidateGenesisCmd(ctx, cdc, app.ModuleBasics))
|
||||
rootCmd.AddCommand(AddGenesisAccountCmd(ctx, cdc, app.DefaultNodeHome, app.DefaultCLIHome))
|
||||
rootCmd.AddCommand(client.NewCompletionCmd(rootCmd, true))
|
||||
rootCmd.AddCommand(flags.NewCompletionCmd(rootCmd, true))
|
||||
// rootCmd.AddCommand(testnetCmd(ctx, cdc, app.ModuleBasics, auth.GenesisAccountIterator{}))
|
||||
rootCmd.AddCommand(replayCmd())
|
||||
rootCmd.AddCommand(debug.Cmd(cdc))
|
||||
@@ -83,8 +83,13 @@ func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer) abci.Application
|
||||
cache = store.NewCommitKVStoreCacheManager()
|
||||
}
|
||||
|
||||
skipUpgradeHeights := make(map[int64]bool)
|
||||
for _, h := range viper.GetIntSlice(server.FlagUnsafeSkipUpgrades) {
|
||||
skipUpgradeHeights[int64(h)] = true
|
||||
}
|
||||
|
||||
return app.NewWasmApp(
|
||||
logger, db, traceStore, true, invCheckPeriod,
|
||||
logger, db, traceStore, true, invCheckPeriod, skipUpgradeHeights,
|
||||
baseapp.SetPruning(store.NewPruningOptionsFromString(viper.GetString("pruning"))),
|
||||
baseapp.SetMinGasPrices(viper.GetString(server.FlagMinGasPrices)),
|
||||
baseapp.SetHaltHeight(viper.GetUint64(server.FlagHaltHeight)),
|
||||
@@ -98,7 +103,7 @@ func exportAppStateAndTMValidators(
|
||||
) (json.RawMessage, []tmtypes.GenesisValidator, error) {
|
||||
|
||||
if height != -1 {
|
||||
gapp := app.NewWasmApp(logger, db, traceStore, false, uint(1))
|
||||
gapp := app.NewWasmApp(logger, db, traceStore, false, uint(1), nil)
|
||||
err := gapp.LoadHeight(height)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
@@ -106,6 +111,6 @@ func exportAppStateAndTMValidators(
|
||||
return gapp.ExportAppStateAndValidators(forZeroHeight, jailWhiteList)
|
||||
}
|
||||
|
||||
gapp := app.NewWasmApp(logger, db, traceStore, true, uint(1))
|
||||
gapp := app.NewWasmApp(logger, db, traceStore, true, uint(1), nil)
|
||||
return gapp.ExportAppStateAndValidators(forZeroHeight, jailWhiteList)
|
||||
}
|
||||
|
||||
@@ -93,7 +93,8 @@ func replayTxs(rootDir string) error {
|
||||
// Application
|
||||
fmt.Fprintln(os.Stderr, "Creating application")
|
||||
gapp := app.NewWasmApp(
|
||||
ctx.Logger, appDB, traceStoreWriter, true, uint(1),
|
||||
// TODO: do we want to set skipUpgradeHieghts here?
|
||||
ctx.Logger, appDB, traceStoreWriter, true, uint(1), nil,
|
||||
baseapp.SetPruning(store.PruneEverything), // nothing
|
||||
)
|
||||
|
||||
|
||||
@@ -19,9 +19,10 @@ import (
|
||||
"github.com/tendermint/tendermint/types"
|
||||
tmtime "github.com/tendermint/tendermint/types/time"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/keys"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
clientkeys "github.com/cosmos/cosmos-sdk/client/keys"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keys"
|
||||
"github.com/cosmos/cosmos-sdk/server"
|
||||
srvconfig "github.com/cosmos/cosmos-sdk/server/config"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
@@ -62,7 +63,7 @@ Example:
|
||||
config := ctx.Config
|
||||
|
||||
outputDir := viper.GetString(flagOutputDir)
|
||||
chainID := viper.GetString(client.FlagChainID)
|
||||
chainID := viper.GetString(flags.FlagChainID)
|
||||
minGasPrices := viper.GetString(server.FlagMinGasPrices)
|
||||
nodeDirPrefix := viper.GetString(flagNodeDirPrefix)
|
||||
nodeDaemonHome := viper.GetString(flagNodeDaemonHome)
|
||||
@@ -88,7 +89,7 @@ Example:
|
||||
cmd.Flags().String(flagStartingIPAddress, "192.168.0.1",
|
||||
"Starting IP address (192.168.0.1 results in persistent peers list ID0@192.168.0.1:46656, ID1@192.168.0.2:46656, ...)")
|
||||
cmd.Flags().String(
|
||||
client.FlagChainID, "", "genesis file chain-id, if left blank will be randomly created")
|
||||
flags.FlagChainID, "", "genesis file chain-id, if left blank will be randomly created")
|
||||
cmd.Flags().String(
|
||||
server.FlagMinGasPrices, fmt.Sprintf("0.000006%s", sdk.DefaultBondDenom),
|
||||
"Minimum gas prices to accept for transactions; All fees in a tx must meet this minimum (e.g. 0.01photino,0.001stake)")
|
||||
@@ -104,7 +105,7 @@ func InitTestnet(cmd *cobra.Command, config *tmconfig.Config, cdc *codec.Codec,
|
||||
nodeCLIHome, startingIPAddress string, numValidators int) error {
|
||||
|
||||
if chainID == "" {
|
||||
chainID = "chain-" + tmrand.RandStr(6)
|
||||
chainID = "chain-" + tmrand.Str(6)
|
||||
}
|
||||
|
||||
monikers := make([]string, numValidators)
|
||||
@@ -159,12 +160,17 @@ func InitTestnet(cmd *cobra.Command, config *tmconfig.Config, cdc *codec.Codec,
|
||||
memo := fmt.Sprintf("%s@%s:26656", nodeIDs[i], ip)
|
||||
genFiles = append(genFiles, config.GenesisFile())
|
||||
|
||||
kb, err := keys.NewKeyringFromDir(clientDir, inBuf)
|
||||
kb, err := keys.NewKeyring(
|
||||
sdk.GetConfig().GetKeyringServiceName(),
|
||||
viper.GetString(flags.FlagKeyringBackend),
|
||||
viper.GetString(flagClientHome),
|
||||
inBuf,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
keyPass := client.DefaultKeyPass
|
||||
keyPass := clientkeys.DefaultKeyPass
|
||||
addr, secret, err := server.GenerateSaveCoinKey(kb, nodeDirName, keyPass, true)
|
||||
if err != nil {
|
||||
_ = os.RemoveAll(outputDir)
|
||||
@@ -204,7 +210,7 @@ func InitTestnet(cmd *cobra.Command, config *tmconfig.Config, cdc *codec.Codec,
|
||||
tx := auth.NewStdTx([]sdk.Msg{msg}, auth.StdFee{}, []auth.StdSignature{}, memo)
|
||||
txBldr := auth.NewTxBuilderFromCLI(inBuf).WithChainID(chainID).WithMemo(memo).WithKeybase(kb)
|
||||
|
||||
signedTx, err := txBldr.SignStdTx(nodeDirName, client.DefaultKeyPass, tx, false)
|
||||
signedTx, err := txBldr.SignStdTx(nodeDirName, clientkeys.DefaultKeyPass, tx, false)
|
||||
if err != nil {
|
||||
_ = os.RemoveAll(outputDir)
|
||||
return err
|
||||
|
||||
1
go.sum
1
go.sum
@@ -50,6 +50,7 @@ github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfc
|
||||
github.com/cosmos/cosmos-sdk v0.34.4-0.20191114141721-d4c831e63ad3/go.mod h1:0sLtjU+qex1OfpGQHjWhJByx74IoH78R742PEAdoQJk=
|
||||
github.com/cosmos/cosmos-sdk v0.34.4-0.20200122195256-f18005d2f18b h1:4RsoxLira7JdoEfmtXb/61MimEUDoBXmMlSo1Q82VAk=
|
||||
github.com/cosmos/cosmos-sdk v0.34.4-0.20200122195256-f18005d2f18b/go.mod h1:l5CUp1E+XbxJHzP342W2w8LfdYmzKeTGfxPmxhyaOoM=
|
||||
github.com/cosmos/cosmos-sdk v0.37.6 h1:l7urou9aTPqW/x3Hq+SAWn6OHDzjma+1OVi0TT+O36M=
|
||||
github.com/cosmos/go-bip39 v0.0.0-20180618194314-52158e4697b8/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y=
|
||||
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d h1:49RLWk1j44Xu4fjHb6JFYmeUnDORVwHNkDxaQ0ctCVU=
|
||||
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y=
|
||||
|
||||
Reference in New Issue
Block a user