hashgraph / hedera-json-rpc-relay Goto Github PK
View Code? Open in Web Editor NEWImplementation of Ethereum JSON-RPC APIs for Hedera
License: Apache License 2.0
Implementation of Ethereum JSON-RPC APIs for Hedera
License: Apache License 2.0
Epic for block related queries
Implement eth_getCode (using ContractGetBytecodeQuery query)
As part of Open Source readiness all code files require a license header a below
/*-
*
* Hedera JSON RPC Relay
*
* Copyright (C) 2021 - 2022 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
Call MAPi
/api/v1/contracts/results?block.number={hash}&transaction.index={number}then
/api/v1/contracts/{id}/results/{timestamp}``
The current UT coverage is currently under 50%.
Increase this above 90%
Utilize MAPI /api/v1/blocks/{hashOrNumber}
and retrieve result.number
As part of Open Source readiness the repo should have code coverage metrics to help maintain and improve quality
Update the eth_getCode
flow to call /api/v1/contracts/{id}
first.
If runtime_bytecode
is undefined then call services as back up
depends on hashgraph/hedera-mirror-node#3580 which was completed in 0.62.x
.
Also requires 0.29 image of services network for acceptance tests to pass
Start to push containerized app structure to docker registry for easy reference by users
https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry
Note: This may require repo going public first
Update the pipeline such that we can run e2e tests
Implement eth_getStorageAt
.
As noted in HIP 482
/api/v1/blocks/{blockNumber}
mirror node REST API as it maps a block number to a consensus timestamp. If the block number is latest or pending, then this API call can be omitted./api/v1/contracts/{id}/results?timestamp=lte:{block.endTimestamp}&limit=1&order=desc
to get results./api/v1/contracts/{id}/results/{timestamp}
to get the contract state information.Obtain the version of the library runtime.
As part of Open Source readiness the repo requires a License file.
In accordance with project direction this will be Apache License 2.0
Economics should be cleared out
Depends on services implementation
Utilize MAPI /api/v1/blocks/{hashOrNumber}
and retrieve result.number
As per initial discussion - try and have it as env variable so that the user can set it
Return it hardcoded.
As per initial discussion return [] - hardcoded return empty array
Implement eth_getLogs (limited topics passed)
Currently the relay relies on local npm runs.
We should support varied deployment stories. A requirement for this is containerization.
As part of Open Source readiness some sections need to be added to the README
Add monitor support for container to ensure it's within the desired health parameters
Utilize
We need an env variable for private key and account for local contract call - and have it be dedicated for this, ex: eth_call - one account, eth_getCode - separate account, etc..
The current UT coverage is currently under 60%.
Increase this above 90%
We want to verify if the implementation of eth_getTransactionReceipt is working properly according to the following HIPs https://hips.hedera.com/hip/hip-410 & https://www.notion.so/hedera/JSON-RPC-Bridge-HIP-b473a9c3bee4474ca90dd36a30902eb2
Add unit tests / refer to https://www.notion.so/hedera/3d413ee39199413cbe7be274956a36df?v=312323a97f9e44ae8f694a369b6bb577
Should call mirror node (we have a similar implementation in hethers)
In addition to other Open Source readiness items we'll want to add deployment steps to the README
The relay demo has a few setup steps that are necessary to see a run that highlights the true value of the relay.
Since this can be involving we should document in a separate markdown file for easy reference and reproduction to allow eth devs to hit the ground running
The HBAR transfer flow is the primary scenario
Scenario 1: Transfer HBAR between 2 users
Add documentation highlighting the flow.
New markdown should be placed under /docs
and README should reference it
Documentation may include
Steps
Code snippets
Screen shots - if applicable
No response
Call MAPi /api/v1/contracts/results?block.hash={hash}&transaction.index={number}
then /api/v1/contracts/{id}/results/{timestamp}
Implement using Exchange Rate file and Fee Schedule and provide the current fee in gwei, replicated for the number of blocks requested.
Deploy current main version of relay to integration environment.
For now this may utilize the docker image or docker-compose flow.
Eventually this should be replaced by automatic deployment upon successful PR merges
Utilize Prometheus chart to pull log metrics from relay
See Mirror Node REST API Prometheus Rules and Mirror Node REST API Prometheus Values Config for inspiration
Note: for future horizontal scaling Prometheus adapter can be utilized
Provide static response { code: -32000. message: 'No mining work available yet' }
Chart should utilize deployed docker image and support simple k8s deployment for varied environments
Can draw inspiration from Mirror Node charts
hedera-mirror-web3
should be exactly what we need to start off with.
hedera-mirror-rest
may show more mature logic and tie closely since it's also a node app
Check if we have permissions to add codecov
Add code coverage checks to the CI/CD
Initially naming used the "bridge" and "hashio" terms.
For the Hedera context these should all be replaced with "relay"
Add route handlers for all non supported ednpoints returning static response { code: -32601. message: 'Unsupported JSON-RPC method' }
routes include
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.