Connect to GetBlock with MetaMask

MetaMask is a blockchain wallet available as a mobile application and a browser extension. It allows you to interact with Ethereum-based decentralized applications (dApps) directly from your browser.

Using GetBlock nodes with MetaMask makes your blockchain experience faster and more reliable than using default RPCs:

  • Connect directly to trusted nodes for secure transactions.
  • Enjoy quicker transactions and smoother dApp interactions.
  • Experience less downtime, even during busy network periods

This step-by-step tutorial will guide you through connecting GetBlock’s powerful nodes to your MetaMask wallet.


Before you start

Set up your wallet

If you don’t already have MetaMask, download and install it from the official website: https://metamask.io/download.

MetaMask extension is officially supported on Chrome, Brave, Firefox, Microsoft Edge, and Opera browsers.

Get a custom RPC URL

Generate a JSON-RPC URL for the selected network from your GetBlock account and copy it.

How to get a custom RPC URL for MetaMask
Generate an RPC URL for MetaMask

Rename your endpoints to clearly indicate their purpose.


Add GetBlock RPC to an existing network

If the network is already in your list but uses a default RPC provider, you can switch to GetBlock by following these steps:

  1. Click on the current network name in MetaMask to open the dropdown of networks.
  2. Find the network you want to edit and click the settings menunext to it. Select 'Edit'.
How to set up the custom RPC URL on MetaMask
  1. Open the ‘Default RPC URL’ dropdown and select 'Add RPC URL'.
  2. Paste the JSON-RPC endpoint URL from your GetBlock account (https://shared.eu-central-1.getblock.io/<ACCESS_TOKEN>/).
  3. Name the new RPC URL for easier identification.
How to change the RPC URL on MetaMask
  1. Click 'Add URL', then 'Save' to confirm.

You can now switch between RPC URLs for that network as needed.


Add a new network to MetaMask

If the network isn’t in your list, you can add it as a custom network. For this example, we will add the Polygon zkEVM to MetaMask.

  1. Click on the current network name.
  2. Select 'Add a custom network'.
Adding a new network to MetaMask using custom RPC URL
  1. Fill in the required fields:
FieldDescriptionExample
RPC URLThe network's JSON-RPC URL from your GetBlock accounthttps://shared.<region>.getblock.io/<ACCESS_TOKEN>/
Chain IDThe ID of the network1101
Network nameFetched automatically based on Chain IDPolygon zkEVM
Currency symbolSuggested automatically based on Chain IDETH
Block explorer URLOptional fieldhttps://zkevm.polygonscan.com/
  1. Click 'Save', and the custom network will be added and selected as default.

You can get the Chain ID of an EVM-compatible network (e.g. Polygon zkEVM) sending a request to your endpoint with this curl command:

bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_chainId",
    "params": [],
    "id": "getblock.io"
  }'