Skip to content

refactor: Update mainnet RPC API URL to use new endpoint#844

Open
askov wants to merge 1 commit intosolana-foundation:masterfrom
hoodieshq:development-refactor-use-mainnet
Open

refactor: Update mainnet RPC API URL to use new endpoint#844
askov wants to merge 1 commit intosolana-foundation:masterfrom
hoodieshq:development-refactor-use-mainnet

Conversation

@askov
Copy link
Contributor

@askov askov commented Feb 6, 2026

Description

Updates the Solana mainnet RPC URL from api.mainnet-beta.solana.com to api.mainnet.solana.com. Also adds unit tests for modifyUrl.

The follow-up task

Type of change

  • Other (please describe): Change mainnet RPC url

Testing

  • Tests should pass

Related Issues

Closes HOO-221

Checklist

  • My code follows the project's style guidelines
  • I have added tests that prove my fix/feature works
  • All tests pass locally and in CI
  • CI/CD checks pass

@vercel
Copy link

vercel bot commented Feb 6, 2026

@askov is attempting to deploy a commit to the Solana Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 6, 2026

Greptile Overview

Greptile Summary

This PR updates the Solana mainnet RPC URL from api.mainnet-beta.solana.com to api.mainnet.solana.com across the codebase. The changes include:

  • Updated MAINNET_BETA_URL constant in app/utils/cluster.ts
  • Exported modifyUrl function to enable unit testing
  • Added comprehensive unit tests for modifyUrl function in app/utils/__tests__/cluster.test.ts
  • Updated Python script fetch_mainnet_activations.py to use new endpoint

The changes are clean and well-tested. However, several test files and documentation still reference the old URL and should be updated for complete consistency:

  • app/features/security-txt/model/__tests__/useSecurityTxt.spec.ts
  • app/components/inspector/__tests__/InspectorPage.spec.tsx
  • app/components/account/__tests__/AccountHeader.spec.tsx
  • CONTRIBUTING.md

Confidence Score: 4/5

  • This PR is safe to merge with minor documentation and test cleanup recommended
  • Score reflects well-structured changes with good test coverage, but several test files and documentation still reference the old URL which should be updated for consistency
  • All files are safe, but check that test files and documentation referencing old URL are updated

Important Files Changed

Filename Overview
app/utils/cluster.ts Updated MAINNET_BETA_URL from api.mainnet-beta.solana.com to api.mainnet.solana.com and exported modifyUrl function for testing
app/utils/tests/cluster.test.ts Added comprehensive unit tests for modifyUrl function covering localhost and non-localhost scenarios
scripts/fetch_mainnet_activations.py Updated AsyncClient connection URL to use new mainnet endpoint

Sequence Diagram

sequenceDiagram
    participant App as Explorer App
    participant ClusterUtils as cluster.ts
    participant ModifyURL as modifyUrl()
    participant RPC as RPC Endpoint
    
    Note over ClusterUtils: MAINNET_BETA_URL updated<br/>from api.mainnet-beta.solana.com<br/>to api.mainnet.solana.com
    
    App->>ClusterUtils: Request cluster URL
    ClusterUtils->>ModifyURL: modifyUrl(MAINNET_BETA_URL)
    
    alt hostname === 'localhost'
        ModifyURL-->>ClusterUtils: Return unchanged URL<br/>https://api.mainnet.solana.com
    else hostname !== 'localhost'
        ModifyURL-->>ClusterUtils: Return modified URL<br/>https://explorer-api.mainnet.solana.com
    end
    
    ClusterUtils-->>App: Return final URL
    App->>RPC: Connect to RPC endpoint
    RPC-->>App: RPC connection established
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

}

export const MAINNET_BETA_URL = 'https://api.mainnet-beta.solana.com';
export const MAINNET_BETA_URL = 'https://api.mainnet.solana.com';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check that test files still referencing api.mainnet-beta.solana.com are updated:

  • app/features/security-txt/model/__tests__/useSecurityTxt.spec.ts:16
  • app/components/inspector/__tests__/InspectorPage.spec.tsx:142
  • app/components/account/__tests__/AccountHeader.spec.tsx:16
  • CONTRIBUTING.md:31

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet, there are a lot of changes required. The goal here is to make it work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. There will be a consecutive task with changes in the whole project. Agreed.

Copy link
Contributor

@rogaldh rogaldh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

We are waiting for Alpenglow to be released.

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.

3 participants