4 log "github.com/sirupsen/logrus"
5 "github.com/spf13/cobra"
6 "github.com/tendermint/tmlibs/cli"
8 "github.com/vapor/toolbar/mergeutxo"
11 var RootCmd = &cobra.Command{
18 hostPort, accountID, password, address string
23 RootCmd.Flags().StringVar(&hostPort, "host_port", "http://127.0.0.1:9889", "The url for the node. Default:http://127.0.0.1:9889")
24 RootCmd.Flags().StringVar(&accountID, "account_id", "", "The accountID of utxo needs to be merged")
25 RootCmd.Flags().StringVar(&password, "password", "", "Password of the account")
26 RootCmd.Flags().StringVar(&address, "address", "", "The received address after merging utxo")
27 RootCmd.Flags().Uint64Var(&amount, "amount", 0, "Total amount of merged utxo")
30 func runReward(cmd *cobra.Command, args []string) error {
31 log.Info("This tool belongs to an open-source project, we can not guarantee this tool is bug-free. Please check the code before using, developers will not be responsible for any asset loss due to bug!")
32 txIDs, err := mergeutxo.MergeUTXO(hostPort, accountID, password, address, amount)
37 log.Info("Merge utxo successfully. txID: ", txIDs)
43 cmd := cli.PrepareBaseCmd(RootCmd, "merge_utxo", "./")