adm: Add command morph netmap-candidates #15

Merged
acid-ant merged 3 commits from feature/1889-morph-nm-candidates into master 2023-02-06 14:26:35 +00:00
7 changed files with 53 additions and 4 deletions
Showing only changes of commit abaf4c55bc - Show all commits

View file

@ -8,6 +8,7 @@ Changelog for FrostFS Node
- Doc for extended headers (#2128)
- New `frostfs_node_object_container_size` metric for tracking size of reqular objects in a container (#2116)
- New `frostfs_node_object_payload_size` metric for tracking size of reqular objects on a single shard (#1794)
- Add command `frostfs-adm morph netmap-candidates` (#1889)
### Changed
- `common.PrintVerbose` prints via `cobra.Command.Printf` (#1962)

View file

@ -4,4 +4,8 @@ const (
ConfigFlag = "config"
ConfigFlagShorthand = "c"
ConfigFlagUsage = "Config file"
Verbose = "verbose"
VerboseShorthand = "v"
VerboseUsage = "Verbose output"
)

View file

@ -0,0 +1,29 @@
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
package morph
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
import (
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
"github.com/TrueCloudLab/frostfs-node/cmd/frostfs-adm/internal/commonflags"
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
commonCmd "github.com/TrueCloudLab/frostfs-node/cmd/internal/common"
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
"github.com/TrueCloudLab/frostfs-node/pkg/morph/client/netmap"
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
"github.com/nspcc-dev/neo-go/pkg/rpcclient/invoker"
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
"github.com/spf13/cobra"
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
"github.com/spf13/viper"
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
)
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
func listNetmapCandidatesNodes(cmd *cobra.Command, _ []string) {
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
c, err := getN3Client(viper.GetViper())
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
commonCmd.ExitOnErr(cmd, "can't create N3 client: %w", err)
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
inv := invoker.New(c, nil)
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
cs, err := c.GetContractStateByID(1)
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
commonCmd.ExitOnErr(cmd, "can't get NNS contract info: %w", err)
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
nmHash, err := nnsResolveHash(inv, cs.Hash, netmapContract+".frostfs")
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
commonCmd.ExitOnErr(cmd, "can't get netmap contract hash: %w", err)
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
res, err := inv.Call(nmHash, "netmapCandidates")
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
commonCmd.ExitOnErr(cmd, "can't fetch list of network config keys from the netmap contract", err)
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
nm, err := netmap.DecodeNetMap(res.Stack)
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
commonCmd.ExitOnErr(cmd, "unable to decode netmap: %w", err)
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
commonCmd.PrettyPrintNetMap(cmd, *nm, !viper.GetBool(commonflags.Verbose))
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.
}
carpawell commented 2023-01-13 15:49:58 +00:00 (Migrated from github.com)
Review

lets try not to use RunE according to #623?

lets try not to use `RunE` according to #623?
carpawell commented 2023-01-13 15:51:07 +00:00 (Migrated from github.com)
Review

why do we need it?

why do we need it?
carpawell commented 2023-01-13 15:56:21 +00:00 (Migrated from github.com)
Review

that context is usually used for complex transactions. for RO purposes it looks too heavy, see morph dump-config as an example

that context is usually used for complex transactions. for RO purposes it looks too heavy, see `morph dump-config` as an example
acid-ant commented 2023-01-16 11:09:58 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
acid-ant commented 2023-01-16 11:10:13 +00:00 (Migrated from github.com)
Review

Removed.

Removed.
acid-ant commented 2023-01-16 11:10:24 +00:00 (Migrated from github.com)
Review

Refactored.

Refactored.
fyrchik commented 2023-01-23 08:56:32 +00:00 (Migrated from github.com)
Review

Is it possible to have res == nil and err == nil at the same time?

Is it possible to have `res == nil` and `err == nil` at the same time?
acid-ant commented 2023-01-23 09:38:59 +00:00 (Migrated from github.com)
Review

Removed redundant check.

Removed redundant check.

View file

@ -226,6 +226,16 @@ var (
},
RunE: depositNotary,
}
netmapCandidatesCmd = &cobra.Command{
Use: "netmap-candidates",
Short: "List netmap candidates nodes",
PreRun: func(cmd *cobra.Command, _ []string) {
_ = viper.BindPFlag(endpointFlag, cmd.Flags().Lookup(endpointFlag))
_ = viper.BindPFlag(alphabetWalletsFlag, cmd.Flags().Lookup(alphabetWalletsFlag))
},
Run: listNetmapCandidatesNodes,
}
)
func init() {
@ -323,4 +333,7 @@ func init() {
depositNotaryCmd.Flags().String(walletAccountFlag, "", "Wallet account address")
depositNotaryCmd.Flags().String(refillGasAmountFlag, "", "Amount of GAS to deposit")
fyrchik commented 2023-01-23 08:57:31 +00:00 (Migrated from github.com)
Review

Why not short by default and --verbose for everything?

Why not short by default and `--verbose` for everything?
acid-ant commented 2023-01-23 09:39:23 +00:00 (Migrated from github.com)
Review

Good idea, replaced with --verbose.

Good idea, replaced with `--verbose`.
depositNotaryCmd.Flags().String(notaryDepositTillFlag, "", "Notary deposit duration in blocks")
RootCmd.AddCommand(netmapCandidatesCmd)
netmapCandidatesCmd.Flags().StringP(endpointFlag, "r", "", "N3 RPC node endpoint")
}

View file

@ -34,6 +34,8 @@ func init() {
rootCmd.SetOut(os.Stdout)
rootCmd.PersistentFlags().StringP(commonflags.ConfigFlag, commonflags.ConfigFlagShorthand, "", commonflags.ConfigFlagUsage)
rootCmd.PersistentFlags().BoolP(commonflags.Verbose, commonflags.VerboseShorthand, false, commonflags.VerboseUsage)
_ = viper.BindPFlag(commonflags.Verbose, rootCmd.PersistentFlags().Lookup(commonflags.Verbose))
rootCmd.Flags().Bool("version", false, "Application version")
rootCmd.AddCommand(config.RootCmd)

View file

@ -22,7 +22,7 @@ func (c *Client) GetNetMapByEpoch(epoch uint64) (*netmap.NetMap, error) {
epochSnapshotMethod, err)
}
nm, err := decodeNetMap(res)
nm, err := DecodeNetMap(res)
if err != nil {
return nil, err
}
@ -61,10 +61,10 @@ func (c *Client) NetMap() (*netmap.NetMap, error) {
netMapMethod, err)
}
return decodeNetMap(res)
return DecodeNetMap(res)
}
func decodeNetMap(resStack []stackitem.Item) (*netmap.NetMap, error) {
func DecodeNetMap(resStack []stackitem.Item) (*netmap.NetMap, error) {
var nm netmap.NetMap
if len(resStack) > 0 {

View file

@ -16,5 +16,5 @@ func (c *Client) GetNetMap(diff uint64) (*netmap.NetMap, error) {
return nil, err
}
return decodeNetMap(res)
return DecodeNetMap(res)
}