@@ -42,6 +42,9 @@ const (
42
42
localDumpFlag = "local-dump"
43
43
protoConfigPath = "protocol"
44
44
walletAddressFlag = "wallet-address"
45
+ domainFlag = "domain"
46
+ neoAddressesFlag = "neo-addresses"
47
+ publicKeysFlag = "public-keys"
45
48
)
46
49
47
50
var (
@@ -257,6 +260,38 @@ Values for unknown keys are added exactly the way they're provided, no conversio
257
260
},
258
261
RunE : listNetmapCandidatesNodes ,
259
262
}
263
+
264
+ verifiedNodesDomainCmd = & cobra.Command {
265
+ Use : "verified-nodes-domain" ,
266
+ Short : "Group of commands to work with verified domains for the storage nodes" ,
267
+ Args : cobra .NoArgs ,
268
+ PersistentPreRun : func (cmd * cobra.Command , _ []string ) {
269
+ _ = viper .BindPFlag (endpointFlag , cmd .Flags ().Lookup (endpointFlag ))
270
+ _ = viper .BindPFlag (domainFlag , cmd .Flags ().Lookup (domainFlag ))
271
+ },
272
+ }
273
+
274
+ verifiedNodesDomainAccessListCmd = & cobra.Command {
275
+ Use : "access-list" ,
276
+ Short : "Get access list for the verified nodes' domain" ,
277
+ Long : "List Neo addresses of the storage nodes that have access to use the specified verified domain." ,
278
+ Args : cobra .NoArgs ,
279
+ RunE : verifiedNodesDomainAccessList ,
280
+ }
281
+
282
+ verifiedNodesDomainSetAccessListCmd = & cobra.Command {
283
+ Use : "set-access-list" ,
284
+ Short : "Set access list for the verified nodes' domain" ,
285
+ Long : "Set list of the storage nodes that have access to use the specified verified domain. " +
286
+ "The list may be either Neo addresses or HEX-encoded public keys of the nodes." ,
287
+ Args : cobra .NoArgs ,
288
+ PreRun : func (cmd * cobra.Command , _ []string ) {
289
+ _ = viper .BindPFlag (alphabetWalletsFlag , cmd .Flags ().Lookup (alphabetWalletsFlag ))
290
+ _ = viper .BindPFlag (publicKeysFlag , cmd .Flags ().Lookup (publicKeysFlag ))
291
+ _ = viper .BindPFlag (neoAddressesFlag , cmd .Flags ().Lookup (neoAddressesFlag ))
292
+ },
293
+ RunE : verifiedNodesDomainSetAccessList ,
294
+ }
260
295
)
261
296
262
297
func init () {
@@ -365,4 +400,29 @@ func init() {
365
400
366
401
RootCmd .AddCommand (netmapCandidatesCmd )
367
402
netmapCandidatesCmd .Flags ().StringP (endpointFlag , "r" , "" , "N3 RPC node endpoint" )
403
+
404
+ cmd := verifiedNodesDomainAccessListCmd
405
+ fs := cmd .Flags ()
406
+ fs .StringP (endpointFlag , "r" , "" , "NeoFS Sidechain RPC endpoint" )
407
+ _ = cmd .MarkFlagRequired (endpointFlag )
408
+ fs .StringP (domainFlag , "d" , "" , "Verified domain of the storage nodes. Must be a valid NeoFS NNS domain (e.g. 'nodes.some-org.neofs')" )
409
+ _ = cmd .MarkFlagRequired (domainFlag )
410
+
411
+ verifiedNodesDomainCmd .AddCommand (cmd )
412
+
413
+ cmd = verifiedNodesDomainSetAccessListCmd
414
+ fs = cmd .Flags ()
415
+ fs .String (alphabetWalletsFlag , "" , "Path to directory containing Alphabet wallets in files 'az.json', 'buky.json', etc." )
416
+ _ = cmd .MarkFlagRequired (alphabetWalletsFlag )
417
+ fs .StringP (endpointFlag , "r" , "" , "NeoFS Sidechain RPC endpoint" )
418
+ _ = cmd .MarkFlagRequired (endpointFlag )
419
+ fs .StringP (domainFlag , "d" , "" , "Verified domain of the storage nodes. Must be a valid NeoFS NNS domain (e.g. 'nodes.some-org.neofs')" )
420
+ _ = cmd .MarkFlagRequired (domainFlag )
421
+ fs .StringSlice (neoAddressesFlag , nil , "Neo addresses resolved from public keys of the storage nodes" )
422
+ fs .StringSlice (publicKeysFlag , nil , "HEX-encoded public keys of the storage nodes" )
423
+ cmd .MarkFlagsMutuallyExclusive (publicKeysFlag , neoAddressesFlag )
424
+
425
+ verifiedNodesDomainCmd .AddCommand (cmd )
426
+
427
+ RootCmd .AddCommand (verifiedNodesDomainCmd )
368
428
}
0 commit comments