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.
Coin Parameters
Essential constants for integrating Sahyadri CSM into exchanges, wallets, and indexers.
| Parameter | Value | Description |
|---|---|---|
Network Name | Sahyadri Mainnet | Production network |
Coin Ticker | CSM | Cryptographic Sovereign Money |
Address Prefix | csm1s... | All addresses start with csm1s |
Max Supply | 21,000,000 CSM | Hard-capped, no inflation |
Decimals | 8 | 1 CSM = 100,000,000 Kana |
Block Time | ~1 second | Target block interval via DAA |
Consensus | Proof of Work (DAG) | DAG (Directed Acylic Graph) |
Mining Algorithm | SahyadriX | Custom PoW algorithm |
Post-Quantum Security | Dilithium (CRYSTALS-Dilithium) | NIST PQC standard for transaction signatures |
Treasury System | On-chain Treasury | Automated dev/community funding |
gRPC Port | 26110 | RPC calls over gRPC |
P2P Port | 26111 | Peer-to-peer network |
WebSocket Port | 27110 | JSON-RPC + subscriptions over WS |
RPC Protocol | JSON-RPC 2.0 | Over WebSocket (no REST) |
Available RPC Methods (31 total)
RPC Endpoints
For exchanges, wallets, and direct node communication. Use these for deposit/withdrawal integration.
Direct Node RPC Access
Available RPC Methods (31 total)
| Method | Description | Used By |
|---|---|---|
submitTransaction | Broadcast a signed transaction | Exchanges, Wallets |
submitTransactionReplacement | Replace a pending transaction (RBF) | Exchanges |
submitBlock | Submit a mined block to the DAG | Miners, Pools |
getBlock | Get block by hash or blue score | Explorers, Indexers |
getBlocks | Get range of blocks | Explorers |
getBlockCount | Get current block count (blue score) | All |
getBlockTemplate | Get mining block template | Miners, Pools |
getHeaders | Get block headers | Indexers, SPV |
getInfo | Node info: server version, sync status, UTXO index | All |
getSahyadriDagInfo | DAG info: block rate, DAA score, difficulty, supply | Explorers, CoinGecko |
getCurrentNetwork | Current network name (mainnet/testnet) | All |
getCoinSupply | Circulating supply, total supply | CoinGecko, CMC |
getSink | Current sink block | Consensus |
getSinkBlueScore | Current sink blue score | Consensus |
getVirtualChainFromBlock | Get virtual chain from a block | Explorers |
getSubnetwork | Get subnetwork info | All |
getBalanceByAddress | Get balance for a single address | Wallets, Exchanges |
getBalancesByAddresses | Get balances for multiple addresses | Exchanges |
getUtxosByAddresses | Get UTXOs for given addresses | Wallets, Exchanges |
getMempoolEntry | Get specific mempool transaction | Explorers |
getMempoolEntries | Get all current mempool transactions | Explorers |
getMempoolEntriesByAddresses | Get mempool txs for specific addresses | Wallets |
getPeerAddresses | Get all known peer addresses | Network Monitors |
getConnectedPeerInfo | Get connected peer details | Network Monitors |
addPeer | Manually add a peer | Node Operators |
ban | Ban a peer by address | Node Operators |
unban | Unban a peer by address | Node Operators |
estimateNetworkHashesPerSecond | Estimate network hashrate | Miners, Explorers |
resolveFinalityConflict | Manually resolve a finality conflict | Node Operators |
shutdown | Gracefully shutdown the node | Node Operators |
ping | Health check / connection test | All |
// 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.
Get a single block by its hash or blue score. Returns full block data including transaction IDs, parent block hashes, and miner reward.
| Parameter | Type | Required | Description |
|---|---|---|---|
hash | string | Optional | Block hash (hex) |
blueScore | integer | Optional | Block blue score (height) |
includeTransactions | boolean | Optional | Include 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" } } }
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.
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..." }
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.
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"
}
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.
| Parameter | Type | Required | Description |
|---|---|---|---|
addresses | string[] | Required | Array 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.
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
}
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
}
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.
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
}
}
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.
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 }
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": {...} }] }
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.
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); } };
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")
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.
// 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.
// 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.
// 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.
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.
# 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)
| Parameter | Value |
|---|---|
Ticker | CSM |
Network | sahyadri-mainnet |
Address Prefix | csm1s... |
Decimals | 8 (1 CSM = 100,000,000 kana) |
Max Supply | 21,000,000 CSM |
Block Time | 1 second |
Consensus | Sahyadri CSM (DAG) |
Mining Algo | SahyadriX (Blake3 + 16MB memory) |
RPC Endpoint | wss://api.sahyadri.io:27110/ws |
gRPC Endpoint | api.sahyadri.io:26110 |
Explorer | https://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.