rpc_methods - Kusama RPC Method
List all available RPC methods on Kusama. Essential for API discovery, capability detection, and building dynamic tooling for Substrate-based chains.
Returns a list of all RPC methods exposed by the Kusama node. This is the definitive way to discover what methods are available on a given endpoint, including both standard Substrate methods and any custom chain-specific extensions.
Why Kusama? Build on Polkadot's canary network for real-world testing with live economic conditions with 7-day governance cycles (vs 1 month on Polkadot), lower bonding requirements, live KSM token economy, and first-to-market feature testing.
When to Use This Method
rpc_methods is essential for experimental dApp developers, parachain teams, and early adopters validating new features:
- API Discovery -- Enumerate all available RPC methods to understand the full capabilities of a Kusama node
- Capability Detection -- Check whether a specific method (e.g.,
author_submitExtrinsic,state_call) is available before calling it - Compatibility Testing -- Verify that an endpoint supports the methods your application requires for parachain experimentation, early feature deployment, and production-grade testing with real value
- Tooling and Documentation -- Auto-generate API references or client SDKs from the available method list
Code Examples
Common Use Cases
1. Endpoint Capability Validation
Check whether a Kusama endpoint supports all methods your application needs:
async function validateEndpoint(endpoint, requiredMethods) {
const response = await fetch(endpoint, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
method: 'rpc_methods',
params: [],
id: 1
})
});
const { result } = await response.json();
const available = new Set(result.methods);
const missing = requiredMethods.filter((m) => !available.has(m));
if (missing.length > 0) {
console.error('Missing required methods:', missing);
return false;
}
console.log('Endpoint supports all required methods');
return true;
}
// Usage
await validateEndpoint('https://kusama-rpc.n.dwellir.com', [
'state_getStorage',
'state_call',
'author_submitExtrinsic',
'payment_queryInfo'
]);2. Method Category Breakdown
Organize available methods by their RPC namespace:
async function getMethodsByCategory(api) {
const methods = await api.rpc.rpc.methods();
const categories = {};
methods.methods.forEach((method) => {
const name = method.toString();
const category = name.split('_')[0];
categories[category] = categories[category] || [];
categories[category].push(name);
});
for (const [category, methodList] of Object.entries(categories)) {
console.log(`\n${category} (${methodList.length} methods):`);
methodList.forEach((m) => console.log(` - ${m}`));
}
return categories;
}3. Compare Endpoints
Detect differences between two Kusama endpoints:
async function compareEndpoints(endpoint1, endpoint2) {
const fetchMethods = async (url) => {
const res = await fetch(url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ jsonrpc: '2.0', method: 'rpc_methods', params: [], id: 1 })
});
const { result } = await res.json();
return new Set(result.methods);
};
const [methods1, methods2] = await Promise.all([
fetchMethods(endpoint1),
fetchMethods(endpoint2)
]);
const onlyIn1 = [...methods1].filter((m) => !methods2.has(m));
const onlyIn2 = [...methods2].filter((m) => !methods1.has(m));
if (onlyIn1.length) console.log('Only in endpoint 1:', onlyIn1);
if (onlyIn2.length) console.log('Only in endpoint 2:', onlyIn2);
if (!onlyIn1.length && !onlyIn2.length) console.log('Endpoints have identical methods');
}Error Handling
Common errors and solutions:
| Error Code | Description | Solution |
|---|---|---|
| -32603 | Internal error | Node may be starting up -- retry after delay |
| HTTP 429 / -32029 | Rate limit exceeded | Cache the method list since it rarely changes at runtime and back off before retrying |
| Connection refused | Node unreachable | Verify the RPC endpoint URL and that the node is running |
Related Methods
system_chain-- Get the chain namesystem_name-- Get the node implementation namesystem_version-- Get the node implementation versionstate_getMetadata-- Get full runtime metadata including pallet and call definitions
beefy_getFinalizedHead
Get the BEEFY finalized block hash on Kusama. Bridge-optimized finality proofs for cross-chain communication and light client verification on Polkadot's canary network for real-world testing with live economic conditions.
Linea - zkEVM Layer 2 Documentation
Complete guide to Linea zkEVM integration with Dwellir RPC. Learn how to build on Linea's zero-knowledge rollup, access JSON-RPC methods, and optimize your dApp performance.