Skip to content

staking: forward solana_rpc_endpoint and eth_rpc_endpoint env vars#14375

Open
dylanjeffers wants to merge 1 commit into
mainfrom
staking/docker-compose-env-fix
Open

staking: forward solana_rpc_endpoint and eth_rpc_endpoint env vars#14375
dylanjeffers wants to merge 1 commit into
mainfrom
staking/docker-compose-env-fix

Conversation

@dylanjeffers
Copy link
Copy Markdown
Contributor

Summary

  • The staking pedalboard service reads process.env.solana_rpc_endpoint and process.env.eth_rpc_endpoint, but the prod compose entry never forwarded them — the container would boot with both undefined.
  • Adds env_file: .env plus an environment: block forwarding SOLANA_RPC_ENDPOINT and ETH_RPC_ENDPOINT, matching the pattern other pedalboard services use (e.g. solana-relay).

Context

Pairs with the staking-service migration to the standalone pedalboard repo: https://github.com/AudiusProject/pedalboard (separate PR). That PR contains the ClaimsManager runtime fix, the tsc/node dist build setup, the /health endpoint, and the port pin to 6000 — but none of that helps if the RPC URLs never reach the container.

Test plan

  • Bring up the prod compose stack with SOLANA_RPC_ENDPOINT and ETH_RPC_ENDPOINT set in .env.
  • docker compose exec staking env | grep _rpc_endpoint — confirm both are set.
  • curl http://staking:6000/init-round — confirm the route does not crash on process.env.eth_rpc_endpoint!.

🤖 Generated with Claude Code

The staking pedalboard service reads `process.env.solana_rpc_endpoint`
and `process.env.eth_rpc_endpoint` at boot, but the compose entry never
forwarded them. Add `env_file: .env` plus an explicit `environment:`
block (matching the pattern other pedalboard services use) so the
service actually has its RPC URLs in prod.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 21, 2026

⚠️ No Changeset found

Latest commit: 3d46bed

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

dylanjeffers added a commit to AudiusProject/pedalboard that referenced this pull request May 21, 2026
Brings the staking service to parity with the version in
apps/packages/discovery-provider/plugins/pedalboard/apps/staking and
fixes a handful of issues that would have prevented it from running
in prod:

- Bump @audius/eth 0.1.0 -> 1.0.0. The 1.0.0 export shape changed:
  ClaimsManager is now a plain `{ abi, address }` object rather than
  a class, so `new ClaimsManager(viemClient)` was a runtime crash.
  Rewrite initRound to use viemClient.readContract({ abi, address,
  functionName }) and parallelize the three on-chain reads.

- Replace `npx tsx ./src/index.ts` start script with `tsc` build +
  `node ./dist/index.js`, matching anti-abuse-oracle. The Dockerfile
  already runs `npm run build` during install, so tsx at runtime
  was both slower and dragged the dev toolchain into prod.

- Pin the server port to 6000 (matches the nginx
  /plugins/<service>/... upstream) and drop the `process.env.port`
  fallback that no caller was setting.

- /health now returns the standard `{ status: 'ok' }` shape used by
  the other pedalboard services instead of `{ status: 'up', port }`.

The apps/dev-tools/compose/docker-compose.pedalboard.prod.yml entry
was also missing the env_file/environment blocks needed to forward
solana_rpc_endpoint and eth_rpc_endpoint to the container. That's
fixed in a paired PR on the apps repo (AudiusProject/apps#14375)
so this service actually has its RPC URLs at runtime.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
dylanjeffers added a commit to AudiusProject/pedalboard that referenced this pull request May 21, 2026
Brings the staking service to parity with the version in
apps/packages/discovery-provider/plugins/pedalboard/apps/staking and
fixes a handful of issues that would have prevented it from running
in prod:

- Bump @audius/eth 0.1.0 -> 1.0.0. The 1.0.0 export shape changed:
  ClaimsManager is now a plain `{ abi, address }` object rather than
  a class, so `new ClaimsManager(viemClient)` was a runtime crash.
  Rewrite initRound to use viemClient.readContract({ abi, address,
  functionName }) and parallelize the three on-chain reads.

- Replace `npx tsx ./src/index.ts` start script with `tsc` build +
  `node ./dist/index.js`, matching anti-abuse-oracle. The Dockerfile
  already runs `npm run build` during install, so tsx at runtime
  was both slower and dragged the dev toolchain into prod.

- Pin the server port to 6000 (matches the nginx
  /plugins/<service>/... upstream) and drop the `process.env.port`
  fallback that no caller was setting.

- /health now returns the standard `{ status: 'ok' }` shape used by
  the other pedalboard services instead of `{ status: 'up', port }`.

The apps/dev-tools/compose/docker-compose.pedalboard.prod.yml entry
was also missing the env_file/environment blocks needed to forward
solana_rpc_endpoint and eth_rpc_endpoint to the container. That's
fixed in a paired PR on the apps repo (AudiusProject/apps#14375)
so this service actually has its RPC URLs at runtime.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant