2020-08-22 15:20:47 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
2020-08-31 15:20:02 +00:00
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap"
|
2020-09-08 13:14:22 +00:00
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap/wrapper"
|
2020-08-22 15:20:47 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func initMorphComponents(c *cfg) {
|
|
|
|
var err error
|
|
|
|
|
2020-09-16 07:45:08 +00:00
|
|
|
c.cfgMorph.client, err = client.New(c.key, c.viper.GetString(cfgMorphRPCAddress))
|
2020-08-22 15:20:47 +00:00
|
|
|
fatalOnErr(err)
|
2020-09-24 07:46:47 +00:00
|
|
|
|
|
|
|
staticClient, err := client.NewStatic(
|
|
|
|
c.cfgMorph.client,
|
|
|
|
c.cfgNetmap.scriptHash,
|
|
|
|
c.cfgContainer.fee,
|
|
|
|
)
|
|
|
|
fatalOnErr(err)
|
|
|
|
|
|
|
|
cli, err := netmap.New(staticClient)
|
|
|
|
fatalOnErr(err)
|
|
|
|
|
|
|
|
wrap, err := wrapper.New(cli)
|
|
|
|
fatalOnErr(err)
|
|
|
|
|
|
|
|
c.cfgObject.netMapStorage = wrap
|
|
|
|
c.cfgNetmap.wrapper = wrap
|
2020-08-22 15:20:47 +00:00
|
|
|
}
|