Skip to content

Api http cleanup#1018

Draft
0xfornax wants to merge 10 commits intomasterfrom
api-http-cleanup
Draft

Api http cleanup#1018
0xfornax wants to merge 10 commits intomasterfrom
api-http-cleanup

Conversation

@0xfornax
Copy link
Member

No description provided.

0xfornax and others added 10 commits February 25, 2026 14:59
- Add APIPort (default 8280) and OpenAPIPort config params to SmartnodeConfig
- Add RestrictedPortModes() (Closed/Localhost only) to port-modes.go
- Add GetNodeOpenPorts() to RocketPoolConfig for docker-compose port mapping
- Update node.tmpl to expose the API port on 127.0.0.1 (Docker mode)
- Create rocketpool/node/http.go: startHTTP() binds 0.0.0.0 in Docker mode,
  respects OpenAPIPort in native mode, shuts down gracefully on SIGTERM
- Create rocketpool/node/routes/routes.go: route registration skeleton
- Wire startHTTP() into node daemon startup (node.go)
- Add callHTTPAPI() and getAPIURL() to the CLI Client struct; apiURL is
  lazily derived from config and cached for subsequent calls

Co-authored-by: Cursor <cursoragent@cursor.com>
Server side:
- rocketpool/api/queue/routes.go: RegisterRoutes() for all 6 queue endpoints
- rocketpool/api/service/routes.go: RegisterRoutes() for all 3 service endpoints
- rocketpool/node/routes/routes.go: wire queue and service route registrations
- shared/utils/api/http.go: WriteResponse/WriteErrorResponse helpers

Client side:
- shared/services/rocketpool/queue.go: replace callAPI with callHTTPAPI
- shared/services/rocketpool/service.go: replace callAPI with callHTTPAPI

debug module skipped (handlers write to stdout directly, not JSON API pattern)

Co-authored-by: Cursor <cursoragent@cursor.com>
Server side (routes.go in each api/ module):
- auction: 10 routes with lotIndex/amountWei param parsing
- network: 9 routes with uint64 param parsing
- wallet: 12 routes; refactor init/recover/test handlers to accept explicit
  params instead of reading CLI flags (c.String/c.Bool/c.Uint)

Client side (shared/services/rocketpool/):
- auction.go, network.go, wallet.go: replace callAPI with callHTTPAPI

Co-authored-by: Cursor <cursoragent@cursor.com>
Server side:
- security/routes.go: RegisterRoutes() for 18 security endpoints
  (note: ProposeInvite/Kick/KickMulti/Replace have no server-side handlers
  and remain on callAPI in the client)
- megapool/routes.go: RegisterRoutes() for 28 megapool endpoints

Client side:
- security.go: migrate 22 of 26 methods to callHTTPAPI; 4 legacy methods
  (ProposeInvite/Kick/KickMulti/Replace) kept on callAPI (no server handler)
- megapool.go: all methods migrated to callHTTPAPI

Co-authored-by: Cursor <cursoragent@cursor.com>
Server side:
- minipool/routes.go: RegisterRoutes() for all 31 minipool endpoints
  (status, refund, stake, promote, dissolve, exit, close, delegate-upgrade,
   set-use-latest-delegate, get-use-latest-delegate, get-delegate,
   get-effective-delegate, get-previous-delegate, get-vanity-artifacts,
   begin/can-begin/can-reduce/reduce-bond-amount, distribute-balance,
   import-key, change-withdrawal-creds, rescue-dissolved,
   get-bond-reduction-enabled)

Client side:
- minipool.go: all methods migrated to callHTTPAPI

Co-authored-by: Cursor <cursoragent@cursor.com>
Server side:
- odao/routes.go: RegisterRoutes() for all odao endpoints
  (status, members, proposals, propose-invite, propose-leave,
   propose-kick, cancel/vote/execute-proposal, join, leave,
   member/proposal/minipool-settings, penalise-megapool,
   all propose-setting variants)
  Note: can-replace/replace have no server handlers; kept on callAPI
- pdao/routes.go: RegisterRoutes() for all pdao endpoints
  (status, proposals, voting, settings, rewards-percentages,
   one-time-spend, recurring-spend, security-council operations,
   claimable-bonds, defeat/finalize-proposal, voting-delegate,
   signalling-address, allow-listed-controllers)

Client side:
- odao.go: all methods migrated to callHTTPAPI except
  CanReplaceTNDAOMember/ReplaceTNDAOMember/CanProposeReplaceTNDAOMember/
  ProposeReplaceTNDAOMember (no server handlers) and
  CanProposeTNDAOSetting (no matching CLI command in odao)
- pdao.go: all methods migrated to callHTTPAPI

Co-authored-by: Cursor <cursoragent@cursor.com>
Server side:
- node/routes.go: RegisterRoutes() for all node endpoints (status, alerts,
  sync, eth-balance, check-collateral, rewards, deposit-contract-info,
  register, set-timezone, primary/rpl withdrawal addresses, swap/stake/
  unstake rpl, rpl locking, withdraw rpl/eth/credit, deposit, send/burn,
  claim-rpl, fee-distributor, interval rewards, smoothing-pool, ens,
  sign, sign-message, vacant-minipool, send-message, express-tickets,
  unclaimed-rewards, bond-requirement)
- node/routes/routes.go: add noderoutes.RegisterRoutes

Client side:
- node.go: all methods migrated to callHTTPAPI

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant