API & RPC Documentation

Everything you need to integrate Sahyadri CSM into your wallet, exchange, explorer, or application. Real-time blockchain data via JSON-RPC, gRPC, and WebSocket subscriptions.

Network Online JSON-RPC + gRPC + WebSocket 31 RPC Methods

Coin Parameters

Essential constants for integrating Sahyadri CSM into exchanges, wallets, and indexers.

ParameterValueDescription
Network NameSahyadri MainnetProduction network
Coin TickerCSMCryptographic Sovereign Money
Address Prefixcsm1s...All addresses start with csm1s
Max Supply21,000,000 CSMHard-capped, no inflation
Decimals81 CSM = 100,000,000 Kana
Block Time~1 secondTarget block interval via DAA
ConsensusProof of Work (DAG)DAG (Directed Acylic Graph)
Mining AlgorithmSahyadriXCustom PoW algorithm
Post-Quantum SecurityDilithium (CRYSTALS-Dilithium)NIST PQC standard for transaction signatures
Treasury SystemOn-chain TreasuryAutomated dev/community funding
gRPC Port26110RPC calls over gRPC
P2P Port26111Peer-to-peer network
WebSocket Port27110JSON-RPC + subscriptions over WS
RPC ProtocolJSON-RPC 2.0Over WebSocket (no REST)

Available RPC Methods (31 total)

RPC Endpoints

For exchanges, wallets, and direct node communication. Use these for deposit/withdrawal integration.

Exchanges (Binance, Bybit, Coinbase, etc.) — connect directly to the RPC endpoint below for deposit confirmation, balance checks, and transaction broadcasting. No additional API key required.

Direct Node RPC Access

JSON-RPC
api.sahyadri.io/rpc
gRPC
api.sahyadri.io:26110
P2P Network
api.sahyadri.io:26111
WebSocket (Notifications)
wss://api.sahyadri.io:27110
P2P (Node-to-Node)
api.sahyadri.io:26111

Available RPC Methods (31 total)

MethodDescriptionUsed By
submitTransactionBroadcast a signed transactionExchanges, Wallets
submitTransactionReplacementReplace a pending transaction (RBF)Exchanges
submitBlockSubmit a mined block to the DAGMiners, Pools
getBlockGet block by hash or blue scoreExplorers, Indexers
getBlocksGet range of blocksExplorers
getBlockCountGet current block count (blue score)All
getBlockTemplateGet mining block templateMiners, Pools
getHeadersGet block headersIndexers, SPV
getInfoNode info: server version, sync status, UTXO indexAll
getSahyadriDagInfoDAG info: block rate, DAA score, difficulty, supplyExplorers, CoinGecko
getCurrentNetworkCurrent network name (mainnet/testnet)All
getCoinSupplyCirculating supply, total supplyCoinGecko, CMC
getSinkCurrent sink blockConsensus
getSinkBlueScoreCurrent sink blue scoreConsensus
getVirtualChainFromBlockGet virtual chain from a blockExplorers
getSubnetworkGet subnetwork infoAll
getBalanceByAddressGet balance for a single addressWallets, Exchanges
getBalancesByAddressesGet balances for multiple addressesExchanges
getUtxosByAddressesGet UTXOs for given addressesWallets, Exchanges
getMempoolEntryGet specific mempool transactionExplorers
getMempoolEntriesGet all current mempool transactionsExplorers
getMempoolEntriesByAddressesGet mempool txs for specific addressesWallets
getPeerAddressesGet all known peer addressesNetwork Monitors
getConnectedPeerInfoGet connected peer detailsNetwork Monitors
addPeerManually add a peerNode Operators
banBan a peer by addressNode Operators
unbanUnban a peer by addressNode Operators
estimateNetworkHashesPerSecondEstimate network hashrateMiners, Explorers
resolveFinalityConflictManually resolve a finality conflictNode Operators
shutdownGracefully shutdown the nodeNode Operators
pingHealth check / connection testAll
JavaScript (WS)
Python (gRPC)
cURL
// Connect to Sahyadri node via WebSocket
const ws = new WebSocket('wss://api.sahyadri.io:27110/ws');

