Node RPC Service
How to issue the API Key for accessing the Node RPC endpoint
-
Navigate to the RPC endpoints page: https://portal.scs.startale.com/node-rpc
-
Click the Create New Endpoint button.
-
Configure the settings for the endpoint you want to create:
- First, select a Chain from the Select a Chain dropdown.
- Next, choose the desired Network.
- Add a name for the endpoint and an optional description to describe its purpose.
-
Click the
Create endpoint
button. Your new RPC endpoint has now been successfully created! -
The new created endpoint will be visible in the table like this:
How to test the API Endpoints
- Check your API Key.
The API Key can be accessed from both the RPC endpoints page and the Detail page.
Checking from the RPC endpoints page
- On the RPC endpoints page, click on the
Copy API Key
button to save the key on your clipboard.
Checking from the Detail Page
-
From the RPC endpoints page, click on your endpoint to navigate to the detail page.
-
On the Detail page, click the
Copy API Key
button to save the key on your clipboard. -
Click on the
Configure
button to view the HTTPS & WSS endpoints.
Executing the Node RPC Endpoint with TypeScript
- As an example, execute the Soneium Minato Node RPC endpoint:
index.ts
const API_URL = "https://soneium-minato.rpc.scs.startale.com"; // If Astar or AstarZK is used, this should also be changed.
const API_KEY = "YOUR_API_KEY"; // // Replace with your Node RPC API Key.
// RPC request payload
const payload = {
id: 1,
jsonrpc: "2.0",
method: "eth_blockNumber",
};
async function getBlockNumber() {
const response = await fetch(`${API_URL}?apikey=${API_KEY}`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload),
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const data = await response.json();
console.log(`Latest block number: ${parseInt(data.result, 16)}`);
}
// Execute the function
getBlockNumber();
- Run it using Node.js.
npx tsc index.ts
node index.ts
- The console should display the latest block number.
Latest block number: 4745445
- Congratulations!
You have successfully sent your first request to the SCS Node RPC API endpoint.
How to check the status
- On the RPC endpoints page, click the Detail button for the desired endpoint to navigate to Detail page.
- You can view the endpoint's statistics on the endpoint page under
usage
tab.
Find out more about the API
Updated 28 days ago