Code Monkey home page Code Monkey logo

ethereum-json-rpc-specification's Introduction

ethereum-json-rpc-specification

View the Documentation.

Overview

This repository is the home of the Ethereum OpenRPC document that describes the JSON-RPC interface to be implemented by client developers. It contains the tooling and scripts to automate producing artifacts for consuming the JSON-RPC API (docs, clients, etc).

Introduction

Both Ethereum client developers and downstream dapp developers lack a formal Ethereum RPC specification. This proposal attempts to standardize such a specification in a way that's versionable, human-readable and machine-readable. It will improve the accuracy of documentation, API, and clients.

Ethereum clients can expose RPC endpoints with differing method signatures; this forces applications to work around method inconsistencies to maintain compatibility with various Ethereum RPC implementations.

Much of Ethereums effectiveness as an enterprise-grade application platform depends on its ability to provide a reliable and predictable developer experience.

Specification

You can view the specification in documentation form here or the raw OpenRPC Document here.

Preview

eth_rpc_playground_docs_demo_eth_rpc

Clients

The clients are generated from the OpenRPC Document openrpc.json in this repository, and can be used as an alternative to web3.js or ethers.js but for various languages:

Javascript/Typescript

npm install @etclabscore/ethereum-json-rpc --save

Usage:

ethrpc_demo

Rust

Add this to your Cargo.toml:

[dependencies]
ethereum-json-rpc = "*"

Documentation

View the Documentation.

Contributing

Proposals to make method changes should be made as an issue.

How to contribute, build and release are outlined in CONTRIBUTING.md, BUILDING.md and RELEASING.md respectively. Commits in this repository follow the CONVENTIONAL_COMMITS.md specification.

Resources

ethereum-json-rpc-specification's People

Contributors

belfordz avatar dependabot-preview[bot] avatar dependabot[bot] avatar devonwesley avatar meowsbits avatar shanejonas avatar stevanlohja avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ethereum-json-rpc-specification's Issues

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Not verified

Something went wrong and the openrpc.json was not able to be verified.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

MixHash is missing from Block JSON Schema

Describe the bug
MixHash is missing from Block

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://playground.open-rpc.org/?schemaUrl=https://services.jade.builders/core-geth/mainnet/1.11.16
  2. Click oneth_getBlockByNumber
  3. Scroll down and click 'try it now'
  4. Enter this in the Inspector Request editor:
{
    "jsonrpc": "2.0",
    "method": "eth_getBlockByNumber",
    "params": [
        "0x9a5883",
        true
    ],
    "id": 0
}
  1. MixHash is returned, but is not defined in the openrpc document
  2. See screenshots

Screenshots
image

image

npm module is empty

Describe the bug
When using the generated npm module, the package is empty, with only a package.json

Steps

  1. npm install @etclabscore/ethereum-json-rpc which installs 1.2.3
  2. inspect node_modules directory
  3. see below:

Screenshot
image

Recent update to openrpc.json is broken

Sorry for not following the template, but it is so simple I don't think it is worth it.

Just input the openrpc.json file into a any validator, you 'll see there are a couple typos.

The offending commit: ffbe67b

add release to deploy new clients

Describe the solution you'd like
When releases of this repository are made, it should create corresponding release for

  • npm - typescript client
  • crate - rust client

Describe alternatives you've considered
We've talked about an external bot doing this, or possibly a registry, but we should start with this repo first and find the pain points.

Still needed
Still need to figure out the typing story, where does it get required from? another npm or crate with just the interfaces?

Use of "Address" to describe two distinct types

Describe the bug
The filter content descriptor has a field that is called "address" but it can be an address OR an array of address. This is in conflict with the components.schemas.address definition.

To Reproduce
Generate a client for this spec and view the exported type aliases.

Expected behavior
Address, when it can also be an array, should be named differently.

Perhaps "AddressOrArrayOfAddresses"

spec to describe 'bonus' methods

Is your feature request related to a problem? Please describe.
The existing spec describes a subset of actually-available methods for go-ethereum.

Describe the solution you'd like

  • rpc.discover_all describes all methods that are actually available for a given client instance.
  • rpc.describe
  • ...

Up for grabs: thoughts on a best name for this? Maybe an optional param for rpc.discover?

Describe alternatives you've considered
Client-specific methods like geth.discover. Downside is that they're not (necessarily) spec'd.

Additional context

// @multi-geth v1.9.0 console
> Object.keys(rpc.discover().methods).length
45
> Object.keys(eth).length
48

add error codes

Describe the solution you'd like
A clear and concise description of a methods errors as described in the OpenRPC.

