forked from TrueCloudLab/frostfs-node
Evgenii Stratonikov
256f96e252
Make it more specific and similar to nnsReader(). Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
26 lines
945 B
Go
26 lines
945 B
Go
package nns
|
|
|
|
import (
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-adm/internal/commonflags"
|
|
commonCmd "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/internal/common"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func initRenewCmd() {
|
|
Cmd.AddCommand(renewCmd)
|
|
renewCmd.Flags().StringP(commonflags.EndpointFlag, commonflags.EndpointFlagShort, "", commonflags.EndpointFlagDesc)
|
|
renewCmd.Flags().String(commonflags.AlphabetWalletsFlag, "", commonflags.AlphabetWalletsFlagDesc)
|
|
renewCmd.Flags().String(nnsNameFlag, "", nnsNameFlagDesc)
|
|
}
|
|
|
|
func renewDomain(cmd *cobra.Command, _ []string) {
|
|
c, actor := nnsWriter(cmd)
|
|
name, _ := cmd.Flags().GetString(nnsNameFlag)
|
|
h, vub, err := c.Renew(name)
|
|
commonCmd.ExitOnErr(cmd, "unable to renew domain: %w", err)
|
|
|
|
cmd.Println("Waiting for transaction to persist...")
|
|
_, err = actor.Wait(h, vub, err)
|
|
commonCmd.ExitOnErr(cmd, "renew domain error: %w", err)
|
|
cmd.Println("Domain renewed successfully")
|
|
}
|