66 "github.com/cosmos/cosmos-sdk/client"
77 "github.com/cosmos/cosmos-sdk/client/flags"
88 "github.com/cosmos/cosmos-sdk/client/tx"
9- sdk "github.com/cosmos/cosmos-sdk/types"
109 "github.com/spf13/cobra"
1110
1211 base "github.com/sentinel-official/hub/v12/types"
@@ -16,21 +15,21 @@ import (
1615
1716func txRegisterNode () * cobra.Command {
1817 cmd := & cobra.Command {
19- Use : "register-node [remote-url] [gigabyte-prices] [hourly-prices] " ,
18+ Use : "register-node [remote-url]" ,
2019 Short : "Register a new node with a remote URL and pricing details" ,
21- Args : cobra .ExactArgs (3 ),
20+ Args : cobra .ExactArgs (1 ),
2221 RunE : func (cmd * cobra.Command , args []string ) error {
2322 ctx , err := client .GetClientTxContext (cmd )
2423 if err != nil {
2524 return err
2625 }
2726
28- gigabytePrices , err := sdk . ParseDecCoins ( args [ 1 ] )
27+ gigabytePrices , err := GetGigabytePrices ( cmd . Flags () )
2928 if err != nil {
3029 return err
3130 }
3231
33- hourlyPrices , err := sdk . ParseDecCoins ( args [ 2 ] )
32+ hourlyPrices , err := GetHourlyPrices ( cmd . Flags () )
3433 if err != nil {
3534 return err
3635 }
@@ -52,7 +51,7 @@ func txRegisterNode() *cobra.Command {
5251 flags .AddTxFlagsToCmd (cmd )
5352 cmd .Flags ().String (flagGigabytePrices , "" , "prices for one gigabyte of bandwidth (e.g., 1000token" )
5453 cmd .Flags ().String (flagHourlyPrices , "" , "prices for one hour of bandwidth (e.g., 500token" )
55- cmd . Flags (). String ( flagRemoteURL , "" , "remote URL address for the node" )
54+
5655 return cmd
5756}
5857
0 commit comments