Skip to main content

/api/chain/*

Core blockchain endpoints — blocks, transactions, accounts, search.

POST /api/chain/tx

Submit a signed transaction to mempool. Returns immediately after mempool acceptance; broadcast to P2P is asynchronous.

curl -X POST https://api.ombra-net.com/api/chain/tx \
-H "Content-Type: application/json" \
-d @signed-tx.json

Response 200: { "ok": true, "hash": "<tx hash>" } Errors: 400 invalid JSON · 422 signature/nonce invalid · 409 duplicate


GET /api/chain/stats

Live chain stats.

curl https://api.ombra-net.com/api/chain/stats

Response:

{
"height": 62512,
"latestBlockHash": "8592559f...",
"totalMiners": 14,
"recentTxCount": 51,
"recentRewards": "80000",
"activeProposers": 1,
"p2pPeers": 1
}

GET /api/chain/height

Just height + latest block summary.

curl https://api.ombra-net.com/api/chain/height

Response:

{ "height": 62512, "latestBlock": { "index": 62512, "hash": "...", "timestamp": 1735389942000 } }

GET /api/chain/block/:index

Full block including all transactions.

curl https://api.ombra-net.com/api/chain/block/62512

Response:

{
"index": 62512,
"hash": "8592559f...",
"previousHash": "...",
"timestamp": 1735389942000,
"proposer": "7a8b7038...",
"transactions": [
{ "type": "BURN", "from": "...", "amount": "10", ... }
]
}

Errors: 404 if index > height or < 0.


GET /api/chain/blocks?limit=N&offset=N

Paginated block summaries (newest first). limit ≤ 100, default 30.

curl 'https://api.ombra-net.com/api/chain/blocks?limit=50&offset=0'

Response:

{
"blocks": [{ "index": 62512, "hash": "...", "txCount": 1, "timestamp": ... }],
"total": 62512
}

GET /api/chain/blocks-full?from=X&to=Y

Bulk download blocks [from, to]. Range ≤ 500 blocks.

curl 'https://api.ombra-net.com/api/chain/blocks-full?from=62000&to=62500'

GET /api/chain/tx/:hash

Lookup tx by hash.

curl https://api.ombra-net.com/api/chain/tx/95df4a159056a7c47e1e642633efaf50c21ab33e4d2c0c2c056103d498bab4da

Response: the full tx + blockIndex + timestamp.


GET /api/chain/account/:address

Account state — balance, nonce, miner status, recent 50 txs.

curl https://api.ombra-net.com/api/chain/account/7a8b70389a52a96aa85ca641c5ad2fb7a1e2e1ca

Response:

{
"address": "7a8b7038...",
"balance": "1234567",
"nonce": 5,
"isMiner": true,
"miner": { "id": "...", "name": "OmbraNet Main", "reputationScore": 92, ... },
"recentTxs": [{ "type": "TRANSFER", "amount": "1000000", ... }]
}

GET /api/chain/search/:q

Search for blocks (by index/hash), txs (by hash), addresses.

curl https://api.ombra-net.com/api/chain/search/7a8b7038
# matches account
curl https://api.ombra-net.com/api/chain/search/62512
# matches block

Response: [{ type: "block"|"tx"|"address", data: {...} }, ...]


GET /api/chain/tasks?limit=30&offset=N

Aggregated task list with full pipeline status.

curl 'https://api.ombra-net.com/api/chain/tasks?limit=10'

Response:

{
"tasks": [{
"taskId": "d00cb34e8b163a15...",
"status": "rewarded",
"responseCount": 1,
"hasValidation": true,
"hasReward": true,
"submitter": "7a8b7038...",
"fee": "1000000",
"submittedAt": 1735389942000,
"bestMinerId": "...",
"prompt": "..."
}],
"total": 200
}

GET /api/chain/task/:id

Full pipeline for one task — submit + all responses + validate + reward.

curl https://api.ombra-net.com/api/chain/task/d00cb34e8b163a15...

GET /api/chain/peers

P2P peer list + self peer ID.

curl https://api.ombra-net.com/api/chain/peers

GET /api/chain/fee-estimate

Low/medium/high fee percentiles from recent task submissions.

curl https://api.ombra-net.com/api/chain/fee-estimate

Response:

{ "low": "10000", "medium": "50000", "high": "200000", "sample": 100 }

GET /api/chain/events

SSE stream of new blocks + heartbeat pings. See Streaming for full format.

curl -N https://api.ombra-net.com/api/chain/events