Connect to GetBlock with MetaMask

Learn how to set up custom RPC URL on MetaMask for faster, more reliable, and secure blockchain interactions.

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.

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://go.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:

Field
Description
Example

RPC URL

The network's JSON-RPC URL from your GetBlock account

https://go.getblock.io/<ACCESS_TOKEN>/

Chain ID

The ID of the network

1101

Network name

Fetched automatically based on Chain ID

Polygon zkEVM

Currency symbol

Suggested automatically based on Chain ID

ETH

Block explorer URL

Optional field

https://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:

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

Last updated