From f7ac03002dd28aeed4bfdb03437b02c3310f47e2 Mon Sep 17 00:00:00 2001 From: kexkey Date: Mon, 1 Apr 2019 16:45:47 -0400 Subject: [PATCH] getblockchaininfo docs --- api_auth_docker/api-sample.properties | 5 ++- doc/API.v0.md | 64 +++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) diff --git a/api_auth_docker/api-sample.properties b/api_auth_docker/api-sample.properties index b3d6f88..63851c6 100644 --- a/api_auth_docker/api-sample.properties +++ b/api_auth_docker/api-sample.properties @@ -1,6 +1,9 @@ # The file api.properties generated by the installer should look like this. -# Watcher can: +# Stats can: +action_getblockchaininfo=stats + +# Watcher can do what the stats can do, plus: action_watch=watcher action_unwatch=watcher action_watchxpub=watcher diff --git a/doc/API.v0.md b/doc/API.v0.md index fdf1b37..fcfccda 100644 --- a/doc/API.v0.md +++ b/doc/API.v0.md @@ -292,6 +292,70 @@ When cyphernode receives a transaction confirmation (/conf endpoint) on a watche } ``` +### Get the blockchain information (called by application) + +Returns the blockchain information of the Bitcoin node. Used for example by the welcome app to get syncing progression. + +```http +GET http://cyphernode:8888/getblockchaininfo +``` + +Proxy response: + +```json +{ + "chain": "test", + "blocks": 1486864, + "headers": 1486864, + "bestblockhash": "000000000000002fb99d683e64bbfc2b7ad16f9a425cf7be77b481fb1afa363b", + "difficulty": 13971064.71015782, + "mediantime": 1554149114, + "verificationprogress": 0.9999994536561675, + "initialblockdownload": false, + "chainwork": "000000000000000000000000000000000000000000000103ceb57a5896f347ce", + "size_on_disk": 23647567017, + "pruned": false, + "softforks": [ + { + "id": "bip34", + "version": 2, + "reject": { + "status": true + } + }, + { + "id": "bip66", + "version": 3, + "reject": { + "status": true + } + }, + { + "id": "bip65", + "version": 4, + "reject": { + "status": true + } + } + ], + "bip9_softforks": { + "csv": { + "status": "active", + "startTime": 1456790400, + "timeout": 1493596800, + "since": 770112 + }, + "segwit": { + "status": "active", + "startTime": 1462060800, + "timeout": 1493596800, + "since": 834624 + } + }, + "warnings": "Warning: unknown new rules activated (versionbit 28)" +} +``` + ### Get the Best Block Hash (called by application) Returns the best block hash of the watching Bitcoin node.