-
Notifications
You must be signed in to change notification settings - Fork 5.9k
EIP-1901: Add OpenRPC Service Discovery To JSON-RPC Services #1901
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
4d41141
EIP-????: Add OpenRPC Service Discovery To JSON-RPC Services
shanejonas 7045a36
fix:
shanejonas af0e192
fix(openrpc): add openrpc.json to eip assets
shanejonas 5691d05
fix(openrpc): reference eip asset
shanejonas d2733c3
Update EIPS/eip-1901.md - document link
shanejonas bd24472
Delete openrpc.json
shanejonas 3ee227e
Update eip-1901: move link to spec to top
shanejonas 9cb897d
fix(1901): preamble + author github usernames
shanejonas bad7a7b
fix(1901): add copyright info
shanejonas 3721b69
fix(1901): add link to eth json rpc spec
shanejonas 48f0fdb
fix(1901): type and category in preamble + spelling
shanejonas cb4c2dd
fix(1901): motivation section and use vendored assets
shanejonas d71d1ae
fix(1901): add link to multi-geth OpenRPC discovery
shanejonas bfad558
fix(1901): change ordering + small fixes
shanejonas eada58c
fix(1901): typo
shanejonas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(1901): change ordering + small fixes
- Loading branch information
commit bfad558dba940d85c6cd640266f6c6a90129a739
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,34 +19,35 @@ The OpenRPC Document and generated Documentation that specifies all the methods | |
| This was first proposed [here as an ECIP](https://github.com/etclabscore/ECIPs/blob/master/ECIPs/ECIP-1053.md), but the benefits of this kind of tooling is apparent across Bitcoin, Ethereum Classic, Ethereum and other JSON-RPC accessible blockchains. | ||
|
|
||
| ## Motivation | ||
| EVM-based blockchains lack a form RPC Specification. This proposal attempts to standardize such a specification in a way that is versionable, and both human and machine readable. | ||
|
|
||
| Although [EIP-1474](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1474.md) outlines a JSON-RPC specification. Ethereum still lacks a machine-readable JSON-RPC Specification that can be used as the industry standard for tooling. This proposal attempts to standardize such a specification in a way that is versionable, and both human and machine readable. | ||
|
|
||
| Ethereum clients can expose RPC endpoints with different method signatures and cause compatability issues between clients. | ||
|
|
||
| Developers need a reliable developer experience, and an industry standard way to describe Ethereum JSON-RPC 2.0 APIs. | ||
|
|
||
|
|
||
| ## Implementation | ||
| ### How do I Solve the problem? | ||
| JSON-RPC APIs can support the OpenRPC specification by implementing a service discovery method that will return the [OpenRPC document](https://github.com/open-rpc/spec#openrpc-document) for the JSON-RPC API. The method MUST be named `rpc.discover`. The `rpc.` prefix is a reserved method prefix for [JSON-RPC 2.0 Specification](https://www.jsonrpc.org/specification) system extensions. | ||
|
|
||
| ### Use Case | ||
| This is the vision for the use case of OpenRPC and how it would relate to multi-geth: | ||
|
|
||
|  | ||
|
|
||
| ## Specification | ||
|
|
||
| ### What is OpenRPC? | ||
|
|
||
| The [OpenRPC](https://github.com/open-rpc/spec) Specification defines a standard, programming language-agnostic interface description for [JSON-RPC 2.0](https://www.jsonrpc.org/specification) APIs, which allows both humans and computers to discover and understand the capabilities of a service without requiring access to source code, additional documentation, or inspection of network traffic. When properly defined via OpenRPC, a consumer can understand and interact with the remote service with a minimal amount of implementation logic, and share these logic patterns across use cases. Similar to what interface descriptions have done for lower-level programming, the OpenRPC Specification removes guesswork in calling a service. | ||
|
|
||
| ##### Structure | ||
|
|
||
| This is the structure of an OpenRPC Document: | ||
|
|
||
|  | ||
|  | ||
|
|
||
| JSON-RPC APIs can support the OpenRPC specification by implementing a service discovery method that will return the [OpenRPC document](https://github.com/open-rpc/spec#openrpc-document) for the JSON-RPC API. The method MUST be named `rpc.discover`. The `rpc.` prefix is a reserved method prefix for [JSON-RPC 2.0 Specification](https://www.jsonrpc.org/specification) system extensions. | ||
|
|
||
| ### Use Case | ||
|
|
||
| This is the vision for the use case of OpenRPC and how it would relate to a client implementation like multi-geth: | ||
|
|
||
|  | ||
|
|
||
| ## Rationale | ||
|
|
||
| ### Why would we do this? | ||
| Services need to figure out how to talk to each other. If we really want to build the next generation of automation, then having up to date libraries, documented APIs, and modern tools are going to provide easy discovery, on-boarding, and enable end user and developer interaction. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems to be part of the motivation. Rationale should explain how and what kind of decisions were made influencing the specification. |
||
|
|
||
|
|
@@ -59,16 +60,20 @@ Use cases for machine-readable [JSON-RPC 2.0](https://www.jsonrpc.org/specificat | |
| - Tests generated in many languages | ||
| - Documentation Generation | ||
|
|
||
| ### Alternative | ||
|
|
||
| ## Alternative | ||
| [OpenRPC](https://github.com/open-rpc/spec) documents just describe [JSON-RPC](https://www.jsonrpc.org/specification) APIs services, and are represented in JSON format. These documents may be produced and served statically OR generated dynamically from an application and returned via the [`rpc.discover`](https://github.com/open-rpc/spec#service-discovery-method) method. This gives projects and communities the flexibility to adopt tools before the [`rpc.discover`](https://github.com/open-rpc/spec#service-discovery-method) method is implemented. | ||
| [OpenRPC](https://github.com/open-rpc/spec) documents just describe [JSON-RPC](https://www.jsonrpc.org/specification) APIs services, and are represented in JSON format. These documents may be produced and served statically OR generated dynamically from an application and returned via the [`rpc.discover`](https://github.com/open-rpc/spec#service-discovery-method) method. This gives projects and communities the opportunity to adopt tools, documentation, and clients outlined in the [etclabscore/ethereum-json-rpc-specification](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1474.md) before the [`rpc.discover`](https://github.com/open-rpc/spec#service-discovery-method) method is implemented for a particular client. | ||
|
|
||
| ## Implementation | ||
|
|
||
| - [Multi-Geth OpenRPC Discovery](https://github.com/multi-geth/multi-geth#openrpc-discovery) | ||
|
|
||
| ## Resources | ||
|
|
||
| - [Multi-Geth OpenRPC Discovery](https://github.com/multi-geth/multi-geth#openrpc-discovery) | ||
| - [EDCON 2019 talk on OpenRPC and The Future of JSON-RPC Tooling](https://www.youtube.com/watch?v=UgSPMZ9FQ4Q) | ||
| - [open-rpc.org](https://open-rpc.org) | ||
| - [etclabscore/ethereum-json-rpc-specification](https://github.com/etclabscore/ethereum-json-rpc-specification) | ||
| - [open-rpc.org](https://open-rpc.org) | ||
|
|
||
| ## Copyright | ||
|
|
||
|
|
||
File renamed without changes
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.