forked from TrueCloudLab/frostfs-node
30 lines
1.1 KiB
Go
30 lines
1.1 KiB
Go
package main
|
|
|
|
import (
|
|
"net"
|
|
|
|
apemanager_grpc "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager/grpc"
|
|
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"
|
|
"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)
|
|
})
|
|
}
|