Skip to content
Testnet

Build

Public testnet APIs

Everything below is free and needs no account. The JSON-RPC proxy and the explorer API send Access-Control-Allow-Origin: *, so you can call them straight from a web page, as this portal does for its live figures.

JSON-RPC

Public RPC proxy

A full node behind neurai-rpc-proxy: POST a JSON-RPC request, no credentials. Only whitelisted methods pass; wallet and node-control methods are blocked. The node keeps the address and spent indexes, so balance, UTXO and history queries work.

CORS *
Endpoint https://rpc-testnet.neurai.org/rpc
DePIN endpoint https://rpc-testnet-depin.neurai.org/rpc used by Neurai Sign
WhitelistGET /whitelist lists the allowed methods
SettingsGET /settings
LimitsDePIN calls: 60 per minute per IP, with a temporary ban above that.
Shell
curl -s -X POST https://rpc-testnet.neurai.org/rpc \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"1.0","id":1,"method":"getblockchaininfo","params":[]}'
neurai-rpc
import { getRPC, methods } from "@neuraiproject/neurai-rpc";

// The public proxy ignores the credentials.
const rpc = getRPC("anonymous", "anonymous", "https://rpc-testnet.neurai.org/rpc");
const height = await rpc(methods.getblockcount, []);
JavaScript (fetch)
async function rpc(method, params = []) {
  const res = await fetch("https://rpc-testnet.neurai.org/rpc", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ jsonrpc: "1.0", id: 1, method, params }),
  });
  const { result, error } = await res.json();
  if (error) throw new Error(JSON.stringify(error));
  return result;
}

// Make sure you are on the reset testnet before anything else.
const genesis = await rpc("getblockhash", [0]);
if (genesis !== "0000008b384aeffecdab182575dc4e86c9f07f90318c65088532660ed9a8a021") throw new Error("Wrong chain");

const utxos = await rpc("getaddressutxos", [{ addresses: ["tDjYjjNMUiEfSKxSWB5RhgNqFWHCzdGtf3"] }]);

Allowed methods (65)

Blockchain

  • getblockchaininfo
  • getblockcount
  • getbestblockhash
  • getblockhash
  • getblockheader
  • getblock
  • decodeblock
  • getchaintips
  • getchaintxstats
  • getdifficulty
  • gettxout
  • gettxoutproof
  • getspentinfo

Mempool

  • getmempoolinfo
  • getrawmempool
  • getmempoolentry
  • getmempoolancestors
  • getmempooldescendants

Address index

  • getaddressbalance
  • getaddressdeltas
  • getaddressmempool
  • getaddresstxids
  • getaddressutxos

Transactions

  • createrawtransaction
  • decoderawtransaction
  • decodescript
  • combinerawtransaction
  • getrawtransaction
  • sendrawtransaction
  • signrawtransaction
  • testmempoolaccept
  • estimatefee
  • estimatesmartfee

Assets

  • getassetdata
  • listassets
  • listaddressesbyasset
  • listassetbalancesbyaddress
  • checkaddressrestriction
  • checkaddresstag
  • checkglobalrestriction
  • getverifierstring
  • isvalidverifierstring
  • listaddressesfortag
  • listaddressrestrictions
  • listglobalrestrictions
  • listtagsforaddress

DePIN

  • checkdepinvalidity
  • listdepinholders
  • listdepinaddresses
  • depinchallenge
  • depinsubmitmsg
  • depinreceivemsg
  • depingetmsginfo
  • depinlistsections
  • depinclearmsg
  • depingetancestorrecipients
  • depinpoolstats
  • depinmcpstatus

Utility

  • validateaddress
  • verifymessage
  • signmessagewithprivkey
  • getpubkey
  • getnetworkinfo
  • getnetworkhashps
  • help

Keep keys local

signmessagewithprivkey and signrawtransaction are on the list, but they send your private key to a server you do not control. Sign locally with neurai-sign-transaction or neurai-message and use the proxy only to read and to broadcast.

REST

Explorer API

Rebel Explorer's JSON endpoints. GET only, paginated lists, amounts as strings.

CORS *
PathReturns
/api/stats Height, supply, difficulty, hashrate, average block time, mempool.
/api/chain Chain summary.
/api/bestblock The tip.
/api/recent Recent blocks and transactions.
/api/mempool Transactions waiting for a block.
/api/blocks Latest blocks.
/api/blocks/:id A block by height or hash.
/api/blocks/:id/txs Transactions of a block.
/api/blockheader/:height A block header.
/api/transactions/:txid A transaction, decoded.
/api/addresses/:address Balance, address family and assets.
/api/addresses/:address/history Transaction history.
/api/addresses/:address/utxos Unspent outputs.
/api/addressdeltas/:address Raw balance changes.
/api/assets Asset list.
/api/assets/:name One asset.
/api/assets/:name/holders Holders of an asset.
/api/assetdata/:name Asset metadata from the node.
/gettype/:value Tells whether a value is a block, transaction, address or asset.
Shell
curl -s https://rebel-explorer-testnet.neurai.org/api/addresses/tDjYjjNMUiEfSKxSWB5RhgNqFWHCzdGtf3

REST

Faucet API

GET /api/info and POST /api/claim at https://faucet-testnet.neurai.org. No CORS headers: call it from a server or the shell. A claim needs a captcha token or a Neurai Connect ticket.

Faucet details

WebSocket

Neurai Connect relay

Carries encrypted messages between a website and a wallet, so users sign in or approve a signature by scanning a QR. The relay is network-agnostic and needs no API key. Use it through @neuraiproject/neurai-connect.

WebSocket wss://relay.neurai.org/v1
StatusGET /info · GET /health

WebSocket

Wallet push service

neurai-wallet-services keeps a socket open per wallet and pushes events instead of making the wallet poll: new tip, reorgs, and changes on subscribed addresses. It needs an access token, sent as the WebSocket subprotocol auth.<token>; ask the Neurai team on Discord for one.

Endpoint wss://wallet-testnet-wss.neurai.org/push
Callshello, ping, address.subscribe, address.unsubscribe, address.get_state, tx.broadcast, depin.*
Eventschain.tip, chain.reorg, address.changed, node.synced, node.syncing
JavaScript
const ws = new WebSocket("wss://wallet-testnet-wss.neurai.org/push", ["wss", "auth." + token]);

ws.onopen = () => {
  ws.send(JSON.stringify({ id: 1, method: "hello",
    params: { client: "my-app", version: "1.0.0", network: "testnet", protocol: "wss/2" } }));
  ws.send(JSON.stringify({ id: 2, method: "address.subscribe", params: { address } }));
};
ws.onmessage = (event) => console.log(JSON.parse(event.data)); // chain.tip, address.changed…

Self-hosted

Electrum server

There is no public Electrum server for testnet. electrs-neurai runs against your own testnet node and listens on port 60001, with Neurai extensions such as blockchain.asset.get_meta and blockchain.asset.get_history.