ws.onopen = () => {
  // Call any RPC method
  ws.send(JSON.stringify({
    "id": 1,
    "method": "submitTransaction",
    "params": ["signed_tx_hex_string..."]
  }));
};

ws.onmessage = (event) => {
  const response = JSON.parse(event.data);
  console.log(response);
};

Blocks

Query blocks by hash, blue score, or get block templates for mining.

RPC getBlock

Get a single block by its hash or blue score. Returns full block data including transaction IDs, parent block hashes, and miner reward.

ParameterTypeRequiredDescription
hashstringOptionalBlock hash (hex)
blueScoreintegerOptionalBlock blue score (height)
includeTransactionsbooleanOptionalInclude full transaction data
// Request via JSON-RPC over WebSocket
{
  "id": 1,
  "method": "getBlock",
  "params": [{ "blueScore": 6602, "includeTransactions": true }]
}

// Response
{
  "block": {
    "header": {
      "version": 1,
      "hash": "0bea8500abc...",
      "blueScore": 6602,
      "daaScore": 6598,
      "timestamp": 1710255328,
      "bits": 2072554627,
      "nonce": 4521893761,
      "parentBlockHashes": ["7f3c1200...", "a1e93300..."]
    },
    "transactions": ["8f3a9b2...", "2c1e8d4..."],
    "verboseData": {
      "minerAddress": "csm1sp5fndd452...",
      "reward": "25.00000000"
    }
  }
}
RPC getBlocks

Get a range of blocks between two blue scores. Used by explorers for block listing pages and indexers for syncing.

{
  "id": 2,
  "method": "getBlocks",
  "params": [{
    "lowHash": "block_hash_start...",
    "includeBlocks": true,
    "includeTransactions": false
  }]
}

Transactions

Broadcast transactions and query transaction details. Used by exchanges for deposits and withdrawals.

RPC submitTransaction

Broadcast a signed transaction to the network. Used by exchanges to process withdrawals and by wallets to send funds. Returns the transaction ID on success.

// Broadcast a signed transaction
{
  "id": 1,
  "method": "submitTransaction",
  "params": ["serialized_tx_hex_string..."]
}

// Response
{
  "transactionId": "8f3a9b2c1d..."
}
RPC getMempoolEntry

Get details of a specific transaction from the mempool (pending, not yet in a block). Returns fee, mass, and calculated fee rate.

{
  "id": 3,
  "method": "getMempoolEntry",
  "params": [{ "transactionId": "a1b2c3d4...",
    "includeOrphanPool": true,
    "filterTransactionPool": true }]
}

// Response
{
  "mempoolEntry": {
    "transaction": { "transactionId": "a1b2c3d4...", ... },
    "fee": 100000,
    "isOrphan": false
  }
}

Addresses & Balances

Query UTXOs, balances, and transaction history for wallet addresses. Essential for exchange deposit monitoring.

RPC getBalanceByAddress

Get the total balance of a single Sahyadri address. Used by wallets for balance display and exchanges for deposit verification.

{
  "id": 4,
  "method": "getBalanceByAddress",
  "params": ["csm1sp5fndd452tss097m7dhcyhs5nzlwpp..."]
}

// Response
{
  "balance": "2301100000000"
}
RPC getUtxosByAddresses

Get the full UTXO set for one or more addresses. Each UTXO includes the outpoint (tx ID + index), value, and script public key. Used by exchanges and wallets for coin selection before building transactions.

ParameterTypeRequiredDescription
addressesstring[]RequiredArray of Sahyadri addresses
{
  "id": 5,
  "method": "getUtxosByAddresses",
  "params": [[
    "csm1sp5fndd452...",
    "csm1sar30mvpd..."
  ]]
}

// Response
{
  "entries": [
    {
      "address": "csm1sp5fndd452...",
      "utxoEntries": [
        {
          "outpoint": {
            "transactionId": "8f3a9b2...",
            "index": 0
          },
          "utxoEntry": {
            "amount": 20000000000,
            "scriptPublicKey": "76a914...",
            "blockDaaScore": 6590
          }
        }
      ]
    }
  ]
}

Network & Supply

Node information, network status, coin supply data, and peer management. Used by CoinGecko, CMC, and monitoring tools.

RPC getInfo

Returns comprehensive node information including server version, network ID, sync status, UTXO index availability, and whether the notify command is supported.

{
  "id": 6,
  "method": "getInfo",
  "params": [{}]
}

// Response
{
  "serverVersion": "1.1.0",
  "networkId": "sahyadri-mainnet",
  "hasUtxoIndex": true,
  "isSynced": true,
  "mempoolSize": 23,
  "p2pId": "abc123...",
  "hasNotifyCommand": true,
  "hasMessageId": true
}
RPC getCoinSupply

Returns the current circulating supply and maximum supply. This is the primary endpoint for CoinGecko and CoinMarketCap to poll live supply data for listing.

{
  "id": 7,
  "method": "getCoinSupply",
  "params": [{}]
}

// Response
{
  "circulatingkana": "29145625000000",
  "maxkana": 2100000000000000
}
RPC getSahyadriDagInfo

Returns comprehensive DAG statistics: block count, blue score, DAA score, difficulty, block rate, past median time, and parent median blue score. Used by explorers and mining dashboards.

{
  "id": 8,
  "method": "getSahyadriDagInfo",
  "params": [{}]
}

// Response
{
  "blockCount": 11636,
  "headerCount": 11636,
  "daaScore": 11100,
  "blueScore": 11110,
  "difficulty": 2586428.53,
  "virtualSelectedParentBlueScore": 11108,
  "pastMedianTime": 1710255300,
  "parentMedianBlueScore": 11100,
  "daaScore": 11100
}

Mining

Block template retrieval, block submission, and network hashrate estimation for miners and mining pools.

RPC getBlockTemplate

Get the current block template for mining. Returns the block header template with current DAA score, parent blocks, and mining reward address. Mining pools use this to distribute work to miners.

{
  "id": 9,
  "method": "getBlockTemplate",
  "params": [{
    "payAddress": "csm1sp5fndd452...",
    "extraData": ""
  }]
}

// Response
{
  "block": {
    "header": {
      "version": 1,
      "parentBlockHashes": ["7f3c1200...", "a1e93300..."],
      "hashMerkleRoot": "00000000...",
      "hash": "00000000...",
      "daaScore": 11101,
      "timestamp": 1710255320,
      "bits": 2072554627,
      "nonce": 0
    },
    "isSynced": true
  }
}
RPC estimateNetworkHashesPerSecond

Estimates the current network hashrate based on recent block timestamps and DAA difficulty adjustments. Used by mining dashboards and explorers.

{
  "id": 10,
  "method": "estimateNetworkHashesPerSecond",
  "params": [{ "windowSize": 1000, "startHash": null }]
}

// Response
{
  "networkHashesPerSecond": 12584962340
}

WebSocket Subscriptions

Real-time notifications via WebSocket. Subscribe to chain events for live data feeds in trading bots, monitors, and notification systems.

All subscriptions are over WebSocket. Connect to wss://api.sahyadri.io:27110/ws, then send subscribe/unsubscribe RPC calls. Each subscription has a matching unsubscribe method.

WS subscribeVirtualDaaScoreChanged

Receive a notification every time the virtual DAA score changes. Ideal for mining dashboards that need to track difficulty adjustments in real-time.

// Subscribe
{
  "id": 1,
  "method": "subscribeVirtualDaaScoreChanged",
  "params": [{}]
}

// Notification received
{
  "type": "VirtualDaaScoreChangedNotification",
  "virtualDaaScore": 11101
}
WS subscribeUtxosChanged

Receive notifications when UTXOs change for specified addresses. Pass an array of addresses to watch. Essential for exchange hot wallets and wallet apps to detect incoming deposits in real-time.

// Subscribe to specific addresses
{
  "id": 2,
  "method": "subscribeUtxosChanged",
  "params": [[
    "csm1sp5fndd452...",
    "csm1sar30mvpd..."
  ]]
}

// Notification received
{
  "type": "UtxosChangedNotification",
  "address": "csm1sp5fndd452...",
  "added": [{ "outpoint": {...}, "utxoEntry": {...} }],
  "removed": [{ "outpoint": {...} }]
}
WS subscribeVirtualChainChanged

