rpc_methods - JSON-RPC Method
Description#
Returns a comprehensive list of all JSON-RPC methods available on the connected Acala node. This introspection capability allows applications to discover which RPC endpoints are supported by the node, including standard Substrate methods and any custom or experimental methods specific to the Acala runtime or node implementation. The method is particularly valuable for building adaptive clients that adjust their functionality based on available APIs, debugging connectivity issues, or validating that required methods are accessible before attempting operations. Different node configurations (full, archive, or light) may expose different method sets.
Request Example#
curl -s https://api-acala.n.dwellir.com/YOUR_API_KEY -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"rpc_methods","params":[]}'
Parameters#
This method takes no parameters and immediately returns the complete list of available RPC methods.
Response Format#
Returns an array of method name strings representing all available RPC endpoints. Standard Substrate chains typically expose several hundred methods across multiple namespaces. The response includes version information indicating which RPC API version is implemented.
Available Method Namespaces#
Acala exposes standard Substrate method namespaces:
- system_*: Node system information (version, properties, health, peers)
- state_*: State queries and storage access (metadata, runtime version, storage reads)
- chain_*: Block and chain data retrieval (blocks, headers, subscriptions)
- author_*: Transaction submission and pool management (submit, watch, pending)
- payment_*: Fee estimation and payment information queries
- childstate_*: Child trie storage queries for parachain data structures
- offchain_*: Offchain worker and storage access methods
Additional Acala-specific methods may be available for DeFi-specific operations.
Use Cases#
- Client Initialization: Verify required methods are available before initializing application features
- Feature Detection: Enable or disable UI features based on method availability
- API Version Checking: Ensure compatibility between client expectations and node capabilities
- Debugging: Diagnose connectivity or configuration issues by confirming method accessibility
- Documentation Generation: Automatically generate client documentation based on available methods
- Testing: Validate that test environments expose the expected API surface
Best Practices#
Call this method during application initialization to cache the list of available methods. Use the cached list to implement graceful degradation when optional methods are unavailable. For production applications, avoid calling this method repeatedly, as the method list rarely changes except during node upgrades. When interacting with public RPC endpoints, be aware that some providers may disable certain methods (especially author_* methods for write operations) for security or resource reasons.
Response Analysis#
Parse the returned method array to categorize methods by namespace prefix. Standard naming conventions use underscore-separated namespace and method name (e.g., state_getMetadata, chain_getBlock). Methods without namespace prefixes are typically JSON-RPC meta-methods like rpc_methods itself. Compare the available methods against your application's requirements to detect missing functionality early in the initialization process.
Related Methods#
system_properties- Get chain-specific properties and constantsstate_getRuntimeVersion- Get runtime version informationsystem_version- Get node implementation version