forked from TrueCloudLab/frostfs-node
Airat Arifullin
b543569c3f
* Register GRPC services for both neo.fs.v2 and frost.fs namespaces * Use this temporary solution until all nodes are updated Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
33 lines
1.3 KiB
Go
33 lines
1.3 KiB
Go
package main
|
|
|
|
import (
|
|
"net"
|
|
|
|
ape_contract "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/ape/contract_storage"
|
|
morph "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client"
|
|
apemanager_transport "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/network/transport/apemanager/grpc"
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/apemanager"
|
|
apemanager_grpc "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/apemanager/grpc"
|
|
"google.golang.org/grpc"
|
|
)
|
|
|
|
func initAPEManagerService(c *cfg) {
|
|
contractStorage := ape_contract.NewProxyVerificationContractStorage(
|
|
morph.NewSwitchRPCGuardedActor(c.cfgMorph.client),
|
|
c.shared.key,
|
|
c.cfgMorph.proxyScriptHash,
|
|
c.cfgObject.cfgAccessPolicyEngine.policyContractHash)
|
|
|
|
execsvc := apemanager.New(c.cfgObject.cnrSource, contractStorage,
|
|
apemanager.WithLogger(c.log))
|
|
sigsvc := apemanager.NewSignService(&c.key.PrivateKey, execsvc)
|
|
auditSvc := apemanager.NewAuditService(sigsvc, c.log, c.audit)
|
|
server := apemanager_transport.New(auditSvc)
|
|
|
|
c.cfgGRPC.performAndSave(func(_ string, _ net.Listener, s *grpc.Server) {
|
|
apemanager_grpc.RegisterAPEManagerServiceServer(s, server)
|
|
|
|
// TODO(@aarifullin): #1487 remove the dual service support.
|
|
s.RegisterService(frostFSServiceDesc(apemanager_grpc.APEManagerService_ServiceDesc), server)
|
|
})
|
|
}
|