SecureRPC

Configuration

Wagmi

Using Wagmi, you can just set your RPC URL to: `https://api.securerpc.com/v1`

Basic Configuration

import { createConfig } from '@wagmi/core'

export default createConfig({
  networks: {
    mainnet: {
      chainId: 1,
      rpcUrl: process.env.MAINNET_RPC_URL,
    },
  },
  contracts: {
    MyContract: {
      abi: './abis/MyContract.json',
      address: '0x...',
      startBlock: 1_000_000,
    },
  },
})

Configuration Options

  • networks: Define the blockchain networks you want to index.
  • contracts: Specify the smart contracts you want to index.
  • startBlock: The block number to start indexing from.
  • endBlock: (Optional) The block number to stop indexing at.

Environment Variables

You can use environment variables in your configuration file. Make sure to create a .env file in your project root and add your variables there.

MAINNET_RELAY_URL=https://mainnet-relay.securerpc.com
HOLESKY_RELAY_URL=https://holesky-relay.infura.io/v3/YOUR-PROJECT-ID