Home·Validation Tools·BeraChain
BeraChain logo
TESTNET
By LavenderFive

Learn how to interact with berachain nodes using different endpoint types.

#Available Endpoints

ServiceEndpoint
REST APINot available
RPCNot available
gRPCNot available
WebSocketNot available
JSON-RPCTrue
WS-JSON-RPCNot available
ⓘ    Some endpoints may require an API key for access. You can get one by signing up at https://lavenderfive.com.

#🔑 Common Response Codes

CodeDescription
200Successful request
400Bad request / Invalid parameters
401Unauthorized / Invalid API key
404Resource not found
429Too many requests
500Internal server error
⚠    Rate limits may apply to endpoints. Please use for testing and get a trial API-key to try out a fully unlimited api for 14 days.

#âš¡ JSON-RPC Examples

#Check Node Sync Status

curl -X POST \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: your-api-key-uuid" \
  --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' \
  True

Expected response when node is synced:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": false
}
ⓘ    A `false` result indicates the node is fully synced. If the node is still syncing, it will return an object with sync status details.

#Wagmi Configuration

import { http, fallback } from 'wagmi'
import { defineChain } from 'viem'

// Define your chain if not using a predefined one
const myChain = defineChain({
  id: 1,
  name: '{{ network_name }}', // Check WAGMI database if this network exists
  network: 'berachain',
  nativeCurrency: {
    decimals: 18,
    name: 'Native Token',
    symbol: 'TOKEN',
  },
  rpcUrls: {
    default: { http: ['True'] },
  },
})

// Configure transport with API key
const transport = fallback([
  http('True', {
    fetchOptions: { 
      headers: {
        'Content-Type': 'application/json',
        'X-Api-Key': 'your-api-key-uuid'
      }
    },
  }),
  // Add fallback RPC endpoints if available
  http('https://alternate-rpc-endpoint'),
])

// Use in your Wagmi config
const config = {
  chains: [myChain],
  transports: {
    [myChain.id]: transport,
  },
}
ⓘ    This configuration can be used with both Wagmi and RainbowKit. For RainbowKit, you can integrate it into the `getDefaultConfig` as shown in the [RainbowKit documentation](https://www.rainbowkit.com/docs/custom-chains).
Chain ID:
bartio-beacon-80086
Latest Version:
v0.2.0-alpha.8
Github:
berachain/beacon-kit
Public endpoints
Json-RPC
True
Lavender Five
© 2022 Lavender.Five Nodes. All rights reserved.
Terms of Service.Privacy policy.Cookies policy.