Node RPC Service

How to issue the API Key for accessing the Node RPC endpoint

  1. Go to the RPC endpoints page
  1. Click the Create new RPC endpoint button.
  2. Configure the settings for the endpoint you want to create:
    1. First, select a Chain from the Select a Chain dropdown.
    2. Next, choose the desired Network.
    3. Add a name for the endpoint and an optional description to describe its purpose.
  1. Click the Create new RPC endpoint button to finalize the setup. Your new RPC endpoint has now been successfully created!

How to test the API Endpoints

  • First, 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 the API Key button to view the API Key.

Checking from the Detail Page

  1. From the RPC endpoints page, click the Detail button to navigate to the Detail page.
  1. On the Detail page, click the Your endpoint button, highlighted by the red frame in the image.
  1. The API Key will be displayed for confirmation.

Executing the Node RPC Endpoint with TypeScript

  1. As an example, execute the Soneium Minato Node RPC endpoint:
    1. 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();
  1. Run it using Node.js.
npx tsc index.ts

node index.ts
  1. The console should display the latest block number.
Latest block number: 4745445
  1. Congratulations!
    You have successfully sent your first request to the SCS Node RPC API Endpoint.

How to check the status

  1. On the RPC endpoints page, click the Detail button for the desired endpoint to navigate to the Detail page.
  2. You can view the endpoint's current status on this page.

How to find out more about the API?

https://docs.startale.com/reference/eth-accounts-soneium