v0/getmempoolinfo added :-D

This commit is contained in:
aitorjs
2019-07-02 16:03:52 +02:00
committed by kexkey
parent 250e18d4c5
commit f3e1948ae9
5 changed files with 41 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
# Stats can:
action_getblockchaininfo=stats
action_installation_info=stats
action_getmempoolinfo=stats
# Watcher can do what the stats can do, plus:
action_watch=watcher

View File

@@ -6,6 +6,7 @@
# Stats can:
action_getblockchaininfo=stats
action_installation_info=stats
action_getmempoolinfo=stats
# Watcher can:
action_watch=watcher

View File

@@ -292,6 +292,26 @@ When cyphernode receives a transaction confirmation (/conf endpoint) on a watche
}
```
### Get mempool information
Returns the mempool information of the Bitcoin node.
```http
GET http://cyphernode:8888/getmempoolinfo
```
Proxy response:
```json
{
"size": 25,
"bytes": 5462,
"usage": 34736,
"maxmempool": 64000000,
"mempoolminfee": 1e-05,
"minrelaytxfee": 1e-05
}
```
### 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.
@@ -552,6 +572,8 @@ Proxy response:
}
```
### Get a new Bitcoin address from spending wallet (called by application)
Calls getnewaddress RPC on the spending wallet. Used to refill the spending wallet from cold wallet (ie Trezor). Will derive the default address type (set in your bitcoin.conf file, p2sh-segwit if not specified) or you can supply the address type like the following examples.

View File

@@ -81,4 +81,13 @@ get_blockchain_info()
local data='{"method":"getblockchaininfo"}'
send_to_watcher_node "${data}" | jq ".result"
return $?
}
}
get_mempool_info()
{
trace "Entering get_mempool_info()..."
local data='{"method":"getmempoolinfo"}'
send_to_watcher_node "${data}" | jq ".result"
return $?
}

View File

@@ -284,6 +284,13 @@ main()
response_to_client "${response}" ${?}
break
;;
getmempoolinfo)
# curl GET http://192.168.111.152:8080/getmempoolinfo
trace "trace: $(get_mempool_info)"
response=$(get_mempool_info "${line}")
response_to_client "${response}" ${?}
break
;;
ln_getinfo)
# GET http://192.168.111.152:8080/ln_getinfo