metaplex-foundation / js-examples

Examples and Starter Kits using the new JS SDK
MIT License
79 stars 92 forks source link

Errors connecting to "mainnet-beta" #32

Closed vikramp3000 closed 1 year ago

vikramp3000 commented 1 year ago

Working on getting-started-nextjs. When I connect with "mainnet-beta" with the clusterApiUrl I am getting this error:

Unhandled Runtime Error Error: 403 : {"jsonrpc":"2.0","error":{"code": 403, "message":"Access forbidden, contact your app developer or support@rpcpool.com."}, "id": "30e5cb83-3f7d-4621-a9f5-cc78f2530ab0" }

Call Stack ClientBrowser.eval [as callServer] node_modules\@solana\web3.js\lib\index.browser.esm.js (3881:0)

It works fine when I connect to "devnet". Weird. Here is my code for the connection:

const connection = new Connection(clusterApiUrl("mainnet-beta")); const mx = Metaplex.make(connection);

vikramp3000 commented 1 year ago

If anyone cares the solution to connect to main net is this:

const connection = new Connection("https://api.metaplex.solana.com/"); const mx = Metaplex.make(connection);