erigon-pulse/cmd/rpcdaemon/service/service.go

28 lines
771 B
Go
Raw Normal View History

package service
import (
"github.com/ledgerwatch/turbo-geth/cmd/rpcdaemon/commands"
"github.com/ledgerwatch/turbo-geth/core"
"github.com/ledgerwatch/turbo-geth/eth"
"github.com/ledgerwatch/turbo-geth/ethdb"
"github.com/ledgerwatch/turbo-geth/node"
"github.com/ledgerwatch/turbo-geth/rpc"
)
// RPCDaemonService is used in js console and console tests
type RPCDaemonService struct {
api []rpc.API
db *ethdb.ObjectDatabase
ethBackend *eth.Ethereum
}
func New(db *ethdb.ObjectDatabase, ethBackend *eth.Ethereum, stack *node.Node) *RPCDaemonService {
service := &RPCDaemonService{[]rpc.API{}, db, ethBackend}
apis := commands.GetAPI(db.KV(), core.NewEthBackend(ethBackend), []string{"eth", "debug"})
2020-08-15 17:32:05 +00:00
stack.RegisterAPIs(apis)
2020-08-15 17:32:05 +00:00
return service
}