[#971] ir: Drop CLI validators voting functionality

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-11-08 18:39:58 +03:00 committed by Alex Vanin
parent c167ae26f9
commit 8e1f187822
2 changed files with 0 additions and 31 deletions

View file

@ -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

View file

@ -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 {