Send Your First Request

Quickly send your first request to Shinami's Node Service

Introduction

1. Create a Shinami account

You’ll need a Shinami account to follow this quick-start guide.

2. Create an API Access Key

To use Shinami's products, you’ll need an API access key to authenticate your requests. Set up a Node Access key for Testnet as shown here in our Authentication and API Keys guide

3. Make a request!

Here is an example sui_getTotalTransactionBlocks request that returns the total number of transactions known to the node.

Example Request

The TypeScript example uses our Shinami Clients SDK and the Rust example uses the Mysten Rust SDK .

Replace all instances of {{name}} with the actual value for that name

curl https://api.shinami.com/node/v1 \
-X POST \
-H 'X-API-Key: {{nodeServiceAccessKey}}' \
-H 'Content-Type: application/json' \
-d '{ 
        "jsonrpc": "2.0", 
        "method": "sui_getTotalTransactionBlocks", 
        "params": [], 
        "id": 1
    }' | json_pp
import { createSuiClient } from "@shinami/clients";

const nodeClient = createSuiClient({{nodeServiceAccessKey}});

await nodeClient.getTotalTransactionBlocks();
use sui_sdk::SuiClientBuilder;

#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {

    let sui = SuiClientBuilder::default()
        .ws_url("wss://api.shinami.com:443/node/v1/{{nodeServiceAccessKey}}")
        .build("https://api.shinami.com:443/node/v1/{{nodeServiceAccessKey}}")
        .await?;

    let resp = sui.read_api().get_total_transaction_blocks().await?;
    println!("{}", resp);

    Ok(())
}

Example Response

{
   "id" : 1,
   "jsonrpc" : "2.0",
   "result" : "971804907"
}
971804747n
1000994152

Response Data

  • BigInt<u64>: total number of transactions on the network known by the node you queried.

Next steps to build on Sui! 🏗