Connect to Testnet
Step-by-step guide to configure your development environment for Circle Layer testnet.
Network Configurationβ
Required Network Detailsβ
Use these settings to connect to Circle Layer testnet:
- Network Name: Circle Layer Testnet
- RPC URL: https://testnet-rpc.circlelayer.com
- WebSocket Endpoint: wss://testnet-rpc.circlelayer.com
- Chain ID: 28525
- Currency Symbol: CLAYER
- Currency Decimals: 18
- Block Explorer: https://explorer-testnet.circlelayer.com
Connection Methodsβ
Method 1: MetaMask (Recommended)β
- Open MetaMask and click on the network dropdown
- Select "Add Network" or "Custom RPC"
- Enter Network Details:
Network Name: Circle Layer Testnet
RPC URL: https://testnet-rpc.circlelayer.com
Chain ID: 28525
Currency Symbol: CLAYER
Block Explorer: https://explorer-testnet.circlelayer.com - Save and Switch to the new network
Method 2: Programmatic Setupβ
Add Circle Layer testnet programmatically to MetaMask:
async function addCircleLayerNetwork() {
try {
await window.ethereum.request({
method: 'wallet_addEthereumChain',
params: [{
chainId: '0x6F75', // 28525 in hex
chainName: 'Circle Layer Testnet',
nativeCurrency: {
name: 'CLAYER',
symbol: 'CLAYER',
decimals: 18
},
rpcUrls: ['https://testnet-rpc.circlelayer.com'],
blockExplorerUrls: ['https://explorer-testnet.circlelayer.com/']
}]
});
console.log('Circle Layer testnet added successfully');
} catch (error) {
console.error('Error adding network:', error);
}
}
Method 3: Development Environmentβ
Configure your development tools for Circle Layer:
Hardhat Configuration:
// hardhat.config.js
module.exports = {
networks: {
circleLayerTestnet: {
url: "https://testnet-rpc.circlelayer.com",
chainId: 28525,
accounts: [process.env.PRIVATE_KEY]
}
}
};
Truffle Configuration:
// truffle-config.js
module.exports = {
networks: {
circleLayerTestnet: {
provider: () => new HDWalletProvider(mnemonic, "https://testnet-rpc.circlelayer.com"),
network_id: 28525,
gas: 8000000,
gasPrice: 21000000000 // 0.000021 CLAYER
}
}
};
Verification Stepsβ
1. Test Connectionβ
Verify your connection is working:
// Using Web3.js
const Web3 = require('web3');
const web3 = new Web3('https://testnet-rpc.circlelayer.com');
async function testConnection() {
try {
const blockNumber = await web3.eth.getBlockNumber();
console.log('Latest block:', blockNumber);
console.log('β
Connection successful');
} catch (error) {
console.error('β Connection failed:', error);
}
}
2. Check Network Statusβ
Monitor network performance:
- Block Time: ~3 seconds
- Transaction Finality: 1-3 seconds
- Network Uptime: 99.95% target
3. Get Test Tokensβ
Visit the Circle Layer Faucet:
- Daily Limit: 1 CLAYER per address
- Purpose: Testing and development only
- Alternative: Faucet API at https://faucet-api.circlelayer.com
Troubleshootingβ
Common Connection Issuesβ
RPC Endpoint Not Responding:
- Verify URL:
https://testnet-rpc.circlelayer.com
- Check network connectivity
- Try switching networks and back
Chain ID Mismatch:
- Ensure Chain ID is set to
28525
- Clear browser cache if needed
- Verify MetaMask network configuration
Gas Price Issues:
- Minimum gas price: 0.000021 CLAYER
- Use gas estimation for dynamic pricing
- Check account CLAYER balance
WebSocket Connectionβ
For real-time data, use WebSocket endpoint:
const WebSocket = require('ws');
const ws = new WebSocket('wss://testnet-rpc.circlelayer.com');
ws.on('open', function open() {
console.log('WebSocket connected');
// Subscribe to new blocks
ws.send(JSON.stringify({
id: 1,
method: 'eth_subscribe',
params: ['newHeads']
}));
});
ws.on('message', function incoming(data) {
const response = JSON.parse(data);
console.log('New block:', response);
});
Next Stepsβ
After successful connection:
- Set Up Wallet - Configure your wallet for development
- Use Faucet - Get test tokens for development
- Deploy Contracts - Start building on Circle Layer
- Explore APIs - Learn about available endpoints
Network Monitoringβ
Real-time Statusβ
- Block Explorer: https://explorer-testnet.circlelayer.com
- RPC Health: Test with
eth_blockNumber
call - WebSocket Status: Monitor connection stability
Performance Expectationsβ
- Block Interval: Consistent 3-second timing
- Transaction Processing: 1-3 second finality
- Gas Efficiency: Predictable CLAYER-based pricing
- Uptime: 99.95% availability target