solana-labs / explorer

Explorer for Solana clusters
https://explorer.solana.com
MIT License
214 stars 278 forks source link

[Bug] pnpm dev returns 403s when run on localhost #327

Open mikemaccana opened 5 months ago

mikemaccana commented 5 months ago

Describe the bug

Was hoping to fix #326 myself but looks like explorer doesn't work on localhost right now.

Per README.md, pnpm dev on current master 248801a8b02e59af4a8589405e966de5253d9778 fails with:

(snip a deprecation warning)

 POST https://api.mainnet-beta.solana.com/ 403 (Forbidden)
cluster.tsx:151 
 SolanaHttpError: HTTP error (403): 
    at makeHttpRequest (index.browser.js:268:1)
    at async Object.makeCoalescedHttpRequest [as transport] (index.browser.js:311:1)
    at async Object.send (index.browser.js:41:1)
    at async Promise.all (:3000/index 0)
    at async updateCluster (cluster.tsx:131:65) 
{clusterUrl: 'https://api.mainnet-beta.solana.com'}
cluster.tsx:134 

 POST https://api.mainnet-beta.solana.com/ 403 (Forbidden)
solanaClusterStats.tsx:131 

 POST https://api.mainnet-beta.solana.com/ 403 (Forbidden)
solanaClusterStats.tsx:141 
 SolanaHttpError: HTTP error (403): 
    at makeHttpRequest (index.browser.js:268:1)
    at async Object.makeCoalescedHttpRequest [as transport] (index.browser.js:311:1)
    at async Object.send (index.browser.js:41:1)
    at async getTransactionCount (solanaClusterStats.tsx:131:42) 
{url: 'https://api.mainnet-beta.solana.com'}
cluster.tsx:133 

 POST https://api.mainnet-beta.solana.com/ 403 (Forbidden)
solanaClusterStats.tsx:155 

 POST https://api.mainnet-beta.solana.com/ 403 (Forbidden)
solanaClusterStats.tsx:175 
 SolanaHttpError: HTTP error (403): 
    at makeHttpRequest (index.browser.js:268:1)
    at async Object.makeCoalescedHttpRequest [as transport] (index.browser.js:311:1)
    at async Object.send (index.browser.js:41:1)
    at async getEpochInfo (solanaClusterStats.tsx:155:43)
    at async eval (solanaClusterStats.tsx:216:13) 
{url: 'https://api.mainnet-beta.solana.com'}
solanaClusterStats.tsx:86 

 POST https://api.mainnet-beta.solana.com/ 403 (Forbidden)
solanaClusterStats.tsx:113 
 SolanaHttpError: HTTP error (403): 
    at makeHttpRequest (index.browser.js:268:1)
    at async Object.makeCoalescedHttpRequest [as transport] (index.browser.js:311:1)
    at async Object.send (index.browser.js:41:1)
    at async getPerformanceSamples (solanaClusterStats.tsx:86:41) 
{url: 'https://api.mainnet-beta.solana.com'}
[NEW] Explain Console errors by using Copilot in Edge: click 
 to explain an error. Learn more
Don't show again
localhost/:1 
 Access to XMLHttpRequest at 'https://ping.solana.com/mainnet-beta/last6hours' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
SolanaPingProvider.tsx:105 

 GET https://ping.solana.com/mainnet-beta/last6hours net::ERR_FAILED 403 (Forbidden)

Is there a rate limit or similar?

Screenshot 2024-04-01 at 15 11 46

To Reproduce

Just follow steps from README.md ie pnpm dev

Expected behavior Functional localhost