Skip to content

feat: allow environment overrides for default Solana endpoints - #66

Open
ClancyBreach wants to merge 1 commit into
pyth-network:mainfrom
ClancyBreach:codex/pyth-63-env-endpoints
Open

ClancyBreach wants to merge 1 commit into
pyth-network:mainfrom
ClancyBreach:codex/pyth-63-env-endpoints

Conversation

@ClancyBreach

Copy link
Copy Markdown

Allow deployments to configure the existing default Solana/Pyth RPC hosts without editing SDK source, using these six environment variables:

  • DEVNET_ENDPOINT
  • TESTNET_ENDPOINT
  • MAINNET_ENDPOINT
  • PYTHNET_ENDPOINT
  • PYTHTEST_CROSSCHAIN_ENDPOINT
  • PYTHTEST_CONFORMANCE_ENDPOINT

Precedence is explicit constructor argument → environment variable → existing built-in default. Values are hosts with an optional port; HTTP/WebSocket URLs retain their existing HTTPS/WSS derivation. Empty or syntactically invalid values fall back to the built-in host. Variables are read once at import time. Existing constructor signatures and explicit URL behavior are unchanged.

Validation: all 126 tests passed on Python 3.11, including 43 new endpoint cases; the same 43 cases also passed on Python 3.9. CI fatal-error lint selection, strict lint for the new test file, and git diff --check passed. Local Windows tests allowed loopback for asyncio and used locally installed timezone data; no real RPC requests or blockchain transactions were performed.

Related to #63

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