From 8e1f1878220e6945d6c2c26c779afad994a913ff Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Mon, 8 Nov 2021 18:39:58 +0300 Subject: [PATCH] [#971] ir: Drop CLI validators voting functionality Signed-off-by: Pavel Karpy --- cmd/neofs-ir/main.go | 19 ------------------- pkg/innerring/state.go | 12 ------------ 2 files changed, 31 deletions(-) diff --git a/cmd/neofs-ir/main.go b/cmd/neofs-ir/main.go index 0f144d2e6..5509e1609 100644 --- a/cmd/neofs-ir/main.go +++ b/cmd/neofs-ir/main.go @@ -7,10 +7,8 @@ import ( "net/http" "os" "os/signal" - "strings" "syscall" - "github.com/nspcc-dev/neo-go/pkg/crypto/keys" "github.com/nspcc-dev/neofs-node/misc" "github.com/nspcc-dev/neofs-node/pkg/innerring" httputil "github.com/nspcc-dev/neofs-node/pkg/util/http" @@ -37,7 +35,6 @@ func exitErr(err error) { func main() { configFile := flag.String("config", "", "path to config") - validators := flag.String("vote", "", "hex encoded public keys split with comma") versionFlag := flag.Bool("version", false, "neofs-ir node version") flag.Parse() @@ -75,16 +72,6 @@ func main() { innerRing, err := innerring.New(ctx, log, cfg) exitErr(err) - if len(*validators) != 0 { - validatorKeys, err := parsePublicKeysFromString(*validators) - exitErr(err) - - err = innerRing.InitAndVoteForSidechainValidator(validatorKeys) - exitErr(err) - - return - } - // start HTTP servers for i := range httpServers { srv := httpServers[i] @@ -129,12 +116,6 @@ func main() { log.Info("application stopped") } -func parsePublicKeysFromString(argument string) (keys.PublicKeys, error) { - publicKeysString := strings.Split(argument, ",") - - return innerring.ParsePublicKeysFromStrings(publicKeysString) -} - func initHTTPServers(cfg *viper.Viper) []*httputil.Server { items := []struct { cfgPrefix string diff --git a/pkg/innerring/state.go b/pkg/innerring/state.go index 368de8051..c3c069f25 100644 --- a/pkg/innerring/state.go +++ b/pkg/innerring/state.go @@ -118,18 +118,6 @@ func (s *Server) voteForSidechainValidator(validators keys.PublicKeys) error { return nil } -// InitAndVoteForSidechainValidator is a public function to use outside of -// inner ring daemon execution. It initialize inner ring structure with data -// from blockchain and then calls vote method on alphabet contracts. -func (s *Server) InitAndVoteForSidechainValidator(validators keys.PublicKeys) error { - err := s.initConfigFromBlockchain() - if err != nil { - return err - } - - return s.VoteForSidechainValidator(validators) -} - // VoteForSidechainValidator calls vote method on alphabet contracts with // provided list of keys. func (s *Server) VoteForSidechainValidator(validators keys.PublicKeys) error {