hashgraph / hedera-json-rpc-relay

Implementation of Ethereum JSON-RPC APIs for Hedera
Apache License 2.0
70 stars 73 forks source link

Create a proper clientSDK for the mirror node using the openAPI Spec provided #1416

Open AlfredoG87 opened 1 year ago

AlfredoG87 commented 1 year ago

πŸ†•πŸ₯ First Timers Only

This issue is reserved for people who have never contributed to Hedera or any open source project in general. We know that creating a pull request (PR) is a major barrier for new contributors. The goal of this issue and all other issues labeled by 'Good First Issue' is to help you make your first contribution to Hedera.

πŸ‘Ύ Description of the issue

Currently we are using the REST API of the mirror node without a proper clientSDK for the types, enums, errors, etc. that makes it cumbersome and flaky, there are no standards and code is not ideal. Also, makes checking the api more often for supported fields, objects, errors, and statuses types.

Proposed Solution:

Generate a clientSDK for the mirror node using the openAPI spec provided for the mirror node https://testnet.mirrornode.hedera.com/api/v1/docs/openapi.yml

There are 2 options that are promising:

  1. https://openapistack.co/docs/openapi-client-axios/intro/
  2. Swagger Editor IO image

From the 2 options above, the preferred one if possible is the first one since no generated code needs to be updated with each release of the mirror node, types are created in runtime by the tool.

πŸ“‹ Step by step guide to do a contribution

If you have never contributed to an open source project at GitHub, the following step-by-step guide will introduce you to the workflow. More information and concrete samples for shell commands for each step can be found in our CONTRIBUTING.md file. A more detailed general documentation of the GitHub PR workflow can be found here.

πŸŽ‰ Contribute to Hacktoberfest

Solve this issue as part of the Hacktoberfest event and get a chance to receive cool goodies like a T-Shirt. 🎽

πŸ€” Additional Information

If you have any questions, just ask us directly in this issue by adding a comment. You can join our community chat at Discord. A general manual about open-source contributions can be found here.

hendrikebbers commented 1 month ago

@AlfredoG87 can you please add more context:

AlfredoG87 commented 1 month ago

@hendrikebbers

  1. It makes sense to make it a standalone module similar to other packages like relay server and ws-server. that way is independent of the relay (package) and can be used by any other package.
  2. it should be generated at build and only configuration parameter is the api spec url. this is the url for testnet api spec --> https://testnet.mirrornode.hedera.com/api/v1/docs/openapi.yml