Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions cmd/neofs-node/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import (
"github.com/nspcc-dev/neofs-node/pkg/services/replicator"
trustcontroller "github.com/nspcc-dev/neofs-node/pkg/services/reputation/local/controller"
truststorage "github.com/nspcc-dev/neofs-node/pkg/services/reputation/local/storage"
"github.com/nspcc-dev/neofs-node/pkg/services/sidechain"
"github.com/nspcc-dev/neofs-node/pkg/timers"
"github.com/nspcc-dev/neofs-node/pkg/util"
"github.com/nspcc-dev/neofs-node/pkg/util/state"
Expand Down Expand Up @@ -175,6 +176,7 @@ type shared struct {
control *controlSvc.Server

metaService *meta.Meta
sidechain *sidechain.SideChain

containerPayments *paymentChecker
}
Expand All @@ -200,7 +202,6 @@ type cfg struct {
// configuration of the internal
// services
cfgGRPC cfgGRPC
cfgMeta cfgMeta
cfgMorph cfgMorph
cfgBalance cfgBalance
cfgContainer cfgContainer
Expand Down Expand Up @@ -253,10 +254,6 @@ func (g *cfgGRPC) registerService(f func(*grpc.Server)) {
}
}

type cfgMeta struct {
network meta.NeoFSNetwork
}

type cfgMorph struct {
client *client.Client

Expand Down Expand Up @@ -731,16 +728,6 @@ func (c *cfg) configWatcher(ctx context.Context) {
continue
}

// Meta service

var p meta.Parameters
p.NeoEnpoints = c.appCfg.FSChain.Endpoints
err = c.metaService.Reload(p)
if err != nil {
c.log.Error("failed to reload meta service configuration", zap.Error(err))
continue
}

// gRPC

if err = reloadGRPC(c, oldGRPC); err != nil {
Expand Down
6 changes: 6 additions & 0 deletions cmd/neofs-node/config/meta/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ func TestLoggerSection_Level(t *testing.T) {
t.Run("defaults", func(t *testing.T) {
emptyConfig := configtest.EmptyConfig()
require.Equal(t, "", emptyConfig.Meta.Path)
require.Zero(t, emptyConfig.Meta.SeedPort)
require.Nil(t, emptyConfig.Meta.P2PAddresses)
require.Nil(t, emptyConfig.Meta.RPCAddresses)
})

const path = "../../../../config/example/node"

var fileConfigTest = func(c *config.Config) {
require.Equal(t, "path/to/meta", c.Meta.Path)
require.Equal(t, uint64(20334), c.Meta.SeedPort)
require.Equal(t, []string{"node1:20334", "node2:20334"}, c.Meta.P2PAddresses)
require.Equal(t, []string{"localhost:30334"}, c.Meta.RPCAddresses)
}

configtest.ForEachFileType(path, fileConfigTest)
Expand Down
13 changes: 13 additions & 0 deletions cmd/neofs-node/config/meta/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,17 @@ package metaconfig
// Meta contains configuration for Meta service.
type Meta struct {
Path string `mapstructure:"path"`

// SeedPort of metadata chain network. Addresses will be used the same as
// the configured ones in FS chain.
SeedPort uint64 `mapstructure:"seed_port"`

// Network addresses to listen Neo metadata P2P on list in the form of
// "[host]:[port][:announcedPort]".
P2PAddresses []string `mapstructure:"p2p_addresses"`

// Neo RPC service configuration.
//
// Optional.
RPCAddresses []string `mapstructure:"rpc_addresses"`
}
2 changes: 1 addition & 1 deletion cmd/neofs-node/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func initApp(c *cfg) {
initAndLog(c, "accounting", initAccountingService)
initAndLog(c, "session", initSessionService)
initAndLog(c, "reputation", initReputationService)
initAndLog(c, "meta", initMeta)
initAndLog(c, "meta sidechain", initMeta)
initAndLog(c, "object", initObjectService)

initAndLog(c, "morph notifications", listenMorphNotifications)
Expand Down
192 changes: 0 additions & 192 deletions cmd/neofs-node/meta.go

This file was deleted.

Loading
Loading