les: provide consensus engine RPC APIs

This commit is contained in:
Felix Lange 2019-11-18 17:54:43 +01:00
parent c5c5e0dbe8
commit d7bd8b4cf1
2 changed files with 8 additions and 1 deletions

View file

@ -176,7 +176,9 @@ func (s *LightDummyAPI) Mining() bool {
// APIs returns the collection of RPC services the ethereum package offers.
// NOTE, some of these services probably need to be moved to somewhere else.
func (s *LightEthereum) APIs() []rpc.API {
return append(ethapi.GetAPIs(s.ApiBackend), []rpc.API{
apis := ethapi.GetAPIs(s.ApiBackend)
apis = append(apis, s.engine.APIs(s.BlockChain().HeaderChain())...)
return append(apis, []rpc.API{
{
Namespace: "eth",
Version: "1.0",

View file

@ -143,6 +143,11 @@ func (lc *LightChain) Odr() OdrBackend {
return lc.odr
}
// HeaderChain returns the underlying header chain.
func (lc *LightChain) HeaderChain() *core.HeaderChain {
return lc.hc
}
// loadLastState loads the last known chain state from the database. This method
// assumes that the chain manager mutex is held.
func (lc *LightChain) loadLastState() error {