This guide will help you add the Rayls devnet to your MetaMask wallet so you can interact with deployed contracts.
- MetaMask browser extension installed (Download)
- A funded account with Rayls devnet tokens
-
Open MetaMask and click on the network selector at the top
-
Click "Add Network" or "Add a network manually"
-
Enter the following network details:
Network Name: Rayls Devnet RPC URL: https://devnet-rpc.rayls.com Chain ID: 123123 Currency Symbol: RAYLS (or native token symbol) Block Explorer URL: ttps://devnet-explorer.rayls.com (Add if available) -
Click "Save" to add the network
-
Switch to Rayls Network using the network selector
You can also add the network programmatically using this JavaScript code:
async function addRaylsNetwork() {
try {
await window.ethereum.request({
method: 'wallet_addEthereumChain',
params: [{
chainId: '0xB5757', // 743111 in hex
chainName: 'Rayls Devnet',
rpcUrls: ['https://devnet-rpc.rayls.com'],
nativeCurrency: {
name: 'Rayls',
symbol: 'RAYLS', // Update with correct symbol
decimals: 18
},
blockExplorerUrls: null // Add if available
}]
});
console.log('Rayls network added successfully!');
} catch (error) {
console.error('Error adding network:', error);
}
}To verify the correct Chain ID, you can run this command in your terminal:
curl -X POST https://devnet-rpc.rayls.com \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}'Or use this Node.js script:
import { ethers } from "ethers";
const provider = new ethers.JsonRpcProvider("https://devnet-rpc.rayls.com");
const network = await provider.getNetwork();
console.log("Chain ID:", network.chainId.toString());
console.log("Chain ID (hex):", "0x" + network.chainId.toString(16));To interact with contracts you've deployed:
- Open MetaMask
- Click on the account icon (top right)
- Select "Import Account"
- Paste your private key (the same one from your
.envfile) - Click "Import"
- Only import accounts in MetaMask that are used for development/testing
- Never import production/mainnet accounts with significant funds
- Consider using a separate browser profile for development
To get test tokens for gas fees:
- Copy your wallet address from MetaMask
- Visit the Rayls faucet (check Rayls documentation for URL)
- Paste your address and request tokens
- Wait for the transaction to complete
If you see this error, the Chain ID in MetaMask doesn't match the network:
- Remove the Rayls network from MetaMask
- Verify the correct Chain ID using the methods above
- Re-add the network with the correct Chain ID
- Verify the RPC URL is correct:
https://devnet-rpc.rayls.com - Check if the Rayls devnet is operational
- Try clearing MetaMask cache: Settings → Advanced → Reset
- Make sure you're connected to the Rayls network in MetaMask
- Check the transaction hash on the block explorer (if available)
- Verify you have enough tokens for gas fees
- MetaMask Documentation
- MetaMask Network Addition Guide
- Check Rayls official documentation for network details
Note: Always verify network details from official Rayls documentation before adding to MetaMask.