Skip to content

Enable simulated back-end to be used via JSON RPC #21457

Closed
@Pet3ris

Description

@Pet3ris

Hi there,

This is to continue the discussion in the following thread: #20212. The original thread proposed moving ethapi out of internal but was closed as the problem was solved a different way.

There's another good reason to consider moving ethapi out of internal:


I'm trying to use go-ethereum's RPC API over a simulated back-end object as a library. I'm using a simulated back-end for smart contracts from another programming language and would like to have some fallback access to the simulated back-end state through the RPC API rather than having to implement each end-point one by one.

In order to set up the RPC API I'm using NewServer() and using a bi-directional pipe as the codec. The place where this approach fails is that APIs() are only available to full or light ethereum clients, but not the simulated back-end. The simulated back-end exposes GetAPIs() but this function is only available as part of internal/ethapi.

As a result I'm trying to effectively copy & paste the whole internal/api folder in my codebase but running into another related issue that I've filed.

Would love to also hear your guidance on how to achieve this and hope this helps support the overall thinking around the ethapi!


To summarize - from my perspective there should be a way to use APIs or GetAPIs with the simulated back-end, I wouldn't actually need the whole ethapi package to be exposed.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions