package contract import ( "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-adm/internal/modules/morph/util" "github.com/spf13/cobra" "github.com/spf13/viper" ) var ( DumpHashesCmd = &cobra.Command{ Use: "dump-hashes", Short: "Dump deployed contract hashes", PreRun: func(cmd *cobra.Command, _ []string) { _ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag)) }, RunE: dumpContractHashes, } UpdateCmd = &cobra.Command{ Use: "update-contracts", Short: "Update FrostFS contracts", PreRun: func(cmd *cobra.Command, _ []string) { _ = viper.BindPFlag(util.AlphabetWalletsFlag, cmd.Flags().Lookup(util.AlphabetWalletsFlag)) _ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag)) }, RunE: updateContracts, } ) func initDumpContractHashesCmd() { DumpHashesCmd.Flags().StringP(util.EndpointFlag, util.EndpointFlagShort, "", util.EndpointFlagDesc) DumpHashesCmd.Flags().String(util.CustomZoneFlag, "", "Custom zone to search.") } func initUpdateContractsCmd() { UpdateCmd.Flags().String(util.AlphabetWalletsFlag, "", util.AlphabetWalletsFlagDesc) UpdateCmd.Flags().StringP(util.EndpointFlag, util.EndpointFlagShort, "", util.EndpointFlagDesc) UpdateCmd.Flags().String(util.ContractsInitFlag, "", util.ContractsInitFlagDesc) UpdateCmd.Flags().String(util.ContractsURLFlag, "", util.ContractsURLFlagDesc) UpdateCmd.MarkFlagsMutuallyExclusive(util.ContractsInitFlag, util.ContractsURLFlag) } func init() { initDumpContractHashesCmd() initUpdateContractsCmd() }