Set Up Developer Environment
Configure your Hardhat or Foundry development environment for Mezo.
Before you begin
Section titled “Before you begin”Before you can deploy applications, you will need an Ethereum wallet with BTC to pay for gas fees.
For advanced chain configuration and network parameters, see the Chains Configuration Guide.
Mainnet
Section titled “Mainnet”Network Details
Section titled “Network Details”| Parameter | Value |
|---|---|
| Network Name | Mezo Mainnet |
| Chain ID | 31612 |
| Currency | BTC (18 decimals) |
| Block Explorer | explorer.mezo.org |
RPC Providers
Section titled “RPC Providers”| Provider | HTTPS | WSS |
|---|---|---|
| Boar | https://rpc-http.mezo.boar.network | wss://rpc-ws.mezo.boar.network |
| Imperator | https://rpc_evm-mezo.imperator.co | wss://ws_evm-mezo.imperator.co |
| Validation Cloud | https://mainnet.mezo.public.validationcloud.io | wss://mainnet.mezo.public.validationcloud.io |
| dRPC NodeCloud | https://mezo.drpc.org | wss://mezo.drpc.org |
Hardhat
Section titled “Hardhat”To configure Hardhat for Mezo Mainnet, modify your hardhat.config.js (or .ts) file:
module.exports = { defaultNetwork: "mezomainnet", networks: { mezomainnet: { url: "https://rpc-http.mezo.boar.network", chainId: 31612, accounts: ["YOUR_PRIVATE_WALLET_KEY"] // Use environment variables for security } }, solidity: { version: "0.8.28", settings: { evmVersion: "london", optimizer: { enabled: true, runs: 200 } } },};Foundry
Section titled “Foundry”To configure a Foundry project for Mezo Mainnet, set the following in your foundry.toml:
[profile.default]chain_id = 31612eth_rpc_url = "https://rpc-http.mezo.boar.network"evm_version = 'london'Testnet
Section titled “Testnet”Network Details
Section titled “Network Details”| Parameter | Value |
|---|---|
| Network Name | Mezo Testnet |
| Chain ID | 31611 |
| Currency | BTC (18 decimals) |
| Block Explorer | explorer.test.mezo.org |
RPC Endpoints
Section titled “RPC Endpoints”| Protocol | URL |
|---|---|
| HTTPS | https://rpc.test.mezo.org |
| WSS | wss://rpc-ws.test.mezo.org |
Hardhat
Section titled “Hardhat”If you are new to Hardhat, use the Hardhat Quick Start guide to learn how to install and initialize your project.
To configure Hardhat for Mezo Testnet, modify your hardhat.config.js (or .ts) file:
module.exports = { defaultNetwork: "mezotestnet", networks: { mezotestnet: { url: "https://rpc.test.mezo.org", chainId: 31611, accounts: ["YOUR_PRIVATE_WALLET_KEY"] // Use environment variables for security } }, solidity: { version: "0.8.28", settings: { evmVersion: "london", optimizer: { enabled: true, runs: 200 } } },};Foundry
Section titled “Foundry”If you are new to Foundry, use the Foundry Getting Started guide to learn how to install and initialize your project.
To configure a Foundry project for Mezo Testnet, set the following in your foundry.toml:
[profile.default]chain_id = 31611eth_rpc_url = "https://rpc.test.mezo.org"evm_version = 'london'