Failed to connect to Berachain network

Hello, I’m trying to connect to berachain testnet

I’m following this guide

this is the config

const chainConfig = {
  chainNamespace: CHAIN_NAMESPACES.EIP155,
  chainId: "0x138c4", // Hex value from 80084
  rpcTarget: "https://bartio.rpc.berachain.com",
  displayName: "Berachain",
  blockExplorer: "https://bartio.beratrail.io",
  ticker: "BERA",
  tickerName: "BERA Token",
};

const privateKeyProvider = new EthereumPrivateKeyProvider({ config: { chainConfig } });

and this is the error I got

Also I’m on saphire devnet. Is there something I missed?
Thanks!

Hello DVendy! Thank you for reaching out. I see you’re trying to connect to the Berachain testnet using the Plug n Play SDK, and you’ve encountered an error.

Here’s a summary of the information you’ve provided:

  • SDK Details: Plug n Play
  • Issue: Failed to connect to Berachain network
  • Chain ID: 0x138c4 (from Hex value 80084)
  • RPC Target: https://bartio.rpc.berachain.com
  • Block Explorer: https://bartio.beratrail.io
  • Platform: Sapphire Devnet

And I noted that you’ve shared your configuration code and also an image of the error you received, which can be helpful for further investigation.

A couple of things you might want to confirm/check:

  1. Ensure the rpcTarget is correct, and the endpoint is accessible from your environment.
  2. Verify that you’re using the correct chain configuration specific to the Sapphire devnet.

If possible, it would be helpful to include:

  • A screenshot of the browser console for any additional error messages.
  • The Web3Auth initialization and login code snippets, so we can review how everything is set up.

Let me know if you have any other questions, or if you find the required details! We are here to help you get this resolved!

Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.

The error is basically saying that only =that network id doesn’t match. The hex value would be 0x138D4 instead of 0x138c4.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.