forked from TrueCloudLab/frostfs-node
[#932] adm: Move alphabet-wallets
flag to util
package
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
parent
7954c7f8af
commit
34fcab3498
10 changed files with 73 additions and 73 deletions
|
@ -43,7 +43,7 @@ var (
|
||||||
Short: "Add rule chain",
|
Short: "Add rule chain",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(morphUtil.AlphabetWalletsFlag, cmd.Flags().Lookup(morphUtil.AlphabetWalletsFlag))
|
||||||
},
|
},
|
||||||
Run: addRuleChain,
|
Run: addRuleChain,
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ var (
|
||||||
Short: "Remove rule chain",
|
Short: "Remove rule chain",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(morphUtil.AlphabetWalletsFlag, cmd.Flags().Lookup(morphUtil.AlphabetWalletsFlag))
|
||||||
},
|
},
|
||||||
Run: removeRuleChain,
|
Run: removeRuleChain,
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ var (
|
||||||
Short: "List rule chains",
|
Short: "List rule chains",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(morphUtil.AlphabetWalletsFlag, cmd.Flags().Lookup(morphUtil.AlphabetWalletsFlag))
|
||||||
},
|
},
|
||||||
Run: listRuleChains,
|
Run: listRuleChains,
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ var (
|
||||||
Short: "Set admin",
|
Short: "Set admin",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(morphUtil.AlphabetWalletsFlag, cmd.Flags().Lookup(morphUtil.AlphabetWalletsFlag))
|
||||||
},
|
},
|
||||||
Run: setAdmin,
|
Run: setAdmin,
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ var (
|
||||||
Short: "Get admin",
|
Short: "Get admin",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(morphUtil.AlphabetWalletsFlag, cmd.Flags().Lookup(morphUtil.AlphabetWalletsFlag))
|
||||||
},
|
},
|
||||||
Run: getAdmin,
|
Run: getAdmin,
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ func initAddRuleChainCmd() {
|
||||||
apeCmd.AddCommand(addRuleChainCmd)
|
apeCmd.AddCommand(addRuleChainCmd)
|
||||||
|
|
||||||
addRuleChainCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
addRuleChainCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
||||||
addRuleChainCmd.Flags().String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
addRuleChainCmd.Flags().String(morphUtil.AlphabetWalletsFlag, "", morphUtil.AlphabetWalletsFlagDesc)
|
||||||
|
|
||||||
addRuleChainCmd.Flags().String(targetTypeFlag, "", targetTypeDesc)
|
addRuleChainCmd.Flags().String(targetTypeFlag, "", targetTypeDesc)
|
||||||
_ = addRuleChainCmd.MarkFlagRequired(targetTypeFlag)
|
_ = addRuleChainCmd.MarkFlagRequired(targetTypeFlag)
|
||||||
|
@ -112,7 +112,7 @@ func initRemoveRuleChainCmd() {
|
||||||
apeCmd.AddCommand(removeRuleChainCmd)
|
apeCmd.AddCommand(removeRuleChainCmd)
|
||||||
|
|
||||||
removeRuleChainCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
removeRuleChainCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
||||||
removeRuleChainCmd.Flags().String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
removeRuleChainCmd.Flags().String(morphUtil.AlphabetWalletsFlag, "", morphUtil.AlphabetWalletsFlagDesc)
|
||||||
|
|
||||||
removeRuleChainCmd.Flags().String(targetTypeFlag, "", targetTypeDesc)
|
removeRuleChainCmd.Flags().String(targetTypeFlag, "", targetTypeDesc)
|
||||||
_ = removeRuleChainCmd.MarkFlagRequired(targetTypeFlag)
|
_ = removeRuleChainCmd.MarkFlagRequired(targetTypeFlag)
|
||||||
|
@ -126,7 +126,7 @@ func initListRuleChainsCmd() {
|
||||||
apeCmd.AddCommand(listRuleChainsCmd)
|
apeCmd.AddCommand(listRuleChainsCmd)
|
||||||
|
|
||||||
listRuleChainsCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
listRuleChainsCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
||||||
listRuleChainsCmd.Flags().String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
listRuleChainsCmd.Flags().String(morphUtil.AlphabetWalletsFlag, "", morphUtil.AlphabetWalletsFlagDesc)
|
||||||
listRuleChainsCmd.Flags().StringP(targetTypeFlag, "t", "", targetTypeDesc)
|
listRuleChainsCmd.Flags().StringP(targetTypeFlag, "t", "", targetTypeDesc)
|
||||||
_ = listRuleChainsCmd.MarkFlagRequired(targetTypeFlag)
|
_ = listRuleChainsCmd.MarkFlagRequired(targetTypeFlag)
|
||||||
listRuleChainsCmd.Flags().String(targetNameFlag, "", targetNameDesc)
|
listRuleChainsCmd.Flags().String(targetNameFlag, "", targetNameDesc)
|
||||||
|
@ -138,7 +138,7 @@ func initSetAdminCmd() {
|
||||||
apeCmd.AddCommand(setAdminCmd)
|
apeCmd.AddCommand(setAdminCmd)
|
||||||
|
|
||||||
setAdminCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
setAdminCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
||||||
setAdminCmd.Flags().String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
setAdminCmd.Flags().String(morphUtil.AlphabetWalletsFlag, "", morphUtil.AlphabetWalletsFlagDesc)
|
||||||
setAdminCmd.Flags().String(addrAdminFlag, "", addrAdminDesc)
|
setAdminCmd.Flags().String(addrAdminFlag, "", addrAdminDesc)
|
||||||
_ = setAdminCmd.MarkFlagRequired(addrAdminFlag)
|
_ = setAdminCmd.MarkFlagRequired(addrAdminFlag)
|
||||||
}
|
}
|
||||||
|
@ -147,7 +147,7 @@ func initGetAdminCmd() {
|
||||||
apeCmd.AddCommand(getAdminCmd)
|
apeCmd.AddCommand(getAdminCmd)
|
||||||
|
|
||||||
getAdminCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
getAdminCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
||||||
getAdminCmd.Flags().String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
getAdminCmd.Flags().String(morphUtil.AlphabetWalletsFlag, "", morphUtil.AlphabetWalletsFlagDesc)
|
||||||
}
|
}
|
||||||
|
|
||||||
func addRuleChain(cmd *cobra.Command, _ []string) {
|
func addRuleChain(cmd *cobra.Command, _ []string) {
|
||||||
|
|
|
@ -81,7 +81,7 @@ func newPolicyContractInterface(cmd *cobra.Command) (*morph.ContractStorage, *ac
|
||||||
c, err := morphUtil.GetN3Client(v)
|
c, err := morphUtil.GetN3Client(v)
|
||||||
commonCmd.ExitOnErr(cmd, "unable to create NEO rpc client: %w", err)
|
commonCmd.ExitOnErr(cmd, "unable to create NEO rpc client: %w", err)
|
||||||
|
|
||||||
walletDir := config.ResolveHomePath(viper.GetString(alphabetWalletsFlag))
|
walletDir := config.ResolveHomePath(viper.GetString(morphUtil.AlphabetWalletsFlag))
|
||||||
wallets, err := morphUtil.GetAlphabetWallets(v, walletDir)
|
wallets, err := morphUtil.GetAlphabetWallets(v, walletDir)
|
||||||
commonCmd.ExitOnErr(cmd, "unable to get alphabet wallets: %w", err)
|
commonCmd.ExitOnErr(cmd, "unable to get alphabet wallets: %w", err)
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ Compiled contract file name must contain '_contract.nef' suffix.
|
||||||
Contract's manifest file name must be 'config.json'.
|
Contract's manifest file name must be 'config.json'.
|
||||||
NNS name is taken by stripping '_contract.nef' from the NEF file (similar to frostfs contracts).`,
|
NNS name is taken by stripping '_contract.nef' from the NEF file (similar to frostfs contracts).`,
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(util.AlphabetWalletsFlag, cmd.Flags().Lookup(util.AlphabetWalletsFlag))
|
||||||
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
||||||
},
|
},
|
||||||
RunE: deployContractCmd,
|
RunE: deployContractCmd,
|
||||||
|
@ -47,8 +47,8 @@ NNS name is taken by stripping '_contract.nef' from the NEF file (similar to fro
|
||||||
func init() {
|
func init() {
|
||||||
ff := deployCmd.Flags()
|
ff := deployCmd.Flags()
|
||||||
|
|
||||||
ff.String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
ff.String(util.AlphabetWalletsFlag, "", util.AlphabetWalletsFlagDesc)
|
||||||
_ = deployCmd.MarkFlagFilename(alphabetWalletsFlag)
|
_ = deployCmd.MarkFlagFilename(util.AlphabetWalletsFlag)
|
||||||
|
|
||||||
ff.StringP(util.EndpointFlag, "r", "", util.EndpointFlagDesc)
|
ff.StringP(util.EndpointFlag, "r", "", util.EndpointFlagDesc)
|
||||||
ff.String(contractPathFlag, "", "Path to the contract directory")
|
ff.String(contractPathFlag, "", "Path to the contract directory")
|
||||||
|
|
|
@ -41,7 +41,7 @@ var (
|
||||||
Use: "create-namespace",
|
Use: "create-namespace",
|
||||||
Short: "Create new namespace in frostfsid contract",
|
Short: "Create new namespace in frostfsid contract",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(morphUtil.AlphabetWalletsFlag, cmd.Flags().Lookup(morphUtil.AlphabetWalletsFlag))
|
||||||
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
||||||
},
|
},
|
||||||
Run: frostfsidCreateNamespace,
|
Run: frostfsidCreateNamespace,
|
||||||
|
@ -51,7 +51,7 @@ var (
|
||||||
Use: "list-namespaces",
|
Use: "list-namespaces",
|
||||||
Short: "List all namespaces in frostfsid",
|
Short: "List all namespaces in frostfsid",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(morphUtil.AlphabetWalletsFlag, cmd.Flags().Lookup(morphUtil.AlphabetWalletsFlag))
|
||||||
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
||||||
},
|
},
|
||||||
Run: frostfsidListNamespaces,
|
Run: frostfsidListNamespaces,
|
||||||
|
@ -61,7 +61,7 @@ var (
|
||||||
Use: "create-subject",
|
Use: "create-subject",
|
||||||
Short: "Create subject in frostfsid contract",
|
Short: "Create subject in frostfsid contract",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(morphUtil.AlphabetWalletsFlag, cmd.Flags().Lookup(morphUtil.AlphabetWalletsFlag))
|
||||||
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
||||||
},
|
},
|
||||||
Run: frostfsidCreateSubject,
|
Run: frostfsidCreateSubject,
|
||||||
|
@ -71,7 +71,7 @@ var (
|
||||||
Use: "delete-subject",
|
Use: "delete-subject",
|
||||||
Short: "Delete subject from frostfsid contract",
|
Short: "Delete subject from frostfsid contract",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(morphUtil.AlphabetWalletsFlag, cmd.Flags().Lookup(morphUtil.AlphabetWalletsFlag))
|
||||||
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
||||||
},
|
},
|
||||||
Run: frostfsidDeleteSubject,
|
Run: frostfsidDeleteSubject,
|
||||||
|
@ -81,7 +81,7 @@ var (
|
||||||
Use: "list-subjects",
|
Use: "list-subjects",
|
||||||
Short: "List subjects in namespace",
|
Short: "List subjects in namespace",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(morphUtil.AlphabetWalletsFlag, cmd.Flags().Lookup(morphUtil.AlphabetWalletsFlag))
|
||||||
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
||||||
},
|
},
|
||||||
Run: frostfsidListSubjects,
|
Run: frostfsidListSubjects,
|
||||||
|
@ -91,7 +91,7 @@ var (
|
||||||
Use: "create-group",
|
Use: "create-group",
|
||||||
Short: "Create group in frostfsid contract",
|
Short: "Create group in frostfsid contract",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(morphUtil.AlphabetWalletsFlag, cmd.Flags().Lookup(morphUtil.AlphabetWalletsFlag))
|
||||||
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
||||||
},
|
},
|
||||||
Run: frostfsidCreateGroup,
|
Run: frostfsidCreateGroup,
|
||||||
|
@ -101,7 +101,7 @@ var (
|
||||||
Use: "delete-group",
|
Use: "delete-group",
|
||||||
Short: "Delete group from frostfsid contract",
|
Short: "Delete group from frostfsid contract",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(morphUtil.AlphabetWalletsFlag, cmd.Flags().Lookup(morphUtil.AlphabetWalletsFlag))
|
||||||
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
||||||
},
|
},
|
||||||
Run: frostfsidDeleteGroup,
|
Run: frostfsidDeleteGroup,
|
||||||
|
@ -111,7 +111,7 @@ var (
|
||||||
Use: "list-groups",
|
Use: "list-groups",
|
||||||
Short: "List groups in namespace",
|
Short: "List groups in namespace",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(morphUtil.AlphabetWalletsFlag, cmd.Flags().Lookup(morphUtil.AlphabetWalletsFlag))
|
||||||
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
||||||
},
|
},
|
||||||
Run: frostfsidListGroups,
|
Run: frostfsidListGroups,
|
||||||
|
@ -121,7 +121,7 @@ var (
|
||||||
Use: "add-subject-to-group",
|
Use: "add-subject-to-group",
|
||||||
Short: "Add subject to group",
|
Short: "Add subject to group",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(morphUtil.AlphabetWalletsFlag, cmd.Flags().Lookup(morphUtil.AlphabetWalletsFlag))
|
||||||
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
||||||
},
|
},
|
||||||
Run: frostfsidAddSubjectToGroup,
|
Run: frostfsidAddSubjectToGroup,
|
||||||
|
@ -131,7 +131,7 @@ var (
|
||||||
Use: "remove-subject-from-group",
|
Use: "remove-subject-from-group",
|
||||||
Short: "Remove subject from group",
|
Short: "Remove subject from group",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(morphUtil.AlphabetWalletsFlag, cmd.Flags().Lookup(morphUtil.AlphabetWalletsFlag))
|
||||||
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
||||||
},
|
},
|
||||||
Run: frostfsidRemoveSubjectFromGroup,
|
Run: frostfsidRemoveSubjectFromGroup,
|
||||||
|
@ -141,7 +141,7 @@ var (
|
||||||
Use: "list-group-subjects",
|
Use: "list-group-subjects",
|
||||||
Short: "List subjects in group",
|
Short: "List subjects in group",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(morphUtil.AlphabetWalletsFlag, cmd.Flags().Lookup(morphUtil.AlphabetWalletsFlag))
|
||||||
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
_ = viper.BindPFlag(morphUtil.EndpointFlag, cmd.Flags().Lookup(morphUtil.EndpointFlag))
|
||||||
},
|
},
|
||||||
Run: frostfsidListGroupSubjects,
|
Run: frostfsidListGroupSubjects,
|
||||||
|
@ -152,13 +152,13 @@ func initFrostfsIDCreateNamespaceCmd() {
|
||||||
frostfsidCmd.AddCommand(frostfsidCreateNamespaceCmd)
|
frostfsidCmd.AddCommand(frostfsidCreateNamespaceCmd)
|
||||||
frostfsidCreateNamespaceCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
frostfsidCreateNamespaceCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
||||||
frostfsidCreateNamespaceCmd.Flags().String(namespaceFlag, "", "Namespace name to create")
|
frostfsidCreateNamespaceCmd.Flags().String(namespaceFlag, "", "Namespace name to create")
|
||||||
frostfsidCreateNamespaceCmd.Flags().String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
frostfsidCreateNamespaceCmd.Flags().String(morphUtil.AlphabetWalletsFlag, "", morphUtil.AlphabetWalletsFlagDesc)
|
||||||
}
|
}
|
||||||
|
|
||||||
func initFrostfsIDListNamespacesCmd() {
|
func initFrostfsIDListNamespacesCmd() {
|
||||||
frostfsidCmd.AddCommand(frostfsidListNamespacesCmd)
|
frostfsidCmd.AddCommand(frostfsidListNamespacesCmd)
|
||||||
frostfsidListNamespacesCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
frostfsidListNamespacesCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
||||||
frostfsidListNamespacesCmd.Flags().String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
frostfsidListNamespacesCmd.Flags().String(morphUtil.AlphabetWalletsFlag, "", morphUtil.AlphabetWalletsFlagDesc)
|
||||||
}
|
}
|
||||||
|
|
||||||
func initFrostfsIDCreateSubjectCmd() {
|
func initFrostfsIDCreateSubjectCmd() {
|
||||||
|
@ -167,14 +167,14 @@ func initFrostfsIDCreateSubjectCmd() {
|
||||||
frostfsidCreateSubjectCmd.Flags().String(namespaceFlag, "", "Namespace where create subject")
|
frostfsidCreateSubjectCmd.Flags().String(namespaceFlag, "", "Namespace where create subject")
|
||||||
frostfsidCreateSubjectCmd.Flags().String(subjectNameFlag, "", "Subject name, must be unique in namespace")
|
frostfsidCreateSubjectCmd.Flags().String(subjectNameFlag, "", "Subject name, must be unique in namespace")
|
||||||
frostfsidCreateSubjectCmd.Flags().String(subjectKeyFlag, "", "Subject hex-encoded public key")
|
frostfsidCreateSubjectCmd.Flags().String(subjectKeyFlag, "", "Subject hex-encoded public key")
|
||||||
frostfsidCreateSubjectCmd.Flags().String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
frostfsidCreateSubjectCmd.Flags().String(morphUtil.AlphabetWalletsFlag, "", morphUtil.AlphabetWalletsFlagDesc)
|
||||||
}
|
}
|
||||||
|
|
||||||
func initFrostfsIDDeleteSubjectCmd() {
|
func initFrostfsIDDeleteSubjectCmd() {
|
||||||
frostfsidCmd.AddCommand(frostfsidDeleteSubjectCmd)
|
frostfsidCmd.AddCommand(frostfsidDeleteSubjectCmd)
|
||||||
frostfsidDeleteSubjectCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
frostfsidDeleteSubjectCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
||||||
frostfsidDeleteSubjectCmd.Flags().String(subjectAddressFlag, "", "Subject address")
|
frostfsidDeleteSubjectCmd.Flags().String(subjectAddressFlag, "", "Subject address")
|
||||||
frostfsidDeleteSubjectCmd.Flags().String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
frostfsidDeleteSubjectCmd.Flags().String(morphUtil.AlphabetWalletsFlag, "", morphUtil.AlphabetWalletsFlagDesc)
|
||||||
}
|
}
|
||||||
|
|
||||||
func initFrostfsIDListSubjectsCmd() {
|
func initFrostfsIDListSubjectsCmd() {
|
||||||
|
@ -182,7 +182,7 @@ func initFrostfsIDListSubjectsCmd() {
|
||||||
frostfsidListSubjectsCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
frostfsidListSubjectsCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
||||||
frostfsidListSubjectsCmd.Flags().String(namespaceFlag, "", "Namespace to list subjects")
|
frostfsidListSubjectsCmd.Flags().String(namespaceFlag, "", "Namespace to list subjects")
|
||||||
frostfsidListSubjectsCmd.Flags().Bool(includeNamesFlag, false, "Whether include subject name (require additional requests)")
|
frostfsidListSubjectsCmd.Flags().Bool(includeNamesFlag, false, "Whether include subject name (require additional requests)")
|
||||||
frostfsidListSubjectsCmd.Flags().String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
frostfsidListSubjectsCmd.Flags().String(morphUtil.AlphabetWalletsFlag, "", morphUtil.AlphabetWalletsFlagDesc)
|
||||||
}
|
}
|
||||||
|
|
||||||
func initFrostfsIDCreateGroupCmd() {
|
func initFrostfsIDCreateGroupCmd() {
|
||||||
|
@ -190,7 +190,7 @@ func initFrostfsIDCreateGroupCmd() {
|
||||||
frostfsidCreateGroupCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
frostfsidCreateGroupCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
||||||
frostfsidCreateGroupCmd.Flags().String(namespaceFlag, "", "Namespace where create group")
|
frostfsidCreateGroupCmd.Flags().String(namespaceFlag, "", "Namespace where create group")
|
||||||
frostfsidCreateGroupCmd.Flags().String(groupNameFlag, "", "Group name, must be unique in namespace")
|
frostfsidCreateGroupCmd.Flags().String(groupNameFlag, "", "Group name, must be unique in namespace")
|
||||||
frostfsidCreateGroupCmd.Flags().String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
frostfsidCreateGroupCmd.Flags().String(morphUtil.AlphabetWalletsFlag, "", morphUtil.AlphabetWalletsFlagDesc)
|
||||||
}
|
}
|
||||||
|
|
||||||
func initFrostfsIDDeleteGroupCmd() {
|
func initFrostfsIDDeleteGroupCmd() {
|
||||||
|
@ -198,14 +198,14 @@ func initFrostfsIDDeleteGroupCmd() {
|
||||||
frostfsidDeleteGroupCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
frostfsidDeleteGroupCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
||||||
frostfsidDeleteGroupCmd.Flags().String(namespaceFlag, "", "Namespace to delete group")
|
frostfsidDeleteGroupCmd.Flags().String(namespaceFlag, "", "Namespace to delete group")
|
||||||
frostfsidDeleteGroupCmd.Flags().Int64(groupIDFlag, 0, "Group id")
|
frostfsidDeleteGroupCmd.Flags().Int64(groupIDFlag, 0, "Group id")
|
||||||
frostfsidDeleteGroupCmd.Flags().String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
frostfsidDeleteGroupCmd.Flags().String(morphUtil.AlphabetWalletsFlag, "", morphUtil.AlphabetWalletsFlagDesc)
|
||||||
}
|
}
|
||||||
|
|
||||||
func initFrostfsIDListGroupsCmd() {
|
func initFrostfsIDListGroupsCmd() {
|
||||||
frostfsidCmd.AddCommand(frostfsidListGroupsCmd)
|
frostfsidCmd.AddCommand(frostfsidListGroupsCmd)
|
||||||
frostfsidListGroupsCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
frostfsidListGroupsCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
||||||
frostfsidListGroupsCmd.Flags().String(namespaceFlag, "", "Namespace to list groups")
|
frostfsidListGroupsCmd.Flags().String(namespaceFlag, "", "Namespace to list groups")
|
||||||
frostfsidListGroupsCmd.Flags().String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
frostfsidListGroupsCmd.Flags().String(morphUtil.AlphabetWalletsFlag, "", morphUtil.AlphabetWalletsFlagDesc)
|
||||||
}
|
}
|
||||||
|
|
||||||
func initFrostfsIDAddSubjectToGroupCmd() {
|
func initFrostfsIDAddSubjectToGroupCmd() {
|
||||||
|
@ -213,7 +213,7 @@ func initFrostfsIDAddSubjectToGroupCmd() {
|
||||||
frostfsidAddSubjectToGroupCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
frostfsidAddSubjectToGroupCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
||||||
frostfsidAddSubjectToGroupCmd.Flags().String(subjectAddressFlag, "", "Subject address")
|
frostfsidAddSubjectToGroupCmd.Flags().String(subjectAddressFlag, "", "Subject address")
|
||||||
frostfsidAddSubjectToGroupCmd.Flags().Int64(groupIDFlag, 0, "Group id")
|
frostfsidAddSubjectToGroupCmd.Flags().Int64(groupIDFlag, 0, "Group id")
|
||||||
frostfsidAddSubjectToGroupCmd.Flags().String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
frostfsidAddSubjectToGroupCmd.Flags().String(morphUtil.AlphabetWalletsFlag, "", morphUtil.AlphabetWalletsFlagDesc)
|
||||||
}
|
}
|
||||||
|
|
||||||
func initFrostfsIDRemoveSubjectFromGroupCmd() {
|
func initFrostfsIDRemoveSubjectFromGroupCmd() {
|
||||||
|
@ -221,7 +221,7 @@ func initFrostfsIDRemoveSubjectFromGroupCmd() {
|
||||||
frostfsidRemoveSubjectFromGroupCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
frostfsidRemoveSubjectFromGroupCmd.Flags().StringP(morphUtil.EndpointFlag, morphUtil.EndpointFlagShort, "", morphUtil.EndpointFlagDesc)
|
||||||
frostfsidRemoveSubjectFromGroupCmd.Flags().String(subjectAddressFlag, "", "Subject address")
|
frostfsidRemoveSubjectFromGroupCmd.Flags().String(subjectAddressFlag, "", "Subject address")
|
||||||
frostfsidRemoveSubjectFromGroupCmd.Flags().Int64(groupIDFlag, 0, "Group id")
|
frostfsidRemoveSubjectFromGroupCmd.Flags().Int64(groupIDFlag, 0, "Group id")
|
||||||
frostfsidRemoveSubjectFromGroupCmd.Flags().String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
frostfsidRemoveSubjectFromGroupCmd.Flags().String(morphUtil.AlphabetWalletsFlag, "", morphUtil.AlphabetWalletsFlagDesc)
|
||||||
}
|
}
|
||||||
|
|
||||||
func initFrostfsIDListGroupSubjectsCmd() {
|
func initFrostfsIDListGroupSubjectsCmd() {
|
||||||
|
@ -230,7 +230,7 @@ func initFrostfsIDListGroupSubjectsCmd() {
|
||||||
frostfsidListGroupSubjectsCmd.Flags().String(namespaceFlag, "", "Namespace name")
|
frostfsidListGroupSubjectsCmd.Flags().String(namespaceFlag, "", "Namespace name")
|
||||||
frostfsidListGroupSubjectsCmd.Flags().Int64(groupIDFlag, 0, "Group id")
|
frostfsidListGroupSubjectsCmd.Flags().Int64(groupIDFlag, 0, "Group id")
|
||||||
frostfsidListGroupSubjectsCmd.Flags().Bool(includeNamesFlag, false, "Whether include subject name (require additional requests)")
|
frostfsidListGroupSubjectsCmd.Flags().Bool(includeNamesFlag, false, "Whether include subject name (require additional requests)")
|
||||||
frostfsidListGroupSubjectsCmd.Flags().String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
frostfsidListGroupSubjectsCmd.Flags().String(morphUtil.AlphabetWalletsFlag, "", morphUtil.AlphabetWalletsFlagDesc)
|
||||||
}
|
}
|
||||||
|
|
||||||
func frostfsidCreateNamespace(cmd *cobra.Command, _ []string) {
|
func frostfsidCreateNamespace(cmd *cobra.Command, _ []string) {
|
||||||
|
|
|
@ -44,7 +44,7 @@ func generateAlphabetCreds(cmd *cobra.Command, _ []string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
v := viper.GetViper()
|
v := viper.GetViper()
|
||||||
walletDir := config.ResolveHomePath(viper.GetString(alphabetWalletsFlag))
|
walletDir := config.ResolveHomePath(viper.GetString(morphUtil.AlphabetWalletsFlag))
|
||||||
pwds, err := initializeWallets(v, walletDir, int(size))
|
pwds, err := initializeWallets(v, walletDir, int(size))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -34,28 +34,28 @@ func TestGenerateAlphabet(t *testing.T) {
|
||||||
|
|
||||||
t.Run("zero size", func(t *testing.T) {
|
t.Run("zero size", func(t *testing.T) {
|
||||||
buf.Reset()
|
buf.Reset()
|
||||||
v.Set(alphabetWalletsFlag, walletDir)
|
v.Set(util.AlphabetWalletsFlag, walletDir)
|
||||||
require.NoError(t, cmd.Flags().Set(alphabetSizeFlag, "0"))
|
require.NoError(t, cmd.Flags().Set(alphabetSizeFlag, "0"))
|
||||||
buf.WriteString("pass\r")
|
buf.WriteString("pass\r")
|
||||||
require.Error(t, generateAlphabetCreds(cmd, nil))
|
require.Error(t, generateAlphabetCreds(cmd, nil))
|
||||||
})
|
})
|
||||||
t.Run("no password provided", func(t *testing.T) {
|
t.Run("no password provided", func(t *testing.T) {
|
||||||
buf.Reset()
|
buf.Reset()
|
||||||
v.Set(alphabetWalletsFlag, walletDir)
|
v.Set(util.AlphabetWalletsFlag, walletDir)
|
||||||
require.NoError(t, cmd.Flags().Set(alphabetSizeFlag, "1"))
|
require.NoError(t, cmd.Flags().Set(alphabetSizeFlag, "1"))
|
||||||
require.Error(t, generateAlphabetCreds(cmd, nil))
|
require.Error(t, generateAlphabetCreds(cmd, nil))
|
||||||
})
|
})
|
||||||
t.Run("missing directory", func(t *testing.T) {
|
t.Run("missing directory", func(t *testing.T) {
|
||||||
buf.Reset()
|
buf.Reset()
|
||||||
dir := filepath.Join(os.TempDir(), "notexist."+strconv.FormatUint(rand.Uint64(), 10))
|
dir := filepath.Join(os.TempDir(), "notexist."+strconv.FormatUint(rand.Uint64(), 10))
|
||||||
v.Set(alphabetWalletsFlag, dir)
|
v.Set(util.AlphabetWalletsFlag, dir)
|
||||||
require.NoError(t, cmd.Flags().Set(alphabetSizeFlag, "1"))
|
require.NoError(t, cmd.Flags().Set(alphabetSizeFlag, "1"))
|
||||||
buf.WriteString("pass\r")
|
buf.WriteString("pass\r")
|
||||||
require.Error(t, generateAlphabetCreds(cmd, nil))
|
require.Error(t, generateAlphabetCreds(cmd, nil))
|
||||||
})
|
})
|
||||||
t.Run("no password for contract group wallet", func(t *testing.T) {
|
t.Run("no password for contract group wallet", func(t *testing.T) {
|
||||||
buf.Reset()
|
buf.Reset()
|
||||||
v.Set(alphabetWalletsFlag, walletDir)
|
v.Set(util.AlphabetWalletsFlag, walletDir)
|
||||||
require.NoError(t, cmd.Flags().Set(alphabetSizeFlag, strconv.FormatUint(size, 10)))
|
require.NoError(t, cmd.Flags().Set(alphabetSizeFlag, strconv.FormatUint(size, 10)))
|
||||||
for i := uint64(0); i < size; i++ {
|
for i := uint64(0); i < size; i++ {
|
||||||
buf.WriteString(strconv.FormatUint(i, 10) + "\r")
|
buf.WriteString(strconv.FormatUint(i, 10) + "\r")
|
||||||
|
@ -64,7 +64,7 @@ func TestGenerateAlphabet(t *testing.T) {
|
||||||
})
|
})
|
||||||
|
|
||||||
buf.Reset()
|
buf.Reset()
|
||||||
v.Set(alphabetWalletsFlag, walletDir)
|
v.Set(util.AlphabetWalletsFlag, walletDir)
|
||||||
require.NoError(t, generateAlphabetCmd.Flags().Set(alphabetSizeFlag, strconv.FormatUint(size, 10)))
|
require.NoError(t, generateAlphabetCmd.Flags().Set(alphabetSizeFlag, strconv.FormatUint(size, 10)))
|
||||||
for i := uint64(0); i < size; i++ {
|
for i := uint64(0); i < size; i++ {
|
||||||
buf.WriteString(strconv.FormatUint(i, 10) + "\r")
|
buf.WriteString(strconv.FormatUint(i, 10) + "\r")
|
||||||
|
|
|
@ -103,7 +103,7 @@ func (c *initializeContext) close() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func newInitializeContext(cmd *cobra.Command, v *viper.Viper) (*initializeContext, error) {
|
func newInitializeContext(cmd *cobra.Command, v *viper.Viper) (*initializeContext, error) {
|
||||||
walletDir := config.ResolveHomePath(viper.GetString(alphabetWalletsFlag))
|
walletDir := config.ResolveHomePath(viper.GetString(morphUtil.AlphabetWalletsFlag))
|
||||||
wallets, err := morphUtil.GetAlphabetWallets(v, walletDir)
|
wallets, err := morphUtil.GetAlphabetWallets(v, walletDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -62,7 +62,7 @@ func testInitialize(t *testing.T, committeeSize int) {
|
||||||
|
|
||||||
dumpPath := filepath.Join(testdataDir, "out")
|
dumpPath := filepath.Join(testdataDir, "out")
|
||||||
require.NoError(t, initCmd.Flags().Set(localDumpFlag, dumpPath))
|
require.NoError(t, initCmd.Flags().Set(localDumpFlag, dumpPath))
|
||||||
v.Set(alphabetWalletsFlag, testdataDir)
|
v.Set(util.AlphabetWalletsFlag, testdataDir)
|
||||||
v.Set(epochDurationInitFlag, 1)
|
v.Set(epochDurationInitFlag, 1)
|
||||||
v.Set(maxObjectSizeInitFlag, 1024)
|
v.Set(maxObjectSizeInitFlag, 1024)
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ func testInitialize(t *testing.T, committeeSize int) {
|
||||||
|
|
||||||
func generateTestData(t *testing.T, dir string, size int) error {
|
func generateTestData(t *testing.T, dir string, size int) error {
|
||||||
v := viper.GetViper()
|
v := viper.GetViper()
|
||||||
v.Set(alphabetWalletsFlag, dir)
|
v.Set(util.AlphabetWalletsFlag, dir)
|
||||||
|
|
||||||
sizeStr := strconv.FormatUint(uint64(size), 10)
|
sizeStr := strconv.FormatUint(uint64(size), 10)
|
||||||
if err := generateAlphabetCmd.Flags().Set(alphabetSizeFlag, sizeStr); err != nil {
|
if err := generateAlphabetCmd.Flags().Set(alphabetSizeFlag, sizeStr); err != nil {
|
||||||
|
|
|
@ -7,8 +7,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
alphabetWalletsFlag = "alphabet-wallets"
|
|
||||||
alphabetWalletsFlagDesc = "Path to alphabet wallets dir"
|
|
||||||
alphabetSizeFlag = "size"
|
alphabetSizeFlag = "size"
|
||||||
storageWalletFlag = "storage-wallet"
|
storageWalletFlag = "storage-wallet"
|
||||||
storageWalletLabelFlag = "label"
|
storageWalletLabelFlag = "label"
|
||||||
|
@ -56,7 +54,7 @@ var (
|
||||||
Short: "Generate alphabet wallets for consensus nodes of the morph network",
|
Short: "Generate alphabet wallets for consensus nodes of the morph network",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
// PreRun fixes https://github.com/spf13/viper/issues/233
|
// PreRun fixes https://github.com/spf13/viper/issues/233
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(util.AlphabetWalletsFlag, cmd.Flags().Lookup(util.AlphabetWalletsFlag))
|
||||||
},
|
},
|
||||||
RunE: generateAlphabetCreds,
|
RunE: generateAlphabetCreds,
|
||||||
}
|
}
|
||||||
|
@ -65,7 +63,7 @@ var (
|
||||||
Use: "init",
|
Use: "init",
|
||||||
Short: "Initialize side chain network with smart-contracts and network settings",
|
Short: "Initialize side chain network with smart-contracts and network settings",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(util.AlphabetWalletsFlag, cmd.Flags().Lookup(util.AlphabetWalletsFlag))
|
||||||
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
||||||
_ = viper.BindPFlag(epochDurationInitFlag, cmd.Flags().Lookup(epochDurationCLIFlag))
|
_ = viper.BindPFlag(epochDurationInitFlag, cmd.Flags().Lookup(epochDurationCLIFlag))
|
||||||
_ = viper.BindPFlag(maxObjectSizeInitFlag, cmd.Flags().Lookup(maxObjectSizeCLIFlag))
|
_ = viper.BindPFlag(maxObjectSizeInitFlag, cmd.Flags().Lookup(maxObjectSizeCLIFlag))
|
||||||
|
@ -83,7 +81,7 @@ var (
|
||||||
Use: "generate-storage-wallet",
|
Use: "generate-storage-wallet",
|
||||||
Short: "Generate storage node wallet for the morph network",
|
Short: "Generate storage node wallet for the morph network",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(util.AlphabetWalletsFlag, cmd.Flags().Lookup(util.AlphabetWalletsFlag))
|
||||||
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
||||||
_ = viper.BindPFlag(storageGasConfigFlag, cmd.Flags().Lookup(storageGasCLIFlag))
|
_ = viper.BindPFlag(storageGasConfigFlag, cmd.Flags().Lookup(storageGasCLIFlag))
|
||||||
},
|
},
|
||||||
|
@ -94,7 +92,7 @@ var (
|
||||||
Use: "refill-gas",
|
Use: "refill-gas",
|
||||||
Short: "Refill GAS of storage node's wallet in the morph network",
|
Short: "Refill GAS of storage node's wallet in the morph network",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(util.AlphabetWalletsFlag, cmd.Flags().Lookup(util.AlphabetWalletsFlag))
|
||||||
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
||||||
_ = viper.BindPFlag(refillGasAmountFlag, cmd.Flags().Lookup(refillGasAmountFlag))
|
_ = viper.BindPFlag(refillGasAmountFlag, cmd.Flags().Lookup(refillGasAmountFlag))
|
||||||
},
|
},
|
||||||
|
@ -107,7 +105,7 @@ var (
|
||||||
Use: "force-new-epoch",
|
Use: "force-new-epoch",
|
||||||
Short: "Create new FrostFS epoch event in the side chain",
|
Short: "Create new FrostFS epoch event in the side chain",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(util.AlphabetWalletsFlag, cmd.Flags().Lookup(util.AlphabetWalletsFlag))
|
||||||
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
||||||
},
|
},
|
||||||
RunE: forceNewEpochCmd,
|
RunE: forceNewEpochCmd,
|
||||||
|
@ -118,7 +116,7 @@ var (
|
||||||
Short: "Remove storage nodes from the netmap",
|
Short: "Remove storage nodes from the netmap",
|
||||||
Long: `Move nodes to the Offline state in the candidates list and tick an epoch to update the netmap`,
|
Long: `Move nodes to the Offline state in the candidates list and tick an epoch to update the netmap`,
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(util.AlphabetWalletsFlag, cmd.Flags().Lookup(util.AlphabetWalletsFlag))
|
||||||
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
||||||
},
|
},
|
||||||
RunE: removeNodesCmd,
|
RunE: removeNodesCmd,
|
||||||
|
@ -129,7 +127,7 @@ var (
|
||||||
DisableFlagsInUseLine: true,
|
DisableFlagsInUseLine: true,
|
||||||
Short: "Add/update global config value in the FrostFS network",
|
Short: "Add/update global config value in the FrostFS network",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(util.AlphabetWalletsFlag, cmd.Flags().Lookup(util.AlphabetWalletsFlag))
|
||||||
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
||||||
},
|
},
|
||||||
Args: cobra.MinimumNArgs(1),
|
Args: cobra.MinimumNArgs(1),
|
||||||
|
@ -141,7 +139,7 @@ var (
|
||||||
DisableFlagsInUseLine: true,
|
DisableFlagsInUseLine: true,
|
||||||
Short: "Set global policy values",
|
Short: "Set global policy values",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(util.AlphabetWalletsFlag, cmd.Flags().Lookup(util.AlphabetWalletsFlag))
|
||||||
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
||||||
},
|
},
|
||||||
RunE: setPolicyCmd,
|
RunE: setPolicyCmd,
|
||||||
|
@ -190,7 +188,7 @@ var (
|
||||||
Use: "update-contracts",
|
Use: "update-contracts",
|
||||||
Short: "Update FrostFS contracts",
|
Short: "Update FrostFS contracts",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(util.AlphabetWalletsFlag, cmd.Flags().Lookup(util.AlphabetWalletsFlag))
|
||||||
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
||||||
},
|
},
|
||||||
RunE: updateContracts,
|
RunE: updateContracts,
|
||||||
|
@ -209,7 +207,7 @@ var (
|
||||||
Use: "restore-containers",
|
Use: "restore-containers",
|
||||||
Short: "Restore FrostFS containers from file",
|
Short: "Restore FrostFS containers from file",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(util.AlphabetWalletsFlag, cmd.Flags().Lookup(util.AlphabetWalletsFlag))
|
||||||
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
||||||
},
|
},
|
||||||
RunE: restoreContainers,
|
RunE: restoreContainers,
|
||||||
|
@ -238,7 +236,7 @@ var (
|
||||||
Short: "List netmap candidates nodes",
|
Short: "List netmap candidates nodes",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(util.AlphabetWalletsFlag, cmd.Flags().Lookup(util.AlphabetWalletsFlag))
|
||||||
},
|
},
|
||||||
Run: listNetmapCandidatesNodes,
|
Run: listNetmapCandidatesNodes,
|
||||||
}
|
}
|
||||||
|
@ -247,7 +245,7 @@ var (
|
||||||
Use: "proxy-add-account",
|
Use: "proxy-add-account",
|
||||||
Short: "Adds account to proxy contract",
|
Short: "Adds account to proxy contract",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(util.AlphabetWalletsFlag, cmd.Flags().Lookup(util.AlphabetWalletsFlag))
|
||||||
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
||||||
},
|
},
|
||||||
Run: addProxyAccount,
|
Run: addProxyAccount,
|
||||||
|
@ -257,7 +255,7 @@ var (
|
||||||
Use: "proxy-remove-account",
|
Use: "proxy-remove-account",
|
||||||
Short: "Remove from proxy contract",
|
Short: "Remove from proxy contract",
|
||||||
PreRun: func(cmd *cobra.Command, _ []string) {
|
PreRun: func(cmd *cobra.Command, _ []string) {
|
||||||
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
|
_ = viper.BindPFlag(util.AlphabetWalletsFlag, cmd.Flags().Lookup(util.AlphabetWalletsFlag))
|
||||||
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
_ = viper.BindPFlag(util.EndpointFlag, cmd.Flags().Lookup(util.EndpointFlag))
|
||||||
},
|
},
|
||||||
Run: removeProxyAccount,
|
Run: removeProxyAccount,
|
||||||
|
@ -337,7 +335,7 @@ func initDepositoryNotaryCmd() {
|
||||||
|
|
||||||
func initRefillGasCmd() {
|
func initRefillGasCmd() {
|
||||||
RootCmd.AddCommand(refillGasCmd)
|
RootCmd.AddCommand(refillGasCmd)
|
||||||
refillGasCmd.Flags().String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
refillGasCmd.Flags().String(util.AlphabetWalletsFlag, "", util.AlphabetWalletsFlagDesc)
|
||||||
refillGasCmd.Flags().StringP(util.EndpointFlag, util.EndpointFlagShort, "", util.EndpointFlagDesc)
|
refillGasCmd.Flags().StringP(util.EndpointFlag, util.EndpointFlagShort, "", util.EndpointFlagDesc)
|
||||||
refillGasCmd.Flags().String(storageWalletFlag, "", "Path to storage node wallet")
|
refillGasCmd.Flags().String(storageWalletFlag, "", "Path to storage node wallet")
|
||||||
refillGasCmd.Flags().String(walletAddressFlag, "", "Address of wallet")
|
refillGasCmd.Flags().String(walletAddressFlag, "", "Address of wallet")
|
||||||
|
@ -353,7 +351,7 @@ func initListContainersCmd() {
|
||||||
|
|
||||||
func initRestoreContainersCmd() {
|
func initRestoreContainersCmd() {
|
||||||
RootCmd.AddCommand(restoreContainersCmd)
|
RootCmd.AddCommand(restoreContainersCmd)
|
||||||
restoreContainersCmd.Flags().String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
restoreContainersCmd.Flags().String(util.AlphabetWalletsFlag, "", util.AlphabetWalletsFlagDesc)
|
||||||
restoreContainersCmd.Flags().StringP(util.EndpointFlag, util.EndpointFlagShort, "", util.EndpointFlagDesc)
|
restoreContainersCmd.Flags().StringP(util.EndpointFlag, util.EndpointFlagShort, "", util.EndpointFlagDesc)
|
||||||
restoreContainersCmd.Flags().String(containerDumpFlag, "", "File to restore containers from")
|
restoreContainersCmd.Flags().String(containerDumpFlag, "", "File to restore containers from")
|
||||||
restoreContainersCmd.Flags().StringSlice(containerIDsFlag, nil, "Containers to restore")
|
restoreContainersCmd.Flags().StringSlice(containerIDsFlag, nil, "Containers to restore")
|
||||||
|
@ -369,7 +367,7 @@ func initDumpContainersCmd() {
|
||||||
|
|
||||||
func initUpdateContractsCmd() {
|
func initUpdateContractsCmd() {
|
||||||
RootCmd.AddCommand(updateContractsCmd)
|
RootCmd.AddCommand(updateContractsCmd)
|
||||||
updateContractsCmd.Flags().String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
updateContractsCmd.Flags().String(util.AlphabetWalletsFlag, "", util.AlphabetWalletsFlagDesc)
|
||||||
updateContractsCmd.Flags().StringP(util.EndpointFlag, util.EndpointFlagShort, "", util.EndpointFlagDesc)
|
updateContractsCmd.Flags().StringP(util.EndpointFlag, util.EndpointFlagShort, "", util.EndpointFlagDesc)
|
||||||
updateContractsCmd.Flags().String(contractsInitFlag, "", contractsInitFlagDesc)
|
updateContractsCmd.Flags().String(contractsInitFlag, "", contractsInitFlagDesc)
|
||||||
updateContractsCmd.Flags().String(contractsURLFlag, "", contractsURLFlagDesc)
|
updateContractsCmd.Flags().String(contractsURLFlag, "", contractsURLFlagDesc)
|
||||||
|
@ -387,7 +385,7 @@ func initDumpBalancesCmd() {
|
||||||
|
|
||||||
func initSetConfigCmd() {
|
func initSetConfigCmd() {
|
||||||
RootCmd.AddCommand(setConfig)
|
RootCmd.AddCommand(setConfig)
|
||||||
setConfig.Flags().String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
setConfig.Flags().String(util.AlphabetWalletsFlag, "", util.AlphabetWalletsFlagDesc)
|
||||||
setConfig.Flags().StringP(util.EndpointFlag, util.EndpointFlagShort, "", util.EndpointFlagDesc)
|
setConfig.Flags().StringP(util.EndpointFlag, util.EndpointFlagShort, "", util.EndpointFlagDesc)
|
||||||
setConfig.Flags().Bool(forceConfigSet, false, "Force setting not well-known configuration key")
|
setConfig.Flags().Bool(forceConfigSet, false, "Force setting not well-known configuration key")
|
||||||
setConfig.Flags().String(localDumpFlag, "", "Path to the blocks dump file")
|
setConfig.Flags().String(localDumpFlag, "", "Path to the blocks dump file")
|
||||||
|
@ -406,7 +404,7 @@ func initDumpContractHashesCmd() {
|
||||||
|
|
||||||
func initSetPolicyCmd() {
|
func initSetPolicyCmd() {
|
||||||
RootCmd.AddCommand(setPolicy)
|
RootCmd.AddCommand(setPolicy)
|
||||||
setPolicy.Flags().String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
setPolicy.Flags().String(util.AlphabetWalletsFlag, "", util.AlphabetWalletsFlagDesc)
|
||||||
setPolicy.Flags().StringP(util.EndpointFlag, util.EndpointFlagShort, "", util.EndpointFlagDesc)
|
setPolicy.Flags().StringP(util.EndpointFlag, util.EndpointFlagShort, "", util.EndpointFlagDesc)
|
||||||
setPolicy.Flags().String(localDumpFlag, "", "Path to the blocks dump file")
|
setPolicy.Flags().String(localDumpFlag, "", "Path to the blocks dump file")
|
||||||
}
|
}
|
||||||
|
@ -418,21 +416,21 @@ func initDumpPolicyCmd() {
|
||||||
|
|
||||||
func initRemoveNodesCmd() {
|
func initRemoveNodesCmd() {
|
||||||
RootCmd.AddCommand(removeNodes)
|
RootCmd.AddCommand(removeNodes)
|
||||||
removeNodes.Flags().String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
removeNodes.Flags().String(util.AlphabetWalletsFlag, "", util.AlphabetWalletsFlagDesc)
|
||||||
removeNodes.Flags().StringP(util.EndpointFlag, util.EndpointFlagShort, "", util.EndpointFlagDesc)
|
removeNodes.Flags().StringP(util.EndpointFlag, util.EndpointFlagShort, "", util.EndpointFlagDesc)
|
||||||
removeNodes.Flags().String(localDumpFlag, "", "Path to the blocks dump file")
|
removeNodes.Flags().String(localDumpFlag, "", "Path to the blocks dump file")
|
||||||
}
|
}
|
||||||
|
|
||||||
func initForceNewEpochCmd() {
|
func initForceNewEpochCmd() {
|
||||||
RootCmd.AddCommand(forceNewEpoch)
|
RootCmd.AddCommand(forceNewEpoch)
|
||||||
forceNewEpoch.Flags().String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
forceNewEpoch.Flags().String(util.AlphabetWalletsFlag, "", util.AlphabetWalletsFlagDesc)
|
||||||
forceNewEpoch.Flags().StringP(util.EndpointFlag, util.EndpointFlagShort, "", util.EndpointFlagDesc)
|
forceNewEpoch.Flags().StringP(util.EndpointFlag, util.EndpointFlagShort, "", util.EndpointFlagDesc)
|
||||||
forceNewEpoch.Flags().String(localDumpFlag, "", "Path to the blocks dump file")
|
forceNewEpoch.Flags().String(localDumpFlag, "", "Path to the blocks dump file")
|
||||||
}
|
}
|
||||||
|
|
||||||
func initGenerateStorageCmd() {
|
func initGenerateStorageCmd() {
|
||||||
RootCmd.AddCommand(generateStorageCmd)
|
RootCmd.AddCommand(generateStorageCmd)
|
||||||
generateStorageCmd.Flags().String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
generateStorageCmd.Flags().String(util.AlphabetWalletsFlag, "", util.AlphabetWalletsFlagDesc)
|
||||||
generateStorageCmd.Flags().StringP(util.EndpointFlag, util.EndpointFlagShort, "", util.EndpointFlagDesc)
|
generateStorageCmd.Flags().StringP(util.EndpointFlag, util.EndpointFlagShort, "", util.EndpointFlagDesc)
|
||||||
generateStorageCmd.Flags().String(storageWalletFlag, "", "Path to new storage node wallet")
|
generateStorageCmd.Flags().String(storageWalletFlag, "", "Path to new storage node wallet")
|
||||||
generateStorageCmd.Flags().String(storageGasCLIFlag, "", "Initial amount of GAS to transfer")
|
generateStorageCmd.Flags().String(storageGasCLIFlag, "", "Initial amount of GAS to transfer")
|
||||||
|
@ -441,7 +439,7 @@ func initGenerateStorageCmd() {
|
||||||
|
|
||||||
func initInitCmd() {
|
func initInitCmd() {
|
||||||
RootCmd.AddCommand(initCmd)
|
RootCmd.AddCommand(initCmd)
|
||||||
initCmd.Flags().String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
initCmd.Flags().String(util.AlphabetWalletsFlag, "", util.AlphabetWalletsFlagDesc)
|
||||||
initCmd.Flags().StringP(util.EndpointFlag, util.EndpointFlagShort, "", util.EndpointFlagDesc)
|
initCmd.Flags().StringP(util.EndpointFlag, util.EndpointFlagShort, "", util.EndpointFlagDesc)
|
||||||
initCmd.Flags().String(contractsInitFlag, "", contractsInitFlagDesc)
|
initCmd.Flags().String(contractsInitFlag, "", contractsInitFlagDesc)
|
||||||
initCmd.Flags().String(contractsURLFlag, "", contractsURLFlagDesc)
|
initCmd.Flags().String(contractsURLFlag, "", contractsURLFlagDesc)
|
||||||
|
@ -458,7 +456,7 @@ func initInitCmd() {
|
||||||
|
|
||||||
func initGenerateAlphabetCmd() {
|
func initGenerateAlphabetCmd() {
|
||||||
RootCmd.AddCommand(generateAlphabetCmd)
|
RootCmd.AddCommand(generateAlphabetCmd)
|
||||||
generateAlphabetCmd.Flags().String(alphabetWalletsFlag, "", alphabetWalletsFlagDesc)
|
generateAlphabetCmd.Flags().String(util.AlphabetWalletsFlag, "", util.AlphabetWalletsFlagDesc)
|
||||||
generateAlphabetCmd.Flags().Uint(alphabetSizeFlag, 7, "Amount of alphabet wallets to generate")
|
generateAlphabetCmd.Flags().Uint(alphabetSizeFlag, 7, "Amount of alphabet wallets to generate")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,9 @@ const (
|
||||||
// See: https://github.com/nspcc-dev/neo-go/blob/740488f7f35e367eaa99a71c0a609c315fe2b0fc/pkg/core/transaction/witness.go#L10
|
// See: https://github.com/nspcc-dev/neo-go/blob/740488f7f35e367eaa99a71c0a609c315fe2b0fc/pkg/core/transaction/witness.go#L10
|
||||||
MaxAlphabetNodes = 22
|
MaxAlphabetNodes = 22
|
||||||
|
|
||||||
EndpointFlag = "rpc-endpoint"
|
EndpointFlag = "rpc-endpoint"
|
||||||
EndpointFlagDesc = "N3 RPC node endpoint"
|
EndpointFlagDesc = "N3 RPC node endpoint"
|
||||||
EndpointFlagShort = "r"
|
EndpointFlagShort = "r"
|
||||||
|
AlphabetWalletsFlag = "alphabet-wallets"
|
||||||
|
AlphabetWalletsFlagDesc = "Path to alphabet wallets dir"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue