[#84] Add API version to neofs-node config

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-10-08 16:16:00 +03:00 committed by Alex Vanin
parent 2d5cb378a7
commit 20c27d0542

View file

@ -8,6 +8,7 @@ import (
"sync" "sync"
"github.com/nspcc-dev/neo-go/pkg/util" "github.com/nspcc-dev/neo-go/pkg/util"
"github.com/nspcc-dev/neofs-api-go/pkg"
"github.com/nspcc-dev/neofs-api-go/v2/netmap" "github.com/nspcc-dev/neofs-api-go/v2/netmap"
crypto "github.com/nspcc-dev/neofs-crypto" crypto "github.com/nspcc-dev/neofs-crypto"
"github.com/nspcc-dev/neofs-node/misc" "github.com/nspcc-dev/neofs-node/misc"
@ -90,6 +91,8 @@ type cfg struct {
key *ecdsa.PrivateKey key *ecdsa.PrivateKey
apiVersion *pkg.Version
cfgGRPC cfgGRPC cfgGRPC cfgGRPC
cfgMorph cfgMorph cfgMorph cfgMorph
@ -201,11 +204,12 @@ func initCfg(path string) *cfg {
maxAddrAmount := maxChunkSize / addressSize // each address is about 72 bytes maxAddrAmount := maxChunkSize / addressSize // each address is about 72 bytes
c := &cfg{ c := &cfg{
ctx: context.Background(), ctx: context.Background(),
viper: viperCfg, viper: viperCfg,
log: log, log: log,
wg: new(sync.WaitGroup), wg: new(sync.WaitGroup),
key: key, key: key,
apiVersion: pkg.SDKVersion(),
cfgAccounting: cfgAccounting{ cfgAccounting: cfgAccounting{
scriptHash: u160Accounting, scriptHash: u160Accounting,
fee: util.Fixed8(viperCfg.GetInt(cfgAccountingFee)), fee: util.Fixed8(viperCfg.GetInt(cfgAccountingFee)),