-
Notifications
You must be signed in to change notification settings - Fork 182
/
cmd.go
26 lines (22 loc) · 883 Bytes
/
cmd.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package mpt
import (
"github.com/okex/exchain/libs/cosmos-sdk/server"
"github.com/okex/exchain/libs/cosmos-sdk/store/mpt/types"
sdk "github.com/okex/exchain/libs/cosmos-sdk/types"
tmtypes "github.com/okex/exchain/libs/tendermint/types"
"github.com/spf13/cobra"
)
func MptCmd(ctx *server.Context) *cobra.Command {
cmd := &cobra.Command{
Use: "mpt",
Short: "migrate iavl state to mpt state (if use migrate mpt data, then you should set `--use-composite-key true` when you decide to use mpt to store the coming data)",
}
cmd.AddCommand(
iavl2mptCmd(ctx),
cleanIavlStoreCmd(ctx),
mptViewerCmd(ctx),
)
cmd.PersistentFlags().UintVar(&types.TrieRocksdbBatchSize, types.FlagTrieRocksdbBatchSize, 100, "Concurrent rocksdb batch size for mpt")
cmd.PersistentFlags().String(sdk.FlagDBBackend, tmtypes.DBBackend, "Database backend: goleveldb | rocksdb")
return cmd
}