From ae652ad5c90322148d61b6517e0e2fc93deedff9 Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Sun, 13 Feb 2022 13:48:51 +0700 Subject: [PATCH] remove emed of rpcdaemon (not ready) --- eth/backend.go | 51 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/eth/backend.go b/eth/backend.go index a7d894ee3..b987832c9 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -48,14 +48,11 @@ import ( "github.com/ledgerwatch/erigon-lib/txpool/txpooluitl" "github.com/ledgerwatch/erigon/cmd/downloader/downloader" "github.com/ledgerwatch/erigon/cmd/downloader/downloadergrpc" - "github.com/ledgerwatch/erigon/cmd/rpcdaemon/cli" - "github.com/ledgerwatch/erigon/cmd/rpcdaemon/commands" "github.com/ledgerwatch/erigon/cmd/rpcdaemon/interfaces" "github.com/ledgerwatch/erigon/cmd/sentry/sentry" "github.com/ledgerwatch/erigon/common" "github.com/ledgerwatch/erigon/common/debug" "github.com/ledgerwatch/erigon/consensus" - "github.com/ledgerwatch/erigon/consensus/bor" "github.com/ledgerwatch/erigon/consensus/clique" "github.com/ledgerwatch/erigon/consensus/ethash" "github.com/ledgerwatch/erigon/consensus/parlia" @@ -527,30 +524,32 @@ func New(stack *node.Node, config *ethconfig.Config, txpoolCfg txpool2.Config, l } //eth.APIBackend.gpo = gasprice.NewOracle(eth.APIBackend, gpoParams) - // start HTTP API - httpRpcCfg := cli.Flags{} // TODO: add rpcdaemon cli flags to Erigon and fill this struct (or break it to smaller config objects) - ethRpcClient, txPoolRpcClient, miningRpcClient, starkNetRpcClient, stateCache, ff, err := cli.EmbeddedServices( - ctx, chainKv, httpRpcCfg.StateCache, blockReader, - ethBackendRPC, - backend.txPool2GrpcServer, - miningRPC, - ) - if err != nil { - return nil, err - } + /* + // start HTTP API + httpRpcCfg := cli.Flags{} // TODO: add rpcdaemon cli flags to Erigon and fill this struct (or break it to smaller config objects) + ethRpcClient, txPoolRpcClient, miningRpcClient, starkNetRpcClient, stateCache, ff, err := cli.EmbeddedServices( + ctx, chainKv, httpRpcCfg.StateCache, blockReader, + ethBackendRPC, + backend.txPool2GrpcServer, + miningRPC, + ) + if err != nil { + return nil, err + } - var borDb kv.RoDB - if casted, ok := backend.engine.(*bor.Bor); ok { - borDb = casted.DB - } - apiList := commands.APIList(chainKv, borDb, ethRpcClient, txPoolRpcClient, miningRpcClient, starkNetRpcClient, ff, stateCache, blockReader, httpRpcCfg, nil) - go func() { - _ = apiList - //if err := cli.StartRpcServer(ctx, httpRpcCfg, apiList); err != nil { - // log.Error(err.Error()) - // return - //} - }() + var borDb kv.RoDB + if casted, ok := backend.engine.(*bor.Bor); ok { + borDb = casted.DB + } + apiList := commands.APIList(chainKv, borDb, ethRpcClient, txPoolRpcClient, miningRpcClient, starkNetRpcClient, ff, stateCache, blockReader, httpRpcCfg, nil) + go func() { + _ = apiList + //if err := cli.StartRpcServer(ctx, httpRpcCfg, apiList); err != nil { + // log.Error(err.Error()) + // return + //} + }() + */ // Register the backend on the node stack.RegisterAPIs(backend.APIs())