2024-02-14 05:58:43 +00:00
|
|
|
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) {
|
2024-11-21 07:54:14 +00:00
|
|
|
c, actor := nnsWriter(cmd)
|
2024-02-14 05:58:43 +00:00
|
|
|
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")
|
|
|
|
}
|