Getting Started with the RPC API
The RPC API provides a seamless and intuitive web interface for developers to interact with Rootstock nodes via JSON-RPC methods. It aims to address the challenges faced by developers when trying to access critical information like logs, transactions, and balances through RPC, which can significantly impact the timely development of dApps on the Rootstock blockchain.
In this guide, you will learn:
- How to create an account and make your first API call
- View a list of JSON-RPC methods available.
Who is it for?
- dApp Developers looking to interact with the Rootstock nodes
Features
Easy Setup:
- Create an API key effortlessly to initiate development.
- Make the First API call in minutes.
API Key Authentication:
- Provides secure authentication for decentralized applications (dApps).
- Limits API requests on a daily or monthly basis.
Getting Started
The RPC API is available on TESTNET and MAINNET.
Visit the Rootstock RPC API
Get a FREE account
To create an account, click on Sign up
Get an API Key
To get an API key:
Log in to the dashboard, and click on New API key:
Choose a name to identify your apikey
, and the Network (either Testnet
or Mainnet
). You can also add a description (optional). Click on Create.
Make first API Call
Click on the newly created apikey
to get the details:
You can make your first api call by using one of the provided examples, or simply by adding a url and apikey
to your application.
Example Request
curl --location --request POST 'https://rpc.testnet.rootstock.io/<your-apikey>' \
--header 'Content-Type: application/json' \
--data ' {
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 0
}'
Response:
{"jsonrpc":"2.0","id":0,"result":"0x4b7eca"}
The daily limit is 25,000 requests per user, and each user can have up to 4 API keys, which allows an easy differentiation for different applications the user wants to test.
Get Support
Join the Rootstock Discord to get support or give feedback.