Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Feat/openrpc describe #66

Closed
wants to merge 117 commits into from
Closed

WIP: Feat/openrpc describe #66

wants to merge 117 commits into from

Conversation

meowsbits
Copy link
Member

@meowsbits meowsbits commented Mar 12, 2020

Rel #63

This is a spike to explore runtime generation of an OpenRPC rpc_discover document that completely describes geth's available RPC services. Working initially to pattern this closely against geth, and then abstract to a pluggable package that can be integrated with go-ethereum/rpc, and maybe also expose other OpenRPC library services.

Provided temporarily (for development only) in this PR are a script and logs, as well as a copy of the openrpc.json document itself. These together are intended to make changes to the openrpc.json document transparent and to give context for their implementation. The jj the script requires is https://github.com/tidwall/jj.

Included as submodules and forked for development are cornerstone libraries github.com/alecthomas/jsonschema and github.com/gregdhill/go-openrpc.

An example of what adding a method looks like: 7cbfe11

Yields

📄 rpc.discover document: https://gist.github.com/meowsbits/4da4c08765679dac1899543002d1f545. Note that geth uses a temporary rpc_describe method in lieu of the eventual rpc_discover name. This is in order to avoid the collision with the exising method, which returns the static ethereum-json-rpc-specification document.

👁️ Check it out on the OpenRPC Playground: https://playground.open-rpc.org/?url=https://gist.githubusercontent.com/meowsbits/4da4c08765679dac1899543002d1f545/raw/spec.json

Develop

> ./.develop/test.sh

https://github.com/etclabscore/core-geth/blob/feat/openrpc-describe/.develop/test.sh

Signed-off-by: meows <b5c6@protonmail.com>
Signed-off-by: meows <b5c6@protonmail.com>
It's annoying to managing passing the contents of a file
as an item in an array from the command line.
And the document has strange escape and special characters.
So this make that a little less hackrequire.

Signed-off-by: meows <b5c6@protonmail.com>
…t in root

Signed-off-by: meows <b5c6@protonmail.com>
This is just a quick little developer tool.
It'll produce some logs which we can include in the
development branch as well. I hope this'll help with
transparency of workflow and easier review.

Signed-off-by: meows <b5c6@protonmail.com>
Signed-off-by: meows <b5c6@protonmail.com>
This should make it a lot easier to actually read.

Signed-off-by: meows <b5c6@protonmail.com>
…cheme

Signed-off-by: meows <b5c6@protonmail.com>
It was in the Under list, ergo not available from the
actual server. Was listed as deprecated. Has met its fate.

Signed-off-by: meows <b5c6@protonmail.com>
Signed-off-by: meows <b5c6@protonmail.com>
Signed-off-by: meows <b5c6@protonmail.com>
Signed-off-by: meows <b5c6@protonmail.com>
Signed-off-by: meows <b5c6@protonmail.com>
Signed-off-by: meows <b5c6@protonmail.com>
Signed-off-by: meows <b5c6@protonmail.com>
Signed-off-by: meows <b5c6@protonmail.com>
Signed-off-by: meows <b5c6@protonmail.com>
Signed-off-by: meows <b5c6@protonmail.com>
Signed-off-by: meows <b5c6@protonmail.com>
Signed-off-by: meows <b5c6@protonmail.com>
Signed-off-by: meows <b5c6@protonmail.com>
…rpc foundation/master

There was a refactoring of node/rpc handler.
This updates to that, and isolates openrpc logic
to openrpc, where it's waiting to be implemented

Signed-off-by: meows <b5c6@protonmail.com>
Now using as a fork

Signed-off-by: meows <b5c6@protonmail.com>
Signed-off-by: meows <b5c6@protonmail.com>
Signed-off-by: meows <b5c6@protonmail.com>
Signed-off-by: meows <b5c6@protonmail.com>
Signed-off-by: meows <b5c6@protonmail.com>
Signed-off-by: meows <b5c6@protonmail.com>
Signed-off-by: meows <b5c6@protonmail.com>
Signed-off-by: meows <b5c6@protonmail.com>
Signed-off-by: meows <b5c6@protonmail.com>
Signed-off-by: meows <b5c6@protonmail.com>
Conflicts:
	cmd/geth/retesteth.go
	go.mod
	go.sum
	rpc/http.go
…g contentdescriptor naming

Signed-off-by: meows <b5c6@protonmail.com>
…ypes

Signed-off-by: meows <b5c6@protonmail.com>
…v0.0.19

Signed-off-by: meows <b5c6@protonmail.com>
… under rpc module namespace

It was under 'openrpc' for development to avoid
side effects of collision with the existing methods under
that module.

Signed-off-by: meows <b5c6@protonmail.com>
…of rpc/)

The openrpc service shouldn't be installed in the
rpc library itself, since the library should only provide
the actual rpc service. Service registration, as it were,
should be handled by the layer using the rpc service,
in this case node/.
L

Signed-off-by: meows <b5c6@protonmail.com>
This allows discrete ipc/http/ws module sets, each
with their own rpc.discover document based on what
is actually being handled.

Signed-off-by: meows <b5c6@protonmail.com>
…jsonschema typemapper

Signed-off-by: meows <b5c6@protonmail.com>
Signed-off-by: meows <b5c6@protonmail.com>
Signed-off-by: meows <b5c6@protonmail.com>
This was overwritten when I checked out the
node and rpc packages from foundation/master.

Signed-off-by: meows <b5c6@protonmail.com>
…oot go.mod

Signed-off-by: meows <b5c6@protonmail.com>
@meowsbits meowsbits mentioned this pull request Apr 10, 2020
2 tasks
@meowsbits
Copy link
Member Author

Closing in favor of #90

@meowsbits meowsbits closed this Apr 15, 2020
@meowsbits meowsbits deleted the feat/openrpc-describe branch December 29, 2020 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants