mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 13:07:17 +00:00
3a92b2b39d
* Start memory prof * Fix rpctest * Fix rpctest * Attempt to fix the leak * Remove http pprof
32 lines
731 B
Go
32 lines
731 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/ledgerwatch/turbo-geth/cmd/utils"
|
|
|
|
"github.com/ledgerwatch/turbo-geth/cmd/rpcdaemon/cli"
|
|
"github.com/ledgerwatch/turbo-geth/cmd/rpcdaemon/commands"
|
|
"github.com/ledgerwatch/turbo-geth/log"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func main() {
|
|
cmd, cfg := cli.RootCommand()
|
|
cmd.RunE = func(cmd *cobra.Command, args []string) error {
|
|
db, backend, err := cli.OpenDB(*cfg)
|
|
if err != nil {
|
|
log.Error("Could not connect to remoteDb", "error", err)
|
|
return nil
|
|
}
|
|
|
|
var apiList = commands.APIList(db, backend, *cfg, nil)
|
|
return cli.StartRpcServer(cmd.Context(), *cfg, apiList)
|
|
}
|
|
|
|
if err := cmd.ExecuteContext(utils.RootContext()); err != nil {
|
|
log.Error(err.Error())
|
|
os.Exit(1)
|
|
}
|
|
}
|