feat(console): redesign the RPC reference as a novice-friendly command explorer
Replace the flat, terse command-reference table with a guided two-pane explorer built for users who don't know the RPC commands: - Search by name OR task: keyword synonyms let "balance" find getbalance, "send money" find sendtoaddress; results are ranked (name-prefix > name > keyword > desc). - Two panes (mirrors the portfolio editor): a category-grouped master list (mono names, a warning dot on consequential commands) + a rich detail pane with a plain-language explanation, a per-parameter type breakdown (string / number / json, optional dimmed), and a concrete example. - Insert into console (fills the input with a template to review + run) and, for no-parameter commands, Insert & run — with a confirm for destructive ones. Deferred via pending_submit_ so the modal needs no executor. - Keyboard: type to filter, Up/Down to move, Enter to insert; auto-focus and auto-select the top result. Data model: ConsoleCommandEntry gains details/example/keywords/destructive (C++17 defaults, so the ~60 un-enriched entries are untouched); ~20 common commands enriched and 18 consequential ones flagged. Command docs stay English (technical); the UI chrome + 7 category names are translated into all 8 languages (CJK subset rebuilt, +3 glyphs). Verified: two-pane renders on dark + light skins and at font_scale 1.5; detail pane shows explanation/params/example; danger dots + safety badge on destructive commands. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -14,28 +14,50 @@ constexpr int CountOf(const ConsoleCommandEntry (&)[N])
|
||||
}
|
||||
|
||||
const ConsoleCommandEntry kControlCommands[] = {
|
||||
{"help", "List all commands, or get help for a specified command", "[\"command\"]"},
|
||||
{"getinfo", "Get general info about the node", ""},
|
||||
{"stop", "Stop the daemon", ""},
|
||||
{"help", "List all commands, or get help for a specified command", "[\"command\"]",
|
||||
"Lists every RPC command. Pass a command name to see the node's detailed help for just that one.",
|
||||
"help \"getinfo\"", "commands list documentation what available"},
|
||||
{"getinfo", "Get general info about the node", "",
|
||||
"A quick snapshot of the node: version, block height, connection count, difficulty and wallet balance.",
|
||||
"getinfo", "status version summary overview node health"},
|
||||
{"stop", "Stop the daemon", "",
|
||||
"Shuts the DragonX node down cleanly. The wallet stays disconnected until the node is started again.",
|
||||
"stop", "quit shutdown exit close halt turn off", true},
|
||||
};
|
||||
|
||||
const ConsoleCommandEntry kNetworkCommands[] = {
|
||||
{"getnetworkinfo", "Return P2P network state info", ""},
|
||||
{"getpeerinfo", "Get data about each connected peer", ""},
|
||||
{"getconnectioncount", "Get number of peer connections", ""},
|
||||
{"getnetworkinfo", "Return P2P network state info", "",
|
||||
"The node's networking state: protocol version, which networks are active, listening addresses and relay fee.",
|
||||
"getnetworkinfo", "network p2p connection status internet"},
|
||||
{"getpeerinfo", "Get data about each connected peer", "",
|
||||
"Detailed data for every peer you are connected to \xE2\x80\x94 address, version, ping time and bytes exchanged.",
|
||||
"getpeerinfo", "peers connections nodes who connected"},
|
||||
{"getconnectioncount", "Get number of peer connections", "",
|
||||
"How many peers the node is currently connected to. Zero usually means the node is still starting or offline.",
|
||||
"getconnectioncount", "peers connections count how many"},
|
||||
{"getnettotals", "Get network traffic statistics", ""},
|
||||
{"addnode", "Add, remove, or connect to a node", "\"node\" \"add|remove|onetry\""},
|
||||
{"setban", "Add or remove an IP/subnet from the ban list", "\"ip\" \"add|remove\" [bantime] [absolute]"},
|
||||
{"setban", "Add or remove an IP/subnet from the ban list", "\"ip\" \"add|remove\" [bantime] [absolute]",
|
||||
"Bans or unbans an IP or subnet from connecting. bantime is in seconds (0 = the default 24h); absolute treats it as a Unix timestamp.",
|
||||
"setban \"192.168.0.6\" \"add\" 86400", "ban block ip peer firewall reject", true},
|
||||
{"listbanned", "List all banned IPs/subnets", ""},
|
||||
{"clearbanned", "Clear all banned IPs", ""},
|
||||
{"clearbanned", "Clear all banned IPs", "",
|
||||
"Removes every entry from the ban list, letting all previously-banned peers connect again.",
|
||||
"clearbanned", "unban reset bans allow clear", true},
|
||||
{"ping", "Ping all peers to measure round-trip time", ""},
|
||||
};
|
||||
|
||||
const ConsoleCommandEntry kBlockchainCommands[] = {
|
||||
{"getblockchaininfo", "Get current blockchain state", ""},
|
||||
{"getblockcount", "Get number of blocks in longest chain", ""},
|
||||
{"getblockchaininfo", "Get current blockchain state", "",
|
||||
"State of the chain: height, best block hash, difficulty, verification progress and how far the node has synced.",
|
||||
"getblockchaininfo", "chain sync height status blockchain progress"},
|
||||
{"getblockcount", "Get number of blocks in longest chain", "",
|
||||
"The height of the longest chain \xE2\x80\x94 how many blocks the node has. Compare with the network to check sync.",
|
||||
"getblockcount", "height blocks how many chain length synced"},
|
||||
{"getbestblockhash", "Get hash of the tip block", ""},
|
||||
{"getblock", "Get block data for a given hash or height", "\"hash|height\" [verbosity]"},
|
||||
{"getblock", "Get block data for a given hash or height", "\"hash|height\" [verbosity]",
|
||||
"Returns a block by its hash or height. verbosity 0 = raw hex, 1 = decoded header + txids, 2 = full transactions.",
|
||||
"getblock \"0000000000abc123\" 1", "block details transactions header"},
|
||||
{"getblockhash", "Get block hash at a given height", "height"},
|
||||
{"getblockheader", "Get block header for a given hash", "\"hash\" [verbose]"},
|
||||
{"getdifficulty", "Get proof-of-work difficulty", ""},
|
||||
@@ -51,8 +73,12 @@ const ConsoleCommandEntry kBlockchainCommands[] = {
|
||||
};
|
||||
|
||||
const ConsoleCommandEntry kMiningCommands[] = {
|
||||
{"getmininginfo", "Get mining-related information", ""},
|
||||
{"setgenerate", "Turn mining on or off (true/false [threads])", "generate [genproclimit]"},
|
||||
{"getmininginfo", "Get mining-related information", "",
|
||||
"Mining status: current difficulty, estimated network hash rate and whether this node is generating blocks.",
|
||||
"getmininginfo", "mining hashrate difficulty generate"},
|
||||
{"setgenerate", "Turn mining on or off (true/false [threads])", "generate [genproclimit]",
|
||||
"Turns built-in CPU mining on or off. Pass true or false, and optionally the number of threads (-1 = all cores).",
|
||||
"setgenerate true 4", "mine mining generate cpu start stop", true},
|
||||
{"getgenerate", "Check if the node is mining", ""},
|
||||
{"getnetworkhashps", "Get estimated network hash rate", "[blocks] [height]"},
|
||||
{"getblocksubsidy", "Get block reward at a given height", "[height]"},
|
||||
@@ -61,39 +87,75 @@ const ConsoleCommandEntry kMiningCommands[] = {
|
||||
};
|
||||
|
||||
const ConsoleCommandEntry kWalletCommands[] = {
|
||||
{"getbalance", "Get wallet transparent balance", "[\"account\"] [minconf]"},
|
||||
{"z_gettotalbalance", "Get total transparent + shielded balance", "[minconf]"},
|
||||
{"z_getbalances", "Get all balances (transparent + shielded)", ""},
|
||||
{"getnewaddress", "Generate a new transparent address", ""},
|
||||
{"z_getnewaddress", "Generate a new shielded address", "[\"type\"]"},
|
||||
{"listaddresses", "List all transparent addresses", ""},
|
||||
{"z_listaddresses", "List all z-addresses", ""},
|
||||
{"sendtoaddress", "Send to a specific address", "\"address\" amount"},
|
||||
{"z_sendmany", "Send to multiple z/t-addresses with shielded support", "\"fromaddress\" [{\"address\":\"...\",\"amount\":...}]"},
|
||||
{"getbalance", "Get wallet transparent balance", "[\"account\"] [minconf]",
|
||||
"Your confirmed transparent (t-address) balance in DRGX. Shielded funds are NOT included \xE2\x80\x94 use z_gettotalbalance for everything.",
|
||||
"getbalance", "balance money funds how much transparent"},
|
||||
{"z_gettotalbalance", "Get total transparent + shielded balance", "[minconf]",
|
||||
"Your complete balance in DRGX \xE2\x80\x94 transparent plus shielded (private) funds together.",
|
||||
"z_gettotalbalance", "balance total money funds shielded private how much"},
|
||||
{"z_getbalances", "Get all balances (transparent + shielded)", "",
|
||||
"Breaks your balance down across each transparent and shielded address the wallet holds.",
|
||||
"z_getbalances", "balance breakdown addresses funds per address"},
|
||||
{"getnewaddress", "Generate a new transparent address", "",
|
||||
"Creates a fresh transparent (t-) address you can share to receive DRGX.",
|
||||
"getnewaddress", "receive new address deposit transparent create get paid"},
|
||||
{"z_getnewaddress", "Generate a new shielded address", "[\"type\"]",
|
||||
"Creates a fresh shielded (z-) address for receiving DRGX privately.",
|
||||
"z_getnewaddress", "receive new address private shielded create"},
|
||||
{"listaddresses", "List all transparent addresses", "",
|
||||
"Lists the transparent (t-) addresses in your wallet.",
|
||||
"listaddresses", "addresses list my accounts transparent"},
|
||||
{"z_listaddresses", "List all z-addresses", "",
|
||||
"Lists the shielded (z-) addresses in your wallet.",
|
||||
"z_listaddresses", "addresses list my shielded private"},
|
||||
{"sendtoaddress", "Send to a specific address", "\"address\" amount",
|
||||
"Sends DRGX to a transparent address. amount is in DRGX. Double-check the address \xE2\x80\x94 sent transactions cannot be reversed.",
|
||||
"sendtoaddress \"RyourRecipientAddr\" 1.5", "send pay transfer money spend", true},
|
||||
{"z_sendmany", "Send to multiple z/t-addresses with shielded support", "\"fromaddress\" [{\"address\":\"...\",\"amount\":...}]",
|
||||
"Sends DRGX from one address to one or more recipients, with shielded (private) support. Amounts are in DRGX.",
|
||||
"z_sendmany \"RfromAddr\" [{\"address\":\"zs1toAddr\",\"amount\":1.0}]", "send pay private shielded transfer money", true},
|
||||
{"z_shieldcoinbase", "Shield transparent coinbase funds to a z-address", "\"fromaddress\" \"tozaddress\" [fee] [limit]"},
|
||||
{"z_mergetoaddress", "Merge multiple UTXOs/notes to one address", "[\"fromaddress\",...] \"toaddress\" [fee] [limit]"},
|
||||
{"listtransactions", "List recent wallet transactions", "[\"account\"] [count] [from]"},
|
||||
{"listtransactions", "List recent wallet transactions", "[\"account\"] [count] [from]",
|
||||
"Your most recent wallet transactions, newest first \xE2\x80\x94 amounts, addresses and confirmations.",
|
||||
"listtransactions", "transactions history recent payments received sent"},
|
||||
{"listunspent", "List unspent transaction outputs", "[minconf] [maxconf]"},
|
||||
{"z_listunspent", "List unspent shielded notes", "[minconf] [maxconf]"},
|
||||
{"z_getoperationstatus", "Get status of async z operations", "[\"operationid\",...]"},
|
||||
{"z_getoperationresult", "Get result of completed z operations", "[\"operationid\",...]"},
|
||||
{"z_listoperationids", "List all async z operation IDs", ""},
|
||||
{"getwalletinfo", "Get wallet state info", ""},
|
||||
{"backupwallet", "Back up wallet to a file", "\"destination\""},
|
||||
{"dumpprivkey", "Dump private key for an address", "\"address\""},
|
||||
{"importprivkey", "Import a private key into the wallet", "\"privkey\" [\"label\"] [rescan]"},
|
||||
{"dumpwallet", "Dump all wallet keys to a file", "\"filename\""},
|
||||
{"importwallet", "Import wallet from a dump file", "\"filename\""},
|
||||
{"z_exportkey", "Export spending key for a z-address", "\"zaddr\""},
|
||||
{"z_importkey", "Import a z-address spending key", "\"zkey\" [rescan] [startheight]"},
|
||||
{"getwalletinfo", "Get wallet state info", "",
|
||||
"Wallet summary: balances, transaction count, key-pool size and whether the wallet is encrypted and locked.",
|
||||
"getwalletinfo", "wallet status info balance encrypted locked"},
|
||||
{"backupwallet", "Back up wallet to a file", "\"destination\"",
|
||||
"Saves a copy of your wallet.dat to the given path. Keep the backup somewhere safe and private.",
|
||||
"backupwallet \"/home/you/drgx-backup.dat\"", "backup save wallet copy protect"},
|
||||
{"dumpprivkey", "Dump private key for an address", "\"address\"",
|
||||
"Reveals the private key for an address. Anyone with this key can spend from the address \xE2\x80\x94 never share it.",
|
||||
"dumpprivkey \"RyourAddr\"", "private key export reveal secret spend", true},
|
||||
{"importprivkey", "Import a private key into the wallet", "\"privkey\" [\"label\"] [rescan]",
|
||||
"Imports a private key so the wallet can spend from its address, then rescans the chain for its history (can be slow).",
|
||||
"importprivkey \"Uxxxxxxxxxxxx\"", "import private key restore recover add", true},
|
||||
{"dumpwallet", "Dump all wallet keys to a file", "\"filename\"", "", "", "", true},
|
||||
{"importwallet", "Import wallet from a dump file", "\"filename\"", "", "", "", true},
|
||||
{"z_exportkey", "Export spending key for a z-address", "\"zaddr\"",
|
||||
"Reveals the spending key for a shielded address. Anyone with it can spend your private funds \xE2\x80\x94 keep it secret.",
|
||||
"z_exportkey \"zs1yourAddr\"", "private key export shielded secret spend", true},
|
||||
{"z_importkey", "Import a z-address spending key", "\"zkey\" [rescan] [startheight]", "", "", "", true},
|
||||
{"z_exportviewingkey", "Export viewing key for a z-address", "\"zaddr\""},
|
||||
{"z_importviewingkey", "Import a z-address viewing key", "\"vkey\" [rescan] [startheight]"},
|
||||
{"z_exportwallet", "Export all wallet keys (including z-keys) to file", "\"filename\""},
|
||||
{"signmessage", "Sign a message with an address key", "\"address\" \"message\""},
|
||||
{"z_importviewingkey", "Import a z-address viewing key", "\"vkey\" [rescan] [startheight]", "", "", "", true},
|
||||
{"z_exportwallet", "Export all wallet keys (including z-keys) to file", "\"filename\"", "", "", "", true},
|
||||
{"signmessage", "Sign a message with an address key", "\"address\" \"message\"",
|
||||
"Signs a message with the private key of one of your addresses, proving you control that address.",
|
||||
"signmessage \"RyourAddr\" \"hello world\"", "sign message prove ownership"},
|
||||
{"settxfee", "Set the transaction fee per kB", "amount"},
|
||||
{"walletpassphrase", "Unlock the wallet with passphrase", "\"passphrase\" timeout"},
|
||||
{"walletpassphrase", "Unlock the wallet with passphrase", "\"passphrase\" timeout",
|
||||
"Unlocks an encrypted wallet for the given number of seconds so you can send funds. Your passphrase is typed in plain text \xE2\x80\x94 be sure no one is watching.",
|
||||
"walletpassphrase \"your passphrase\" 60", "unlock passphrase password encrypted open", true},
|
||||
{"walletlock", "Lock the wallet", ""},
|
||||
{"encryptwallet", "Encrypt the wallet with a passphrase", "\"passphrase\""},
|
||||
{"encryptwallet", "Encrypt the wallet with a passphrase", "\"passphrase\"",
|
||||
"Encrypts the wallet with a passphrase. The node shuts down afterward and you will need the passphrase to send. Encryption cannot be undone \xE2\x80\x94 keep the passphrase safe.",
|
||||
"encryptwallet \"a strong passphrase\"", "encrypt password protect secure lock", true},
|
||||
};
|
||||
|
||||
const ConsoleCommandEntry kRawTransactionCommands[] = {
|
||||
@@ -107,13 +169,15 @@ const ConsoleCommandEntry kRawTransactionCommands[] = {
|
||||
};
|
||||
|
||||
const ConsoleCommandEntry kUtilityCommands[] = {
|
||||
{"validateaddress", "Validate a transparent address", "\"address\""},
|
||||
{"validateaddress", "Validate a transparent address", "\"address\"",
|
||||
"Checks whether a transparent address is well-formed and whether it belongs to your wallet.",
|
||||
"validateaddress \"RsomeAddr\"", "validate check address valid mine"},
|
||||
{"z_validateaddress", "Validate a z-address", "\"zaddr\""},
|
||||
{"estimatefee", "Estimate fee for a transaction", "nblocks"},
|
||||
{"verifymessage", "Verify a signed message", "\"address\" \"signature\" \"message\""},
|
||||
{"createmultisig", "Create a multisig address", "nrequired [\"key\",...]"},
|
||||
{"invalidateblock", "Mark a block as invalid", "\"hash\""},
|
||||
{"reconsiderblock", "Reconsider a previously invalidated block", "\"hash\""},
|
||||
{"invalidateblock", "Mark a block as invalid", "\"hash\"", "", "", "", true},
|
||||
{"reconsiderblock", "Reconsider a previously invalidated block", "\"hash\"", "", "", "", true},
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user