Skip to main content

Start Developing on Morph

Developing on Morph is as straightforward as developing on Ethereum.

To deploy contracts onto a MorphL2 chain, simply set the RPC endpoint of your target MorphL2 chain and deploy using your preferred Ethereum development framework:

...it all just works!

Mainnet:

Step 1: Network Configuration

Before you start, ensure you are connected to the following networks:

Network NameMorph MainnetEthereum Mainnet
RPC URLhttps://rpc-quicknode.morphl2.iohttps://ethereum-rpc.publicnode.com
Chain ID28181
Currency SymbolETHETH
Block Explorer URLhttps://explorer.morphl2.iohttps://etherscan.io
Websocket Connection

wss://rpc-quicknode.morphl2.io

Step 2: Set up your development framework

Hardhat

Modify your Hardhat config file hardhat.config.ts to point at the Morph public RPC.

const config: HardhatUserConfig = {
...
networks: {
morphl2: {
url: 'https://rpc-quicknode.morphl2.io',
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
gasprice = 1000000000
},
},
};

Foundry

To deploy using Morph Public RPC, run:

forge create ... --rpc-url= --legacy

ethers.js

Setting up a Morph provider in an ethers script:

import { ethers } from 'ethers';

const provider = new ethers.providers.JsonRpcProvider(
'https://rpc-quicknode.morphl2.io'
);

Hoodi Testnet:

Step 1: Network Configuration

Before you start, ensure you are connected to the following networks:

Network NameMorph Hoodi TestnetHoodi Testnet
RPC URLhttps://rpc-hoodi.morphl2.iohttps://ethereum-hoodi-rpc.publicnode.com
Chain ID2910560048
Currency SymbolETHETH
Block Explorer URLhttps://explorer-hoodi.morphl2.iohttps://hoodi.etherscan.io
Websocket Connection

wss://rpc-hoodi.morphl2.io

Step 2: Set up your development framework

Hardhat

Modify your Hardhat config file hardhat.config.ts to point at the Morph public RPC.

const config: HardhatUserConfig = {
...
networks: {
morphl2: {
url: 'https://rpc-hoodi.morphl2.io',
accounts:
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
gasprice = 2000000000
},
},
};

Foundry

To deploy using Morph Public RPC, run:

forge create ... --rpc-url= --legacy

ethers.js

Setting up a Morph provider in an ethers script:

import { ethers } from 'ethers';

const provider = new ethers.providers.JsonRpcProvider(
'https://rpc-hoodi.morphl2.io'
);

Step 3: Acquire Ether

To start building on Morph, you may need some testnet ETH. Use a faucet to acquire Hoodi Ether, then bridge the test Ethereum Ether to the Morph testnet.

Each faucet has its own rules and requirements, so you may need to try a few before finding one that works for you.

Hoodi ETH faucet websites:

https://stakely.io/faucet/ethereum-hoodi-testnet-eth

https://faucet.quicknode.com/ethereum/hoodi

https://hoodi-faucet.pk910.de

https://cloud.google.com/application/web3/faucet/ethereum (needs a Google account)

Once you receive ETH on Hoodi, you should see it in your wallet on the Hoodi Network. It may take a few seconds for them to appear, but you can check the status by looking for a transaction to your address on a Hoodi Block Explorer.