Receive notifications when the virtual chain changes with new accepted blocks and their transaction IDs. Set includeAcceptedTransactionIds to true for full transaction coverage. Used by explorers and block scanners.

// Subscribe
{
  "id": 3,
  "method": "subscribeVirtualChainChanged",
  "params": [{ "includeAcceptedTransactionIds": true }]
}

// Notification received
{
  "type": "VirtualChainChangedNotification",
  "chainBlocks": [{
    "acceptingBlockHash": "0bea8500...",
    "acceptedTransactionIds": ["8f3a9b2..."]
  }]
}

How to Connect

Step-by-step connection guides for exchanges, wallets, explorers, and data aggregators.

JS JavaScript / Browser WebSocket

Connect from any browser or Node.js environment. All RPC calls go through WebSocket — Sahyadri has no REST endpoint. This is the primary way wallets, explorers, and web apps communicate with the node.

// Connect to Sahyadri RPC via WebSocket
const ws = new WebSocket('wss://api.sahyadri.io:27110/ws');

ws.onopen = () => {
  console.log('Connected to Sahyadri node');

  // Get node info
  ws.send(JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    "method": "getInfo",
    "params": [{}]
  }));

  // Subscribe to new blocks in real-time
  ws.send(JSON.stringify({
    jsonrpc: "2.0",
    id: 2,
    "method": "subscribeVirtualChainChanged",
    "params": [{ "includeAcceptedTransactionIds": true }]
  }));
};

ws.onmessage = (event) => {
  const data = JSON.parse(event.data);

  // Handle subscription notifications
  if (data.type === 'VirtualChainChangedNotification') {
    console.log('New block:', data.chainBlocks);
  }
  // Handle RPC responses
  else {
    console.log('RPC Response:', data);
  }
};
PY Python / gRPC

For high-performance backend integrations, exchanges, and data pipelines. Use the gRPC proto definition from the Sahyadri repository to generate Python stubs, then connect on port 26110.

# pip install grpcio grpcio-tools
# Generate stubs: python -m grpc_tools.protoc -I proto/ proto/rpc.proto --python_out=. --grpc_python_out=.

import grpc
from rpc_pb2 import *
from rpc_pb2_grpc import RPCServiceStub

# Connect to Sahyadri gRPC endpoint
channel = grpc.insecure_channel('api.sahyadri.io:26110')
stub = RPCServiceStub(channel)

# Get node info
response = stub.GetInfo(GetInfoRequest())
print(f"Network: {response.serverVersion}")
print(f"UTXO Index: {response.hasUtxoIndex}")
print(f"Synced: {response.isSynced}")

# Get balance for an address (exchange deposit check)
balance = stub.GetBalanceByAddress(
    GetBalanceByAddressRequest(address="csm1qp5fndd452tss097m7dhcyhs5nzlwpp...")
)
print(f"Balance: {int(balance.balance) / 1e8} CSM")
SH cURL / wscat (Testing)

Quick testing from terminal. Use wscat for interactive WebSocket sessions and cURL for one-shot RPC calls via the HTTP WebSocket upgrade endpoint.

# Install wscat for interactive WebSocket testing
npm install -g wscat

# Connect to Sahyadri node
wscat -c wss://api.sahyadri.io:27110/ws

# Once connected, send RPC calls as JSON:
> {"jsonrpc":"2.0","id":1,"method":"getInfo","params":[{}]}
> {"jsonrpc":"2.0",1,"method":"getCoinSupply","params":[{}]}
> {"jsonrpc":"2.0","id":2,"method":"getBlockTemplate","params":[{"payAddress":"csm1q..."}]}

# Or test with a one-liner (websocat)
echo '{"jsonrpc":"2.0","id":1,"method":"ping"}' | websocat wss://api.sahyadri.io:27110/ws

Exchange Integration (Binance, Bybit, Coinbase, etc.)

Exchanges need: deposit detection, withdrawal broadcasting, and balance monitoring. All done via WebSocket RPC.

Step 1: Detect Deposits
Step 2: Withdraw
Step 3: Balance Check
// 1. Connect WebSocket
const ws = new WebSocket('wss://api.sahyadri.io:27110/ws');

