forked from TrueCloudLab/frostfs-node
Move to frostfs-node
Signed-off-by: Pavel Karpy <p.karpy@yadro.com>
This commit is contained in:
parent
42554a9298
commit
923f84722a
934 changed files with 3470 additions and 3451 deletions
34
cmd/frostfs-node/accounting.go
Normal file
34
cmd/frostfs-node/accounting.go
Normal file
|
@ -0,0 +1,34 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
accountingGRPC "github.com/TrueCloudLab/frostfs-api-go/v2/accounting/grpc"
|
||||
"github.com/TrueCloudLab/frostfs-node/pkg/morph/client/balance"
|
||||
accountingTransportGRPC "github.com/TrueCloudLab/frostfs-node/pkg/network/transport/accounting/grpc"
|
||||
accountingService "github.com/TrueCloudLab/frostfs-node/pkg/services/accounting"
|
||||
accounting "github.com/TrueCloudLab/frostfs-node/pkg/services/accounting/morph"
|
||||
)
|
||||
|
||||
func initAccountingService(c *cfg) {
|
||||
if c.cfgMorph.client == nil {
|
||||
initMorphComponents(c)
|
||||
}
|
||||
|
||||
balanceMorphWrapper, err := balance.NewFromMorph(c.cfgMorph.client, c.cfgAccounting.scriptHash, 0)
|
||||
fatalOnErr(err)
|
||||
|
||||
server := accountingTransportGRPC.New(
|
||||
accountingService.NewSignService(
|
||||
&c.key.PrivateKey,
|
||||
accountingService.NewResponseService(
|
||||
accountingService.NewExecutionService(
|
||||
accounting.NewExecutor(balanceMorphWrapper),
|
||||
),
|
||||
c.respSvc,
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
for _, srv := range c.cfgGRPC.servers {
|
||||
accountingGRPC.RegisterAccountingServiceServer(srv, server)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue