Add getchaintxstats RPC #9733
pull sipa wants to merge 1 commits into bitcoin:master from sipa:chaintxstats changing 2 files +67 −0-
sipa commented at 1:26 am on February 10, 2017: memberNot intended for 0.14, but may be used to compute the new chainTxData constants in releases.
-
sipa commented at 1:30 am on February 10, 2017: memberAlternative: don’t allow specifying the window size, and include the output in
getblockchaininfo
. -
in src/rpc/blockchain.cpp: in 53d4292763 outdated
1427+ " \"time\": xxxxx, (numeric) The timestamp for the statistics in UNIX format.\n" 1428+ " \"txcount\": xxxxx, (numeric) The total number of transactions in the chain up to that point.\n" 1429+ " \"txrate\": x.xx, (numeric) The average rate of transactions per second in the window.\n" 1430+ "}\n" 1431+ "\nExamples:\n" 1432+ + HelpExampleCli("gettxratestats", "")
paveljanik commented at 7:09 am on February 10, 2017:getchaintxstats vs gettxratestatspaveljanik commented at 7:26 am on February 10, 2017: contributorI prefer having it separate fromgetblockchaininfo
because it brings more flexibility - ability to query past data etc. On the other hand, adding current txrate and txcount togetblockchaininfo
: why not :-)fanquake added the label RPC/REST/ZMQ on Feb 10, 2017laanwj commented at 8:44 am on February 10, 2017: memberConcept ACK. Though I wonder if this shouldn’t be an external script, if it’s only used for computing some statistics before releases.
On the other hand, adding current txrate and txcount to getblockchaininfo: why not :-)
Well we shouldn’t add anything that is non-trivial to compute to
getblockchaininfo
. I think restricting that call to return state information that is up-to-date and used by the client anyway makes sense. Otherwise it becomes slower and slower as more things are added, like what happened togetinfo
. So a separate call is fine with me.sipa commented at 9:32 am on April 5, 2017: memberThough I wonder if this shouldn’t be an external script, if it’s only used for computing some statistics before releases.
I don’t think it’s unreasonable to have a built-in function to compute the transaction rate.
jnewbery commented at 8:06 pm on April 5, 2017: memberI don’t think it’s unreasonable to have a built-in function to compute the transaction rate.
What’s the use case for this, other than computing the chainTxData constants?
sipa commented at 8:03 am on April 6, 2017: memberWhat’s the use case for this, other than computing the chainTxData constants?
Not really a use case, except that’s it’s generally useful information that someone may be interested in.
in src/rpc/blockchain.cpp:1436 in 53d4292763 outdated
1431+ "\nExamples:\n" 1432+ + HelpExampleCli("gettxratestats", "") 1433+ + HelpExampleRpc("gettxratestats", "2016") 1434+ ); 1435+ 1436+ CBlockIndex* pindex;
TheBlueMatt commented at 9:14 pm on April 17, 2017:nit: const CBlockIndexTheBlueMatt commented at 9:21 pm on April 17, 2017: memberutACK +/- the two nitsjtimon commented at 7:29 pm on April 24, 2017: contributorutACK 53d4292763b2896c50d1e9f3140796f563dcd350 Although for plotting things an interface like initialBlockHeight, endBlockHeight feel more natural than the distance and the hash of the block. It seems there’s no functionality loss since the block hash cannot be used to select a chain that is not part of the active chain anyway.laanwj commented at 4:56 pm on May 2, 2017: memberCan be merged if the small nits by @TheBlueMatt and @paveljanik are fixedAdd getchaintxstats RPC 484d40e3f1sipa force-pushed on May 3, 2017in src/rpc/blockchain.cpp:1419 in 484d40e3f1
1412@@ -1413,10 +1413,76 @@ UniValue reconsiderblock(const JSONRPCRequest& request) 1413 return NullUniValue; 1414 } 1415 1416+UniValue getchaintxstats(const JSONRPCRequest& request) 1417+{ 1418+ if (request.fHelp || request.params.size() > 2) 1419+ throw runtime_error(
laanwj commented at 5:58 am on May 3, 2017:looks like travis complains now: theusing namespace
was removed, so this should bestd::runtime_error
, will fix this up before merginglaanwj referenced this in commit d4732f3232 on May 3, 2017laanwj commented at 6:17 am on May 3, 2017: memberMerged via d4732f3laanwj closed this on May 3, 2017
PastaPastaPasta referenced this in commit 843ffa4eb5 on Jun 10, 2019PastaPastaPasta referenced this in commit 1aafd9b208 on Jun 10, 2019PastaPastaPasta referenced this in commit 3b6b65b645 on Jun 10, 2019PastaPastaPasta referenced this in commit d017dd175d on Jun 11, 2019PastaPastaPasta referenced this in commit 0b5025bbd0 on Jun 11, 2019PastaPastaPasta referenced this in commit 85767af6c3 on Jun 15, 2019PastaPastaPasta referenced this in commit 83875836f6 on Jun 19, 2019PastaPastaPasta referenced this in commit 11286413ec on Jun 19, 2019PastaPastaPasta referenced this in commit b25c3cf54e on Jun 19, 2019PastaPastaPasta referenced this in commit edf02b0791 on Jun 19, 2019PastaPastaPasta referenced this in commit fceabc7306 on Jun 19, 2019PastaPastaPasta referenced this in commit 6f741e5583 on Jun 19, 2019PastaPastaPasta referenced this in commit 44446b9870 on Jun 19, 2019PastaPastaPasta referenced this in commit 1c8452b6d5 on Jun 20, 2019barrystyle referenced this in commit 6f0c4390f4 on Jan 22, 2020MarcoFalke locked this on Sep 8, 2021
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-22 12:12 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me