forked from TrueCloudLab/frostfs-node
44 lines
1.4 KiB
Go
44 lines
1.4 KiB
Go
|
package proxy
|
||
|
|
||
|
import (
|
||
|
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-adm/internal/modules/morph/util"
|
||
|
"github.com/spf13/cobra"
|
||
|
"github.com/spf13/viper"
|
||
|
)
|
||
|
|
||
|
var (
|
||
|
AddAccountCmd = &cobra.Command{
|
||
|
Use: "proxy-add-account",
|
||
|
Short: "Adds account to proxy contract",
|
||
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||
|
_ = viper.BindPFlag(util.AlphabetWalletsFlag, cmd.Flags().Lookup(util.AlphabetWalletsFlag))
|
||
|
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
||
|
},
|
||
|
Run: addProxyAccount,
|
||
|
}
|
||
|
RemoveAccountCmd = &cobra.Command{
|
||
|
Use: "proxy-remove-account",
|
||
|
Short: "Remove from proxy contract",
|
||
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||
|
_ = viper.BindPFlag(util.AlphabetWalletsFlag, cmd.Flags().Lookup(util.AlphabetWalletsFlag))
|
||
|
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
||
|
},
|
||
|
Run: removeProxyAccount,
|
||
|
}
|
||
|
)
|
||
|
|
||
|
func initProxyAddAccount() {
|
||
|
AddAccountCmd.Flags().StringP(util.EndpointFlag, util.EndpointFlagShort, "", util.EndpointFlagDesc)
|
||
|
AddAccountCmd.Flags().String(accountAddressFlag, "", "Wallet address string")
|
||
|
}
|
||
|
|
||
|
func initProxyRemoveAccount() {
|
||
|
RemoveAccountCmd.Flags().StringP(util.EndpointFlag, util.EndpointFlagShort, "", util.EndpointFlagDesc)
|
||
|
RemoveAccountCmd.Flags().String(accountAddressFlag, "", "Wallet address string")
|
||
|
}
|
||
|
|
||
|
func init() {
|
||
|
initProxyAddAccount()
|
||
|
initProxyRemoveAccount()
|
||
|
}
|