Connect to Arfi network
Add the Arfi network to MetaMask, confirm you are talking to the right chain, and send your first JSON-RPC request. Takes about five minutes.
Before you start #
- A browser wallet such as MetaMask (any EVM wallet that allows custom networks works the same way).
- A browser on any device — the public draft RPC at
https://rpc.arficoin.comis reachable over HTTPS. - For the developer examples:
curl, or Node.js 18+ withethersv6, or Python 3.9+ withweb3v7.
Network parameters #
These are the values your wallet or tooling needs. The Chain ID is part of every signed transaction (EIP-155), so a wallet on the wrong Chain ID cannot accidentally send a transaction to Arfi.
| Field | Value | Copy |
|---|---|---|
| Network name | Arfi Local (draft) | |
| RPC URL | https://rpc.arficoin.com | |
| WebSocket URL | wss://rpc.arficoin.com/ws | |
| Chain ID | 884801 · hex 0xd8041 | |
| Currency symbol | AARFI | |
| Decimals | 18 | |
| Block explorer | https://scan.arficoin.com | |
| Faucet | https://faucet.arficoin.com | |
| Consensus | Clique Proof of Authority · 3 validators | |
| Block time | 3 seconds (target) | |
| Status | Live draft · Chain ID provisional |
config/networks.json rather than hard-coding it in apps.Add Arfi to MetaMask #
The fastest way is the Add Network button on arficoin.com, which asks MetaMask to add the network for you. To add it by hand:
- Open the network menuIn MetaMask, click the network selector at the top left, then choose Add a custom network (older versions: Add network → Add a network manually).
- Enter the network detailsFill in the fields exactly as below. MetaMask checks the Chain ID against the RPC, so the node must be running.
Network nameArfi Local (draft)Default RPC URLhttps://rpc.arficoin.comChain ID884801Currency symbolARFIBlock explorer URL (optional)https://scan.arficoin.comIllustration of the MetaMask form — field labels may differ slightly by version.
- Save and switchClick Save, then select Arfi Local (draft) in the network list. Your balance is shown in ARFI.
- Get test ARFIClaim draft ARFI from the web faucet at faucet.arficoin.com (one drip per address / 24h).
Add the network from a dapp #
Dapps can request the same thing with wallet_addEthereumChain (EIP-3085). The chainId must be a hex string.
await window.ethereum.request({
method: "wallet_addEthereumChain",
params: [{
chainId: "0xd8041", // 884801
chainName: "Arfi Local (draft)",
nativeCurrency: { name: "ARFI", symbol: "ARFI", decimals: 18 },
rpcUrls: ["https://rpc.arficoin.com"],
blockExplorerUrls: ["https://scan.arficoin.com"],
}],
});
Verify the connection #
Ask the node for the latest block number with eth_blockNumber. On a healthy network the number increases by about one every 3 seconds.
curl -s -X POST https://rpc.arficoin.com \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'// npm install ethers@6
import { ethers } from "ethers";
const provider = new ethers.JsonRpcProvider("https://rpc.arficoin.com", {
chainId: 884801,
name: "arfi-local",
});
const block = await provider.getBlockNumber();
console.log(`Latest block: ${block}`);# pip install "web3>=7"
from web3 import Web3
from web3.middleware import ExtraDataToPOAMiddleware
w3 = Web3(Web3.HTTPProvider("https://rpc.arficoin.com"))
# Clique blocks carry signer data in extraData; needed for get_block()
w3.middleware_onion.inject(ExtraDataToPOAMiddleware, layer=0)
assert w3.eth.chain_id == 884801
print("Latest block:", w3.eth.block_number){"jsonrpc":"2.0","id":1,"result":"0x1f4a"}
The result is hexadecimal: 0x1f4a is block 8010. To confirm you are on Arfi and not another EVM network, call eth_chainId the same way — it must return "0xd8041".
extraData field, which is longer than the 32 bytes Ethereum mainnet allows. Without ExtraDataToPOAMiddleware, web3.py raises an error when it reads full blocks. ethers.js and viem do not need this.Troubleshooting #
“The RPC URL returned a different chain ID”
MetaMask may be pointing at an old custom RPC. Remove the network and re-add using the values on this page (rpc.arficoin.com / Chain ID 884801).
“Could not fetch chain ID” or the request hangs
The public draft RPC may be briefly offline, or a firewall/DNS issue is blocking rpc.arficoin.com. Check status.arficoin.com.
Block number does not increase
Clique needs more than half of the validators online to keep producing blocks. With 3 validators, at least 2 must be running.