Skip to content

Commit facd5d9

Browse files
author
MarcoFalke
committed
doc: Fix getblockchaininfo/getdeploymentinfo RPC docs
1 parent 7606512 commit facd5d9

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

src/rpc/blockchain.cpp

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,38 +1527,38 @@ RPCHelpMan getblockchaininfo()
15271527
{
15281528
/* TODO: from v24, remove -deprecatedrpc=softforks */
15291529
return RPCHelpMan{"getblockchaininfo",
1530-
"Returns an object containing various state info regarding blockchain processing.\n",
1531-
{},
1532-
RPCResult{
1533-
RPCResult::Type::OBJ, "", "",
1534-
{
1535-
{RPCResult::Type::STR, "chain", "current network name (main, test, signet, regtest)"},
1536-
{RPCResult::Type::NUM, "blocks", "the height of the most-work fully-validated chain. The genesis block has height 0"},
1537-
{RPCResult::Type::NUM, "headers", "the current number of headers we have validated"},
1538-
{RPCResult::Type::STR, "bestblockhash", "the hash of the currently best block"},
1539-
{RPCResult::Type::NUM, "difficulty", "the current difficulty"},
1540-
{RPCResult::Type::NUM_TIME, "time", "The block time expressed in " + UNIX_EPOCH_TIME},
1541-
{RPCResult::Type::NUM_TIME, "mediantime", "The median block time expressed in " + UNIX_EPOCH_TIME},
1542-
{RPCResult::Type::NUM, "verificationprogress", "estimate of verification progress [0..1]"},
1543-
{RPCResult::Type::BOOL, "initialblockdownload", "(debug information) estimate of whether this node is in Initial Block Download mode"},
1544-
{RPCResult::Type::STR_HEX, "chainwork", "total amount of work in active chain, in hexadecimal"},
1545-
{RPCResult::Type::NUM, "size_on_disk", "the estimated size of the block and undo files on disk"},
1546-
{RPCResult::Type::BOOL, "pruned", "if the blocks are subject to pruning"},
1547-
{RPCResult::Type::NUM, "pruneheight", /*optional=*/true, "lowest-height complete block stored (only present if pruning is enabled)"},
1548-
{RPCResult::Type::BOOL, "automatic_pruning", /*optional=*/true, "whether automatic pruning is enabled (only present if pruning is enabled)"},
1549-
{RPCResult::Type::NUM, "prune_target_size", /*optional=*/true, "the target size used by pruning (only present if automatic pruning is enabled)"},
1550-
{RPCResult::Type::OBJ_DYN, "softforks", "(DEPRECATED, returned only if config option -deprecatedrpc=softforks is passed) status of softforks",
1551-
{
1552-
{RPCResult::Type::OBJ, "xxxx", "name of the softfork",
1553-
RPCHelpForDeployment
1554-
},
1555-
}},
1556-
{RPCResult::Type::STR, "warnings", "any network and blockchain warnings"},
1557-
}},
1558-
RPCExamples{
1559-
HelpExampleCli("getblockchaininfo", "")
1530+
"Returns an object containing various state info regarding blockchain processing.\n",
1531+
{},
1532+
RPCResult{
1533+
RPCResult::Type::OBJ, "", "",
1534+
{
1535+
{RPCResult::Type::STR, "chain", "current network name (main, test, signet, regtest)"},
1536+
{RPCResult::Type::NUM, "blocks", "the height of the most-work fully-validated chain. The genesis block has height 0"},
1537+
{RPCResult::Type::NUM, "headers", "the current number of headers we have validated"},
1538+
{RPCResult::Type::STR, "bestblockhash", "the hash of the currently best block"},
1539+
{RPCResult::Type::NUM, "difficulty", "the current difficulty"},
1540+
{RPCResult::Type::NUM_TIME, "time", "The block time expressed in " + UNIX_EPOCH_TIME},
1541+
{RPCResult::Type::NUM_TIME, "mediantime", "The median block time expressed in " + UNIX_EPOCH_TIME},
1542+
{RPCResult::Type::NUM, "verificationprogress", "estimate of verification progress [0..1]"},
1543+
{RPCResult::Type::BOOL, "initialblockdownload", "(debug information) estimate of whether this node is in Initial Block Download mode"},
1544+
{RPCResult::Type::STR_HEX, "chainwork", "total amount of work in active chain, in hexadecimal"},
1545+
{RPCResult::Type::NUM, "size_on_disk", "the estimated size of the block and undo files on disk"},
1546+
{RPCResult::Type::BOOL, "pruned", "if the blocks are subject to pruning"},
1547+
{RPCResult::Type::NUM, "pruneheight", /*optional=*/true, "lowest-height complete block stored (only present if pruning is enabled)"},
1548+
{RPCResult::Type::BOOL, "automatic_pruning", /*optional=*/true, "whether automatic pruning is enabled (only present if pruning is enabled)"},
1549+
{RPCResult::Type::NUM, "prune_target_size", /*optional=*/true, "the target size used by pruning (only present if automatic pruning is enabled)"},
1550+
{RPCResult::Type::OBJ_DYN, "softforks", /*optional=*/true, "(DEPRECATED, returned only if config option -deprecatedrpc=softforks is passed) status of softforks",
1551+
{
1552+
{RPCResult::Type::OBJ, "xxxx", "name of the softfork",
1553+
RPCHelpForDeployment
1554+
},
1555+
}},
1556+
{RPCResult::Type::STR, "warnings", "any network and blockchain warnings"},
1557+
}},
1558+
RPCExamples{
1559+
HelpExampleCli("getblockchaininfo", "")
15601560
+ HelpExampleRpc("getblockchaininfo", "")
1561-
},
1561+
},
15621562
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
15631563
{
15641564
const ArgsManager& args{EnsureAnyArgsman(request.context)};
@@ -1632,7 +1632,7 @@ const std::vector<RPCResult> RPCHelpForDeployment{
16321632
{RPCResult::Type::NUM, "count", "the number of blocks with the version bit set in the current period"},
16331633
{RPCResult::Type::BOOL, "possible", /*optional=*/true, "returns false if there are not enough blocks left in this period to pass activation threshold (only for \"started\" status)"},
16341634
}},
1635-
{RPCResult::Type::STR, "signalling", "indicates blocks that signalled with a # and blocks that did not with a -"},
1635+
{RPCResult::Type::STR, "signalling", /*optional=*/true, "indicates blocks that signalled with a # and blocks that did not with a -"},
16361636
}},
16371637
};
16381638

@@ -1661,7 +1661,7 @@ static RPCHelpMan getdeploymentinfo()
16611661
RPCResult::Type::OBJ, "", "", {
16621662
{RPCResult::Type::STR, "hash", "requested block hash (or tip)"},
16631663
{RPCResult::Type::NUM, "height", "requested block height (or tip)"},
1664-
{RPCResult::Type::OBJ, "deployments", "", {
1664+
{RPCResult::Type::OBJ_DYN, "deployments", "", {
16651665
{RPCResult::Type::OBJ, "xxxx", "name of the deployment", RPCHelpForDeployment}
16661666
}},
16671667
}

0 commit comments

Comments
 (0)