From 588aefaa91f4b70d19c4e4cd7daefd84b7ad1b10 Mon Sep 17 00:00:00 2001 From: Randall Naar Date: Fri, 10 Jul 2026 13:59:59 -0400 Subject: [PATCH] Documented the /block-template endpoint. --- API.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/API.md b/API.md index 5aa09187..4f482842 100644 --- a/API.md +++ b/API.md @@ -255,6 +255,19 @@ The available confirmation targets are 1-25, 144, 504 and 1008 blocks. For example: `{ "1": 87.882, "2": 87.882, "3": 87.882, "4": 87.882, "5": 81.129, "6": 68.285, ..., "144": 1.027, "504": 1.027, "1008": 1.027 }` +## Mining + +### `GET /block-template` + +Returns the daemon's [`getblocktemplate`](https://developer.bitcoin.org/reference/rpc/getblocktemplate.html) +template-mode response for mining. + +This endpoint is available only when electrs is started with +`--enable-mining-rest`. + +Successful responses are cached internally for up to 15 seconds and invalidated +when electrs indexes a new chain tip. Responses include `Cache-Control: no-store`. + ## Assets (Elements/Liquid only) ### `GET /asset/:asset_id`