rust error on release

   'npm notice \nnpm notice πŸ“¦  @etclabscore/[email protected]\nnpm notice === Tarball Contents === \nnpm notice 553B package.json\nnpm notice === Tarball Details === \nnpm notice name:          @etclabscore/ethereum-json-rpc          \nnpm notice version:       1.3.1                                   \nnpm notice package size:  402 B                                   \nnpm notice unpacked size: 553 B                                   \nnpm notice shasum:        cad44f067a24f779e014d64e7a09ea10589fe6c8\nnpm notice integrity:     sha512-mN+Mfds52kz0W[...]8K7byyiha9eWA==\nnpm notice total files:   1                                       \nnpm notice \n    Updating crates.io index\nwarning: manifest has no documentation, homepage or repository.\nSee https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.\n   Packaging ethereum-json-rpc v1.3.1 (/home/circleci/project/build/rust)\n   Verifying ethereum-json-rpc v1.3.1 (/home/circleci/project/build/rust)\n    Updating crates.io index\n Downloading crates ...\n  Downloaded serde_json v1.0.44\n  Downloaded serde v1.0.104\n  Downloaded itoa v0.4.4\n  Downloaded ryu v1.0.2\n  Downloaded serde_derive v1.0.104\n  Downloaded proc-macro2 v1.0.6\n  Downloaded syn v1.0.11\n  Downloaded unicode-xid v0.2.0\n  Downloaded quote v1.0.2\n  Downloaded jsonrpc-client-core v0.5.0\n  Downloaded error-chain v0.12.1\n  Downloaded log v0.4.8\n  Downloaded backtrace v0.3.40\n  Downloaded version_check v0.1.5\n  Downloaded cfg-if v0.1.10\n  Downloaded jsonrpc-core v8.0.1\n  Downloaded futures v0.1.29\n  Downloaded backtrace-sys v0.1.32\n  Downloaded log v0.3.9\n  Downloaded libc v0.2.66\n  Downloaded rustc-demangle v0.1.16\n  Downloaded cc v1.0.48\n   Compiling proc-macro2 v1.0.6\n   Compiling unicode-xid v0.2.0\n   Compiling syn v1.0.11\n   Compiling cc v1.0.48\n   Compiling libc v0.2.66\n   Compiling serde v1.0.104\n   Compiling log v0.4.8\n   Compiling ryu v1.0.2\n   Compiling version_check v0.1.5\n   Compiling cfg-if v0.1.10\n   Compiling itoa v0.4.4\n   Compiling rustc-demangle v0.1.16\n   Compiling futures v0.1.29\n   Compiling error-chain v0.12.1\n   Compiling log v0.3.9\n   Compiling backtrace-sys v0.1.32\n   Compiling quote v1.0.2\n   Compiling backtrace v0.3.40\n   Compiling serde_derive v1.0.104\n   Compiling serde_json v1.0.44\n   Compiling jsonrpc-core v8.0.1\n   Compiling jsonrpc-client-core v0.5.0\n   Compiling ethereum-json-rpc v1.3.1 (/home/circleci/project/build/rust/target/package/ethereum-json-rpc-1.3.1)\nerror: expected literal\n   --> src/lib.rs:118:22\n    |\n118 |     #[serde(rename = earliest)]\n    |                      ^^^^^^^^\n\nerror: expected literal\n   --> src/lib.rs:120:22\n    |\n120 |     #[serde(rename = latest)]\n    |                      ^^^^^^\n\nerror: expected literal\n   --> src/lib.rs:122:22\n    |\n122 |     #[serde(rename = pending)]\n    |                      ^^^^^^^\n\nerror[E0412]: cannot find type `HashMap` in this scope\n   --> src/lib.rs:334:18\n    |\n334 | pub type Uncle = HashMap<String, Option<serde_json::Value>>;\n    |                  ^^^^^^^ not found in this scope\nhelp: possible candidates are found in other modules, you can import them into scope\n    |\n4   | use std::collections::HashMap;\n    |\n4   | use std::collections::hash_map::HashMap;\n    |\n\nerror[E0412]: cannot find type `HashMap` in this scope\n   --> src/lib.rs:349:18\n    |\n349 | pub type Block = HashMap<String, Option<serde_json::Value>>;\n    |                  ^^^^^^^ not found in this scope\nhelp: possible candidates are found in other modules, you can import them into scope\n    |\n4   | use std::collections::HashMap;\n    |\n4   | use std::collections::hash_map::HashMap;\n    |\n\nerror: aborting due to 5 previous errors\n\nFor more information about this error, try `rustc --explain E0412`.\nerror: failed to verify package tarball\n\nCaused by:\n  Could not compile `ethereum-json-rpc`.\n\nTo learn more, run the command again with --verbose.\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 101\nnpm ERR! @etclabscore/[email protected] publish:rust: `cd build/rust && cargo package && cargo publish --token $CARGO_TOKEN`\nnpm ERR! Exit status 101\nnpm ERR! \nnpm ERR! Failed at the @etclabscore/[email protected] publish:rust script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     /home/circleci/.npm/_logs/2019-12-30T21_51_49_020Z-debug.log\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 101\nnpm ERR! @etclabscore/[email protected] publish: `npm run publish:typescript && npm run publish:rust`\nnpm ERR! Exit status 101\nnpm ERR! \nnpm ERR! Failed at the @etclabscore/[email protected] publish script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     /home/circleci/.npm/_logs/2019-12-30T21_51_49_028Z-debug.log',

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.