Chiliz β Build on The Sports Blockchain
Chiliz RPC
With Dwellir, you get access to our global Chiliz network which always routes your API requests to the nearest available location, ensuring low latency and the fastest speeds.
Why Build on Chiliz?β
Chiliz is the leading blockchain for sports and entertainment, designed to power the $50 billion sports fan engagement market. Built as an Ethereum-compatible network, Chiliz offers:
β½ Sports-First Ecosystemβ
- Fan Tokensβ’ native support - Industry-leading fan engagement infrastructure
- 2M+ active sports fans - Direct access to the world's largest web3 sports community
- 100+ sports partnerships - Major clubs and organizations already integrated
π High Performance EVMβ
- Fast finality - Optimized consensus for real-time fan interactions
- Low transaction costs - Affordable microtransactions for fan engagement
- EVM compatibility - Full Ethereum tooling and contract support
π Proven Infrastructureβ
- Battle-tested platform - Powering millions of fan interactions since 2019
- Enterprise-grade security - Institutional infrastructure for major sports brands
- Scalable architecture - Built to handle massive fan engagement events
Quick Start with Chilizβ
Connect to Chiliz in seconds with Dwellir's optimized endpoints:
π RPC Endpoints
https://api-chiliz-mainnet-archive.n.dwellir.com/YOUR_API_KEY
Quick Connect:
curl -X POST https://api-chiliz-mainnet-archive.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
Installation & Setupβ
- Ethers.js v6
- Web3.js
- Viem
- web3.py
import { JsonRpcProvider } from 'ethers';
// Connect to Chiliz mainnet
const provider = new JsonRpcProvider(
'https://api-chiliz-mainnet-archive.n.dwellir.com/YOUR_API_KEY'
);
// Get the latest block
const block = await provider.getBlock('latest');
console.log('Latest block:', block.number);
// Query account balance
const balance = await provider.getBalance('0x...');
console.log('Balance:', balance.toString());
const Web3 = require('web3');
// Connect to Chiliz mainnet
const web3 = new Web3(
'https://api-chiliz-mainnet-archive.n.dwellir.com/YOUR_API_KEY'
);
// Get chain ID to verify connection
const chainId = await web3.eth.getChainId();
console.log('Connected to Chiliz:', chainId === 88888);
// Get gas price for optimal transaction pricing
const gasPrice = await web3.eth.getGasPrice();
console.log('Current gas price:', gasPrice);
import { createPublicClient, http, defineChain } from 'viem';
const chiliz = defineChain({
id: 88888,
name: 'Chiliz',
nativeCurrency: {
decimals: 18,
name: 'CHZ',
symbol: 'CHZ',
},
rpcUrls: {
default: {
http: ['https://api-chiliz-mainnet-archive.n.dwellir.com/YOUR_API_KEY'],
},
},
blockExplorers: {
default: { name: 'ChilizScan', url: 'https://chiliscan.com' },
},
});
// Create Chiliz client
const client = createPublicClient({
chain: chiliz,
transport: http('https://api-chiliz-mainnet-archive.n.dwellir.com/YOUR_API_KEY'),
});
// Read contract data
const data = await client.readContract({
address: '0x...',
abi: contractAbi,
functionName: 'balanceOf',
args: ['0x...'],
});
from web3 import Web3
# Connect to Chiliz mainnet
w3 = Web3(Web3.HTTPProvider('https://api-chiliz-mainnet-archive.n.dwellir.com/YOUR_API_KEY'))
# Verify connection and get chain ID
assert w3.is_connected()
chain_id = w3.eth.chain_id
print(f'Connected to Chiliz: {chain_id == 88888}')
# Get latest block number
block_number = w3.eth.block_number
print(f'Latest block: {block_number}')
Network Informationβ
Chain ID
88888
MainnetTestnet Chain ID
88882
Spicy TestnetGas Token
CHZ
Native tokenRPC Standard
Ethereum
JSON-RPC 2.0JSON-RPC API Referenceβ
Chiliz supports the full Ethereum JSON-RPC API specification. Access all standard methods for seamless EVM integration.
Available JSON-RPC Methods
π Reading Blockchain Data
Query blocks, transactions, and account states
π€ Sending Transactions
Submit and manage transactions
π Smart Contract Interaction
Call and interact with smart contracts
π§ Node & Network Info
Query node status and network information
Ready to build sports dApps on Chiliz?
Get your API key βCommon Integration Patternsβ
π Transaction Monitoringβ
Monitor pending and confirmed transactions efficiently:
// Watch for transaction confirmation
async function waitForTransaction(txHash) {
const receipt = await provider.waitForTransaction(txHash, 1);
// Log transaction success
console.log('Transaction confirmed:', receipt.transactionHash);
console.log('Gas used:', receipt.gasUsed.toString());
return receipt;
}
π° Gas Optimizationβ
Optimize gas costs on Chiliz:
// Estimate gas for optimal transaction pricing
const gasEstimate = await provider.estimateGas(tx);
// Get current gas price
const gasPrice = await provider.getGasPrice();
// Calculate total transaction cost
const totalCost = gasEstimate * gasPrice;
console.log('Estimated cost:', totalCost.toString(), 'CHZ');
π Event Filteringβ
Efficiently query contract events:
// Query events with pagination for large datasets
async function getEvents(contract, eventName, fromBlock = 0) {
const filter = contract.filters[eventName]();
const events = [];
const batchSize = 5000; // Chiliz recommended batch size
for (let i = fromBlock; i <= currentBlock; i += batchSize) {
const batch = await contract.queryFilter(
filter,
i,
Math.min(i + batchSize - 1, currentBlock)
);
events.push(...batch);
}
return events;
}
Performance Best Practicesβ
1. Batch Requestsβ
Combine multiple RPC calls for optimal performance:
const batch = [
{ method: 'eth_blockNumber', params: [] },
{ method: 'eth_gasPrice', params: [] },
{ method: 'eth_getBalance', params: [address, 'latest'] }
];
const results = await provider.send(batch);
2. Connection Poolingβ
Reuse provider instances to minimize connection overhead:
// Singleton pattern for provider
class ChilizProvider {
static instance = null;
static getInstance() {
if (!this.instance) {
this.instance = new JsonRpcProvider(
'https://api-chiliz-mainnet-archive.n.dwellir.com/YOUR_API_KEY'
);
}
return this.instance;
}
}
3. Smart Cachingβ
Cache immutable data to reduce API calls:
const cache = new Map();
async function getCachedBlockData(blockNumber) {
const key = `block_${blockNumber}`;
if (!cache.has(key)) {
const block = await provider.getBlock(blockNumber);
cache.set(key, block);
}
return cache.get(key);
}
Troubleshooting Common Issuesβ
Error: "Wrong Chain ID"β
Ensure you're using the correct chain ID for Chiliz:
// Verify chain connection
const network = await provider.getNetwork();
console.log('Connected to chain ID:', network.chainId);
// Mainnet should return 88888 (0x15b38 in hex)
// Testnet should return 88882 (0x15b32 in hex)
Error: "Insufficient funds for gas"β
CHZ is required for all transactions on Chiliz:
// Check CHZ balance before transaction
const balance = await provider.getBalance(address);
const gasPrice = await provider.getGasPrice();
const gasEstimate = await provider.estimateGas(tx);
const requiredGas = gasPrice * gasEstimate;
if (balance < requiredGas + tx.value) {
throw new Error(`Need ${(requiredGas + tx.value - balance).toString()} more CHZ`);
}
Error: "Rate limit exceeded"β
Implement exponential backoff for resilient applications:
async function callWithRetry(fn, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
try {
return await fn();
} catch (error) {
if (error.code === 429 && i < maxRetries - 1) {
await new Promise(r => setTimeout(r, 2 ** i * 1000));
} else {
throw error;
}
}
}
}
FAQsβ
What makes Chiliz different from other EVM chains?β
Chiliz is purpose-built for sports and entertainment, offering native Fan Token infrastructure and direct access to millions of sports fans worldwide.
Can I use existing Ethereum tools with Chiliz?β
Yes! Chiliz is fully EVM-compatible, so all Ethereum tools, libraries, and smart contracts work seamlessly.
What's the native token on Chiliz?β
CHZ is the native gas token used for all transactions on Chiliz Chain.
How do I get CHZ for testing?β
Use the Spicy Testnet with testnet CHZ from official faucets, or contact Dwellir support for testing assistance.
Smoke Testsβ
Test Mainnet Connectionβ
# Test mainnet connectivity
curl -X POST https://api-chiliz-mainnet-archive.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
Test Testnet Connectionβ
# Test Spicy testnet connectivity
curl -X POST https://api-chiliz-spicy.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
Ethers.js Chain Verificationβ
import { JsonRpcProvider } from 'ethers';
const provider = new JsonRpcProvider(
'https://api-chiliz-mainnet-archive.n.dwellir.com/YOUR_API_KEY'
);
// Verify connection and chain ID
const network = await provider.getNetwork();
console.log('Chain ID:', network.chainId); // Should be 88888
console.log('Block number:', await provider.getBlockNumber());
web3.py Connection Testβ
from web3 import Web3
w3 = Web3(Web3.HTTPProvider('https://api-chiliz-mainnet-archive.n.dwellir.com/YOUR_API_KEY'))
# Verify connection
assert w3.is_connected(), "Failed to connect to Chiliz"
print(f"Chain ID: {w3.eth.chain_id}") # Should be 88888
print(f"Latest block: {w3.eth.block_number}")
Migration Guideβ
From Ethereum Mainnetβ
Moving from Ethereum to Chiliz requires minimal changes:
// Before (Ethereum)
const provider = new JsonRpcProvider('https://eth-rpc.example.com');
// After (Chiliz)
const provider = new JsonRpcProvider(
'https://api-chiliz-mainnet-archive.n.dwellir.com/YOUR_API_KEY'
);
// β
Smart contracts work identically
// β
Same tooling and libraries
// β
Standard EVM opcodes
// β οΈ Different chain ID (88888)
// β οΈ CHZ as gas token instead of ETH
// β οΈ Sports-focused ecosystem
Resources & Toolsβ
Official Resourcesβ
Sports Ecosystemβ
- Socios.com - Fan Token platform
- Fan Token Directory - Available fan tokens
- Sports Partnerships - Partner organizations
Need Help?β
- π§ Email: support@dwellir.com
- π Docs: You're here!
- π― Dashboard: dashboard.dwellir.com
Start building on Chiliz with Dwellir's enterprise-grade RPC infrastructure. Get your API key β