Start here
Developer resources
Run a node
Validate the chain yourself and serve your own wallet, miner, and RPC clients.
Learn moreJSON-RPC
A bearer-token-authenticated API for chain, mempool, mining, network, and node data.
Learn moreSDKs
Rust and TypeScript clients held to frozen fixtures generated from a real node.
Learn moreExplorer API
A token-free, read-only API for public chain data, served by the explorer indexer.
Learn morePayments
Invoices, confirmation tiers, and signed webhooks for accepting CLKC.
Learn moreWeb3
Clanker Coin’s role in Web3 applications: payments, invoices, and data APIs.
Learn moreGitHub
Source, releases, and issue tracking for every public repository.
Wiki
Protocol documentation written for people, alongside the specifications.
JSON-RPC
JSON-RPC 2.0 over HTTP
Every node serves JSON-RPC 2.0 over HTTP on its RPC port. Requests must include a bearer token, read by default from a local cookie file thatclankerd writes at startup. The RPC port should never be exposed to the public internet; anything meant for public consumption belongs behind the explorer API instead.
- Amounts are decimal strings, not numbers: the supply cap exceeds JavaScript's safe integer range.
- Hashes and ids are lowercase hex.
- Every response names the network it answered from.
- Paginated methods cap the page size the server will return.
Example
Request:
POST /
Authorization: Bearer <token>
Content-Type: application/json
{"jsonrpc":"2.0","id":1,"method":"chain.getBestBlock"}Response:
{"jsonrpc":"2.0","id":1,"result":{"block_id":"…","chain_work":"…","height":241,"network":"mainnet","timestamp":1788314430}}Public methods
The following methods are documented for public use. Administrative and control methods are intentionally not published here.
| Method | Description |
|---|---|
| chain.getInfo | Chain height, network, best block id, and chain work. |
| chain.getBestBlock | The current tip block. |
| chain.getBlock | A block by id. Verbosity 0 returns raw hex, verbosity 1 returns a decoded block. |
| chain.getBlockByHeight | A block by height. Verbosity 0 returns raw hex, verbosity 1 returns a decoded block. |
| chain.getHeader | A block header only, without its transactions. |
| chain.getBlockHashes | Block ids in a height range, paginated by start_height and count. |
| chain.getTransaction | A transaction by txid, with an optional block_id hint to speed up the lookup. |
| chain.getUtxo | An unspent transaction output, if it still exists. |
| chain.getAddressOutputs | Outputs paid to an address, when the address index is enabled. |
| mempool.getInfo | Mempool size, byte total, and current relay policy. |
| mempool.getTransaction | A pending transaction by txid. |
| mempool.getFeeEstimate | Provisional fee-rate percentiles derived from the current mempool. |
| mempool.sendRawTransaction | Broadcasts a signed raw transaction to the network. |
| mining.getBlockTemplate | A header prefix and candidate transaction set, the basis for Clanker Stratum jobs. |
| mining.getMiningInfo | Current difficulty, target, and the node’s network hash estimate. |
| mining.submitBlock | Submits a mined block; answers connected, side_chain, reorganized, or already_known. |
| network.getInfo | The local node’s network identity and listening configuration. |
| network.getPeers | Currently connected peers. |
| network.listBans | Currently banned peer addresses. |
| node.getInfo | Node software version and uptime. |
| node.getMetrics | Node metrics, the same figures served at GET /metrics. |
Health and metrics
Alongside JSON-RPC, every node serves GET /health, GET /ready, and GET /metrics in Prometheus text format, none of which require a token.
SDKs
Rust and TypeScript clients
clanker-sdk is the Rust crate; @clankercoin/sdk is the TypeScript equivalent, published as plain ES modules with.d.ts type declarations, no build step, and no runtime dependencies. In both, every amount is represented as a big integer type, so an amount can never silently lose precision.
Both SDKs are held to frozen fixtures generated from a real node, so a client that passes the test suite has been checked against real chain data.
A generic example, reading status from the explorer API and printing a balance without ever touching a float:
import { ExplorerClient } from '@clankercoin/sdk';
// The public explorer's origin is published with the testnet.
const client = new ExplorerClient({ url: 'https://EXPLORER-HOST', network: 'testnet' });
const status = await client.status();
console.log(`indexed height: ${status.syncedHeight}`);
const account = await client.address('clank1q...');
const clanks: bigint = account.balance; // every amount is a bigint, never a float
const whole = clanks / 100_000_000n;
const frac = (clanks % 100_000_000n).toString().padStart(8, '0');
console.log(`${whole}.${frac} CLKC`);Explorer API
The public, token-free read API
The explorer indexer serves a read-only API with no authentication required, meant for anything that only needs public chain data. Amounts are decimal strings, pages are capped, and errors are returned as {"error", "network"}.
| Endpoint | Description |
|---|---|
| GET /api/v1/status | Indexer chain height, network, and sync state. |
| GET /api/v1/blocks?before=&limit= | A page of recent blocks, cursor-paginated. |
| GET /api/v1/blocks/<height or id> | A single block by height or block id. |
| GET /api/v1/transactions/<txid> | A single transaction by id. |
| GET /api/v1/addresses/<address> | Balance and summary for an address. |
| GET /api/v1/addresses/<address>/outputs?cursor=&limit=&unspent= | An address’s outputs, optionally restricted to unspent ones. |
| GET /api/v1/search?q= | Resolves a query to a block, transaction, or address. |
| GET /api/v1/mempool | A summary of the current mempool. |
This website's /api/stats
This site also serves its own read-only /api/stats JSON document, composed from the explorer API and a public node's metrics. Its top-level members are:
chain— height, best block id, and chain totals.window— hashrate and difficulty estimated over a recent block window.reward— the current subsidy, era, and the next halving height.supply— issued and maximum supply.mempool— pending transaction count and byte total.nodes— a count of nodes known to the network, where available.price— a market price quote, when a price source is configured.recentBlocks— the most recent blocks in summary form.sources— which upstream sources answered when the document was composed.
Payments
Accept CLKC
Invoices, confirmation tiers by amount, and HMAC-signed webhooks for merchants.
Web3
Build Web3 applications
Payments, payment requests, and blockchain data APIs. No smart contracts in v1.