mirror of
https://github.com/aljazceru/cyphernode.git
synced 2026-02-04 04:04:18 +01:00
v0/getmempoolinfo added :-D
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
# Stats can:
|
||||
action_getblockchaininfo=stats
|
||||
action_installation_info=stats
|
||||
action_getmempoolinfo=stats
|
||||
|
||||
# Watcher can:
|
||||
action_watch=watcher
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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 $?
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user