From f1578f245c1c269334cda00410c6b3b6f0e215b8 Mon Sep 17 00:00:00 2001 From: Alexey Akhunov Date: Wed, 8 Aug 2018 09:31:46 +0100 Subject: [PATCH] eth: Expose ethapi.GetAPIs to be used to construct RPC APIs without whole Ethereum node --- eth/backend.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/eth/backend.go b/eth/backend.go index 32946a0ab3..69834775ac 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -240,6 +240,15 @@ func CreateConsensusEngine(ctx *node.ServiceContext, config *ethash.Config, chai } } +// Exposes internal/ethapi/GetAPIs function so that it can be used +// by other application to construct RPC API service by simply +// implementing ethapi.Backend (which is subject with change in +// backwards incompatible way), rather than instantiating the +// entire Ethereum node +func GetAPIs(backend ethapi.Backend) []rpc.API { + return ethapi.GetAPIs(backend) +} + // APIs return the collection of RPC services the ethereum package offers. // NOTE, some of these services probably need to be moved to somewhere else. func (s *Ethereum) APIs() []rpc.API {