forked from TrueCloudLab/frostfs-node
319fd212dc
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
26 lines
597 B
Go
26 lines
597 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/services/tree"
|
|
)
|
|
|
|
func initTreeService(c *cfg) {
|
|
treeSvc := tree.New(
|
|
tree.WithContainerSource(c.cfgObject.cnrSource),
|
|
tree.WithNetmapSource(c.netMapSource),
|
|
tree.WithPrivateKey(&c.key.PrivateKey),
|
|
tree.WithLogger(c.log),
|
|
tree.WithStorage(c.cfgObject.cfgLocalStorage.localStorage))
|
|
|
|
for _, srv := range c.cfgGRPC.servers {
|
|
tree.RegisterTreeServiceServer(srv, treeSvc)
|
|
}
|
|
|
|
c.workers = append(c.workers, newWorkerFromFunc(func(ctx context.Context) {
|
|
treeSvc.Start(ctx)
|
|
}))
|
|
|
|
c.onShutdown(treeSvc.Shutdown)
|
|
}
|