mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-05 18:42:19 +00:00
d05cfa22f6
* make plain state + staged sync the default * remove sync mode flag completely * one thing * fix the console * simplify code * fix and skip tests * fixup for console tests
39 lines
874 B
Go
39 lines
874 B
Go
package service
|
|
|
|
import (
|
|
"github.com/ledgerwatch/turbo-geth/cmd/rpcdaemon/commands"
|
|
"github.com/ledgerwatch/turbo-geth/ethdb"
|
|
"github.com/ledgerwatch/turbo-geth/node"
|
|
"github.com/ledgerwatch/turbo-geth/p2p"
|
|
"github.com/ledgerwatch/turbo-geth/rpc"
|
|
)
|
|
|
|
var _ node.Service = &RPCDaemonService{}
|
|
|
|
// RPCDaemonService is used in js console and console tests
|
|
type RPCDaemonService struct {
|
|
api []rpc.API
|
|
db *ethdb.ObjectDatabase
|
|
}
|
|
|
|
func (*RPCDaemonService) Protocols() []p2p.Protocol {
|
|
return []p2p.Protocol{}
|
|
}
|
|
|
|
func (r *RPCDaemonService) Start(server *p2p.Server) error {
|
|
r.api = commands.GetAPI(r.db.KV(), []string{"eth", "debug"})
|
|
return nil
|
|
}
|
|
|
|
func (r *RPCDaemonService) Stop() error {
|
|
return nil
|
|
}
|
|
|
|
func (r *RPCDaemonService) APIs() []rpc.API {
|
|
return r.api
|
|
}
|
|
|
|
func New(db *ethdb.ObjectDatabase) *RPCDaemonService {
|
|
return &RPCDaemonService{[]rpc.API{}, db}
|
|
}
|