Closed nolim1t closed 4 years ago
Endpoints /info/sync (Expanded to expose extra stuff)
{
"percent": "1.0000",
"currentBlock": 627729,
"headerCount": 627729,
"difficulty": 15958652328578.42,
"size": 311144972067
}
NEW! /info/mempool
{
"loaded": true,
"size": 4963,
"bytes": 1860448,
"usage": 7882624,
"maxmempool": 512000000,
"mempoolminfee": 1e-05,
"minrelaytxfee": 1e-05
}
NEW info/stats (aka the firehouse)
{
"blockchain_info": {
"chain": "main",
"blocks": 627732,
"headers": 627732,
"bestblockhash": "0000000000000000000dbc52d94673ab45b8271c38ec3245f82eb1a55bf10da3",
"difficulty": 15958652328578.42,
"mediantime": 1587917440,
"verificationprogress": 0.9999987748965766,
"initialblockdownload": false,
"chainwork": "00000000000000000000000000000000000000000ee0e63b21634097f85357a4",
"sizeOnDisk": 311149168631,
"pruned": false,
"softforks": {
"bip34": {
"type": "buried",
"active": true,
"height": 227931
},
"bip66": {
"type": "buried",
"active": true,
"height": 363725
},
"bip65": {
"type": "buried",
"active": true,
"height": 388381
},
"csv": {
"type": "buried",
"active": true,
"height": 419328
},
"segwit": {
"type": "buried",
"active": true,
"height": 481824
}
},
"warnings": ""
},
"network_info": {
"version": 190100,
"subversion": "/Satoshi:0.19.1/",
"protocolversion": 70015,
"localservices": "0000000000000409",
"localservicesnames": [
"NETWORK",
"WITNESS",
"NETWORK_LIMITED"
],
"localrelay": true,
"timeoffset": -2,
"networkactive": true,
"connections": 10,
"networks": [
{
"name": "ipv4",
"limited": false,
"reachable": true,
"proxy": "",
"proxyRandomizeCredentials": false
},
{
"name": "ipv6",
"limited": false,
"reachable": true,
"proxy": "",
"proxyRandomizeCredentials": false
},
{
"name": "onion",
"limited": false,
"reachable": true,
"proxy": "127.0.0.1:9150",
"proxyRandomizeCredentials": true
}
],
"relayfee": 1e-05,
"incrementalfee": 1e-05,
"localaddresses": [
{
"address": "3svpjvkmpftz2gny.onion",
"port": 8333,
"score": 7
}
],
"warnings": ""
},
"mempool": {
"loaded": true,
"size": 728,
"bytes": 250136,
"usage": 1135312,
"maxmempool": 512000000,
"mempoolminfee": 1e-05,
"minrelaytxfee": 1e-05
}
}
Please test @mayankchhabra
nice, I think you missed the hashrate
I also suggest removing all the other unrequired info from the stats endpoint because it can increase the request's response time, especially when the polling happens on tor
nice, I think you missed the hashrate
hashrate is difficulty
we need the network hashes per second...
How is
{
"blocks": 627734,
"difficulty": 15958652328578.42,
"size": 311151022856,
"mempool": {
"loaded": true,
"size": 3889,
"bytes": 1536424,
"usage": 6171792,
"maxmempool": 512000000,
"mempoolminfee": 1e-05,
"minrelaytxfee": 1e-05
},
"connections": 11
}
for mempool
sure but we still don't need a lot of it... just
{
peers: <number of connected peers>
mempool: <size of amempool in bytes>
hashrate: <network hashes per second>
blockchainSize: <the estimated size of the block and undo files on disk>
}
would be fine
Not sure what is what in mempool to be honest.
we need the network hashes per second...
That might be challenging to get.. its not the same command and the library this is using is also unmaintained
found the function
However the hashes per second is not being returned from the library
so it might be a new function, added after they stopped maintaining
{
"blocks": 627735,
"difficulty": 15958652328578.42,
"size": 311152526222,
"mempool": {
"loaded": true,
"size": 4884,
"bytes": 2023641,
"usage": 7947472,
"maxmempool": 512000000,
"mempoolminfee": 1e-05,
"minrelaytxfee": 1e-05
},
"connections": 10,
"hashespersec": 109983984577136800000
}
However may require modifying upstream code which the last time it looks updated was June 2019
I can try to send a pull request (https://github.com/bitpay/bitcoind-rpc/pull/54) but I doubt anyone is maintaining it
ah I see, does it have bitcoin-cli getmininginfo? network hash ps is also returned in the mining info
From mining info
{
"blocks": 627736,
"difficulty": 15958652328578.42,
"size": 311153957575,
"mempool": {
"loaded": true,
"size": 4857,
"bytes": 2377743,
"usage": 8890432,
"maxmempool": 512000000,
"mempoolminfee": 1e-05,
"minrelaytxfee": 1e-05
},
"connections": 10,
"networkhashps": 109005941033200500000
}
Testing now
Tested and merged! Great job as always @nolim1t
Closes https://github.com/getumbrel/umbrel-middleware/issues/9 when done