Skip to content

Set Up Developer Environment

Configure your Hardhat or Foundry development environment for Mezo.

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.


ParameterValue
Network NameMezo Mainnet
Chain ID31612
CurrencyBTC (18 decimals)
Block Explorerexplorer.mezo.org
ProviderHTTPSWSS
Boarhttps://rpc-http.mezo.boar.networkwss://rpc-ws.mezo.boar.network
Imperatorhttps://rpc_evm-mezo.imperator.cowss://ws_evm-mezo.imperator.co
Validation Cloudhttps://mainnet.mezo.public.validationcloud.iowss://mainnet.mezo.public.validationcloud.io
dRPC NodeCloudhttps://mezo.drpc.orgwss://mezo.drpc.org

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
}
}
},
};

To configure a Foundry project for Mezo Mainnet, set the following in your foundry.toml:

[profile.default]
chain_id = 31612
eth_rpc_url = "https://rpc-http.mezo.boar.network"
evm_version = 'london'

ParameterValue
Network NameMezo Testnet
Chain ID31611
CurrencyBTC (18 decimals)
Block Explorerexplorer.test.mezo.org
ProtocolURL
HTTPShttps://rpc.test.mezo.org
WSSwss://rpc-ws.test.mezo.org

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
}
}
},
};

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 = 31611
eth_rpc_url = "https://rpc.test.mezo.org"
evm_version = 'london'