// 2. Subscribe to your hot wallet addresses
ws.onopen = () => {
  ws.send(JSON.stringify({
    "id": 1,
    "method": "subscribeUtxosChanged",
    "params": [[
      "csm1syour_hot_wallet_address...",
      "csm1syour_deposit_address..."
    ]]
  }));
};

// 3. When notification arrives, a deposit was received
ws.onmessage = (event) => {
  const data = JSON.parse(event.data);
  if (data.type === "UtxosChangedNotification") {
    // data.added = new UTXOs (incoming deposit)
    // data.removed = spent UTXOs
    console.log("Deposit detected!", data.added);
    // -> Credit user account in your database
    // -> Wait for confirmations (DAA score)
  }
};

Wallet Integration (Trust Wallet, Mobile, Desktop)

Wallets connect via WebSocket RPC for balance display, transaction building, and broadcast.

Get Chain Info
Get Balance
Send Transaction
// First call: get network info
ws.send(JSON.stringify({
  "id": 1,
  "method": "getInfo",
  "params": [{}]
}));
// Response gives: networkId, serverVersion, isSynced, hasUtxoIndex
// Use this to verify you're on sahyadri-mainnet

Explorer / Dashboard Integration

Explorers need block listing, block details, and real-time new block notifications.

List Blocks
Live New Blocks
Supply Data
// Get latest blocks
ws.send(JSON.stringify({
  "id": 1,
  "method": "getBlocks",
  "params": [{
    "lowHash": null,
    "includeBlocks": true,
    "includeTransactions": false
  }]
}));
// Use getBlockCount first to know the current tip

Mining Pool Integration

Get block templates for miners, submit solutions, and track network hashrate.

Get Work
Submit Block
Network Hashrate
ws.send(JSON.stringify({
  "id": 1,
  "method": "getBlockTemplate",
  "params": [{
    "payAddress": "csm1syour_miner_address...",
    "extraData": "my_pool_id"
  }]
}));
// Response: block header template with parent hashes, bits, DAA score
// Distribute to miners, they find nonce with SahyadriX hash

Testing Tools & Commands

Quick commands to test the RPC endpoint. No setup needed.

wscat (WebSocket)
grpcurl (gRPC)
Browser Console
# Install wscat
npm install -g wscat

# Connect to Sahyadri node
wscat -c "wss://api.sahyadri.io:27110/ws"

# Test: Get node info
> {"id":1,"method":"getInfo","params":[{}]}
# Response: { id:1, result:{ serverVersion:"1.1.0", networkId:"sahyadri-mainnet", ... } }

# Test: Get coin supply
> {"id":2,"method":"getCoinSupply","params":[{}]}
# Response: { id:2, result:{ circulatingkana:"...", maxkana:2100000000000000 } }

# Test: Get DAG info
> {"id":3,"method":"getSahyadriDagInfo","params":[{}]}
# Response: { id:3, result:{ blockCount:..., daaScore:..., blueScore:..., difficulty:... } }

# Test: Ping
> {"id":4,"method":"ping","params":[{}]}
# Response: { id:4, result:"pong" }

Coin Parameters (for listing forms)

ParameterValue
TickerCSM
Networksahyadri-mainnet
Address Prefixcsm1s...
Decimals8 (1 CSM = 100,000,000 kana)
Max Supply21,000,000 CSM
Block Time1 second
ConsensusSahyadri CSM (DAG)
Mining AlgoSahyadriX (Blake3 + 16MB memory)
RPC Endpointwss://api.sahyadri.io:27110/ws
gRPC Endpointapi.sahyadri.io:26110
Explorerhttps://explorer.sahyadri.io

Live API Tester

Test any RPC method directly from the browser. No tools needed.

// Select a method above and click "Send Request"
// Response will appear here

Rate Limits & Errors

Fair usage limits to ensure stability for all users.

50
WebSocket Connections
Unlimited
RPC Calls (Direct Node)
No Auth
API Key Required
JSON-RPC
Transport Protocol

HTTP Response Codes

200 Success — request completed
400 Bad Request — invalid parameters or malformed request
404 Not Found — block, transaction, or address does not exist
429 Too Many Requests — rate limit exceeded. Retry after cooldown.
500 Internal Server Error — something went wrong on our end
503 Service Unavailable — node is syncing or temporarily down