Smart Node v2 HTTP API OpenApi 3 spec and codegen
General Information
What is the nature of the proposed bounty?
Write OpenAPI 3.x specifications for the HTTP API endpoints smartnode v2 currently uses.
Generate middleware using https://github.com/deepmap/oapi-codegen.
Migrate Smart Node v2’s raw HTTP serving to use the generated code instead.
Migrate Smart Node v2’s raw HTTP client to use the generated code instead.
Why are you writing this bounty proposal?
Spec-driven API development makes integration easier (ie, by UIs) and provides useful tooling (eg, generated CLI and client libraries).
Benefit
Less code to maintain by hand, plus further unblocking API integration (UI) work.
Which other non-RPL protocols, DAOs, projects, or individuals would stand to benefit from the bounty being successfully completed?
None
Work
What steps would be entailed in completing the bounty? Do successful examples of such work exist elsewhere? What skillsets or knowledge will be required?
All HTTP endpoints and client code should be through the generated interfaces.
Recommend familiarity with Golang, OpenAPI/Swagger, the HTTP protocol, and REST principles.
What advice would you give a bounty hunter working on this bounty?
Start small- write a spec for a single endpoint and complete the migration of that entire endpoint/client. Add CI jobs to ensure that the generated code is always ‘fresh’ on merge.
Add additional endpoints one by one until they are all migrated to spec-driven.
Confine all the generated code to a single go package that only contains generated code.
This is not a good first bounty. It will be very difficult if it is your first contribution.
Should the output of this bounty be available under an open source license?
It will be in Smart Node, which is GPLv3
Costs
How much do you think the completion of this bounty worth to Rocket Pool (in USD)?
$3,500
How much work will be needed to verify this bounty has been completed? What skillsets or knowledge will be required?
Smart Node’s current maintainers can confirm completion.
Structure
How would you structure this bounty, and why?
- Milestone 1: $500
A OpenAPI spec has been added and its generated code is being used by one API endpoint.
A script has been added that runs codegen.
A Github Actions CI job has been added and verifies that re-running codegen produces no diff. - Mileston 2: $3000
All API endpoints are in the spec
All API endpoints and client code uses generated interfaces.
Is this bounty repeatable?
No
Are there any reasonable circumstances under which this bounty should be withdrawn? Should it expire?
Withdrawn if @jcrtp and @fornax are opposed.
Conflicts of Interest
Does the person or persons proposing the bounty have any conflicts of interest to disclose? (Please disclose here if you are a member of the GMC or if any member of the GMC would benefit directly financially from the successful completion of the bounty).
None
Will the applicant, or any protocol or project in which the applicant has a vested interest (other than Rocket Pool), benefit financially if the bounty is successfully completed?
None