13
13
void quorum_list_help ()
14
14
{
15
15
throw std::runtime_error (
16
- " quorum list (count)\n "
16
+ " quorum list ( count )\n "
17
17
" \n Arguments:\n "
18
- " 1. count (number, optional) Number of quorums to list.\n "
18
+ " 1. count (number, optional, default=10 ) Number of quorums to list.\n "
19
19
);
20
20
}
21
21
@@ -51,11 +51,11 @@ UniValue quorum_list(const JSONRPCRequest& request)
51
51
void quorum_info_help ()
52
52
{
53
53
throw std::runtime_error (
54
- " quorum info \" llmqType\" \" blockquorumHash \" (includeSkShare)\n "
54
+ " quorum info llmqType \" quorumHash \" ( includeSkShare )\n "
55
55
" \n Arguments:\n "
56
- " 1. \" llmqType\" (int, required) LLMQ type.\n "
56
+ " 1. llmqType (int, required) LLMQ type.\n "
57
57
" 2. \" quorumHash\" (string, required) Block hash of quorum.\n "
58
- " 3. \" includeSkShare\" (boolean, optional) Include secret key share in output.\n "
58
+ " 3. includeSkShare (boolean, optional) Include secret key share in output.\n "
59
59
);
60
60
}
61
61
@@ -155,15 +155,31 @@ UniValue quorum_dkgstatus(const JSONRPCRequest& request)
155
155
return status.ToJson (detailLevel);
156
156
}
157
157
158
+ [[ noreturn ]] void quorum_help ()
159
+ {
160
+ throw std::runtime_error (
161
+ " quorum \" command\" ...\n "
162
+ " Set of commands for quorums/LLMQs.\n "
163
+ " To get help on individual commands, use \" help quorum command\" .\n "
164
+ " \n Arguments:\n "
165
+ " 1. \" command\" (string, required) The command to execute\n "
166
+ " \n Available commands:\n "
167
+ " list - List of on-chain quorums\n "
168
+ " info - Return information about a quorum\n "
169
+ " dkgstatus - Return the status of the current DKG process\n "
170
+ );
171
+ }
172
+
158
173
UniValue quorum (const JSONRPCRequest& request)
159
174
{
160
- if (request.params .empty ()) {
161
- throw std::runtime_error (
162
- " quorum \" command\" ...\n "
163
- );
175
+ if (request.fHelp && request.params .empty ()) {
176
+ quorum_help ();
164
177
}
165
178
166
- std::string command = request.params [0 ].get_str ();
179
+ std::string command;
180
+ if (request.params .size () >= 1 ) {
181
+ command = request.params [0 ].get_str ();
182
+ }
167
183
168
184
if (command == " list" ) {
169
185
return quorum_list (request);
@@ -172,7 +188,7 @@ UniValue quorum(const JSONRPCRequest& request)
172
188
} else if (command == " dkgstatus" ) {
173
189
return quorum_dkgstatus (request);
174
190
} else {
175
- throw std::runtime_error ( " invalid command: " + command );
191
+ quorum_help ( );
176
192
}
177
193
}
178
194
0 commit comments