forked from TrueCloudLab/frostfs-node
[#971] ir: Drop CLI validators voting functionality
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
c167ae26f9
commit
8e1f187822
2 changed files with 0 additions and 31 deletions
|
@ -7,10 +7,8 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"strings"
|
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
|
|
||||||
"github.com/nspcc-dev/neofs-node/misc"
|
"github.com/nspcc-dev/neofs-node/misc"
|
||||||
"github.com/nspcc-dev/neofs-node/pkg/innerring"
|
"github.com/nspcc-dev/neofs-node/pkg/innerring"
|
||||||
httputil "github.com/nspcc-dev/neofs-node/pkg/util/http"
|
httputil "github.com/nspcc-dev/neofs-node/pkg/util/http"
|
||||||
|
@ -37,7 +35,6 @@ func exitErr(err error) {
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
configFile := flag.String("config", "", "path to config")
|
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")
|
versionFlag := flag.Bool("version", false, "neofs-ir node version")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
@ -75,16 +72,6 @@ func main() {
|
||||||
innerRing, err := innerring.New(ctx, log, cfg)
|
innerRing, err := innerring.New(ctx, log, cfg)
|
||||||
exitErr(err)
|
exitErr(err)
|
||||||
|
|
||||||
if len(*validators) != 0 {
|
|
||||||
validatorKeys, err := parsePublicKeysFromString(*validators)
|
|
||||||
exitErr(err)
|
|
||||||
|
|
||||||
err = innerRing.InitAndVoteForSidechainValidator(validatorKeys)
|
|
||||||
exitErr(err)
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// start HTTP servers
|
// start HTTP servers
|
||||||
for i := range httpServers {
|
for i := range httpServers {
|
||||||
srv := httpServers[i]
|
srv := httpServers[i]
|
||||||
|
@ -129,12 +116,6 @@ func main() {
|
||||||
log.Info("application stopped")
|
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 {
|
func initHTTPServers(cfg *viper.Viper) []*httputil.Server {
|
||||||
items := []struct {
|
items := []struct {
|
||||||
cfgPrefix string
|
cfgPrefix string
|
||||||
|
|
|
@ -118,18 +118,6 @@ func (s *Server) voteForSidechainValidator(validators keys.PublicKeys) error {
|
||||||
return nil
|
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
|
// VoteForSidechainValidator calls vote method on alphabet contracts with
|
||||||
// provided list of keys.
|
// provided list of keys.
|
||||||
func (s *Server) VoteForSidechainValidator(validators keys.PublicKeys) error {
|
func (s *Server) VoteForSidechainValidator(validators keys.PublicKeys) error {
|
||||||
|
|
Loading…
Reference in a new issue