rpc: Removing description from json_command struct

This commit is contained in:
ShahanaFarooqui 2024-07-23 15:13:07 -07:00 committed by Rusty Russell
parent 89c182e2be
commit b485a026f7
42 changed files with 126 additions and 320 deletions

View file

@ -179,11 +179,9 @@ static void human_help(char *buffer, const jsmntok_t *result)
unsigned int i; unsigned int i;
/* `curr` is used as a temporary token */ /* `curr` is used as a temporary token */
const jsmntok_t *curr; const jsmntok_t *curr;
const char *prev_cat;
/* Contains all commands objects, which have the following structure : /* Contains all commands objects, which have the following structure :
* { * {
* "command": "The command name and usage", * "command": "The command name and usage"
* "description": "The command's description"
* } * }
*/ */
const jsmntok_t * help_array = json_get_member(buffer, result, "help"); const jsmntok_t * help_array = json_get_member(buffer, result, "help");
@ -196,22 +194,11 @@ static void human_help(char *buffer, const jsmntok_t *result)
asort(help, tal_count(help), compare_help, buffer); asort(help, tal_count(help), compare_help, buffer);
prev_cat = "";
for (i = 0; i < tal_count(help); i++) { for (i = 0; i < tal_count(help); i++) {
const jsmntok_t *category, *command, *desc; const jsmntok_t *command;
category = json_get_member(buffer, help[i], "category");
if (category && !json_tok_streq(buffer, category, prev_cat)) {
prev_cat = json_strdup(help, buffer, category);
printf("=== %s ===\n\n", prev_cat);
}
command = json_get_member(buffer, help[i], "command"); command = json_get_member(buffer, help[i], "command");
desc = json_get_member(buffer, help[i], "description"); printf("%.*s\n\n",
printf("%.*s\n",
command->end - command->start, buffer + command->start); command->end - command->start, buffer + command->start);
printf(" %.*s\n\n",
desc->end - desc->start, buffer + desc->start);
} }
tal_free(help); tal_free(help);

View file

@ -3307,7 +3307,6 @@ message HelpResponse {
message HelpHelp { message HelpHelp {
string command = 1; string command = 1;
string description = 3;
} }
message PreapprovekeysendRequest { message PreapprovekeysendRequest {

View file

@ -3554,7 +3554,6 @@ impl From<responses::HelpHelp> for pb::HelpHelp {
fn from(c: responses::HelpHelp) -> Self { fn from(c: responses::HelpHelp) -> Self {
Self { Self {
command: c.command, // Rule #2 for type string command: c.command, // Rule #2 for type string
description: c.description, // Rule #2 for type string
} }
} }
} }

1
cln-rpc/src/model.rs generated
View file

@ -9742,7 +9742,6 @@ pub mod responses {
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct HelpHelp { pub struct HelpHelp {
pub command: String, pub command: String,
pub description: String,
} }
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]

View file

@ -12567,8 +12567,7 @@
"type": "object", "type": "object",
"additionalProperties": true, "additionalProperties": true,
"required": [ "required": [
"command", "command"
"description"
], ],
"properties": { "properties": {
"command": { "command": {
@ -12576,12 +12575,6 @@
"description": [ "description": [
"The command." "The command."
] ]
},
"description": {
"type": "string",
"description": [
"A one-line description of the purpose of this command."
]
} }
} }
} }
@ -12621,8 +12614,7 @@
"response": { "response": {
"help": [ "help": [
{ {
"command": "pay bolt11 [amount_msat] [label] [riskfactor] [maxfeepercent] [retry_for] [maxdelay] [exemptfee] [localinvreqid] [exclude] [maxfee] [description] [dev_use_shadow]", "command": "pay bolt11 [amount_msat] [label] [riskfactor] [maxfeepercent] [retry_for] [maxdelay] [exemptfee] [localinvreqid] [exclude] [maxfee] [description] [dev_use_shadow]"
"description": "Send payment specified by {bolt11}"
} }
], ],
"format-hint": "simple" "format-hint": "simple"
@ -12639,8 +12631,7 @@
"response": { "response": {
"help": [ "help": [
{ {
"command": "dev subcommand=crash|rhash|slowcmd", "command": "dev subcommand=crash|rhash|slowcmd"
"description": "Developer command test multiplexer"
} }
], ],
"format-hint": "simple" "format-hint": "simple"

File diff suppressed because one or more lines are too long

View file

@ -2618,7 +2618,6 @@ def stop2py(m):
def help_help2py(m): def help_help2py(m):
return remove_default({ return remove_default({
"command": m.command, # PrimitiveField in generate_composite "command": m.command, # PrimitiveField in generate_composite
"description": m.description, # PrimitiveField in generate_composite
}) })

View file

@ -31,8 +31,7 @@
"type": "object", "type": "object",
"additionalProperties": true, "additionalProperties": true,
"required": [ "required": [
"command", "command"
"description"
], ],
"properties": { "properties": {
"command": { "command": {
@ -40,12 +39,6 @@
"description": [ "description": [
"The command." "The command."
] ]
},
"description": {
"type": "string",
"description": [
"A one-line description of the purpose of this command."
]
} }
} }
} }
@ -85,8 +78,7 @@
"response": { "response": {
"help": [ "help": [
{ {
"command": "pay bolt11 [amount_msat] [label] [riskfactor] [maxfeepercent] [retry_for] [maxdelay] [exemptfee] [localinvreqid] [exclude] [maxfee] [description] [dev_use_shadow]", "command": "pay bolt11 [amount_msat] [label] [riskfactor] [maxfeepercent] [retry_for] [maxdelay] [exemptfee] [localinvreqid] [exclude] [maxfee] [description] [dev_use_shadow]"
"description": "Send payment specified by {bolt11}"
} }
], ],
"format-hint": "simple" "format-hint": "simple"
@ -103,8 +95,7 @@
"response": { "response": {
"help": [ "help": [
{ {
"command": "dev subcommand=crash|rhash|slowcmd", "command": "dev subcommand=crash|rhash|slowcmd"
"description": "Developer command test multiplexer"
} }
], ],
"format-hint": "simple" "format-hint": "simple"

View file

@ -756,7 +756,6 @@ static struct command_result *json_feerates(struct command *cmd,
static const struct json_command feerates_command = { static const struct json_command feerates_command = {
"feerates", "feerates",
json_feerates, json_feerates,
"Return feerate estimates, either satoshi-per-kw ({style} perkw) or satoshi-per-kb ({style} perkb)."
}; };
AUTODATA(json_command, &feerates_command); AUTODATA(json_command, &feerates_command);
@ -782,7 +781,6 @@ static struct command_result *json_parse_feerate(struct command *cmd,
static const struct json_command parse_feerate_command = { static const struct json_command parse_feerate_command = {
"parsefeerate", "parsefeerate",
json_parse_feerate, json_parse_feerate,
"Return current feerate in perkw + perkb for given feerate string."
}; };
AUTODATA(json_command, &parse_feerate_command); AUTODATA(json_command, &parse_feerate_command);

View file

@ -2199,27 +2199,18 @@ static struct command_result *json_splice_signed(struct command *cmd,
static const struct json_command splice_init_command = { static const struct json_command splice_init_command = {
"splice_init", "splice_init",
json_splice_init, json_splice_init,
"Init a channel splice to {channel_id} for {relative_amount} satoshis with {initialpsbt}. "
"Returns updated {psbt} with (partial) contributions from peer"
}; };
AUTODATA(json_command, &splice_init_command); AUTODATA(json_command, &splice_init_command);
static const struct json_command splice_update_command = { static const struct json_command splice_update_command = {
"splice_update", "splice_update",
json_splice_update, json_splice_update,
"Update {channel_id} currently active negotiated splice with {psbt}. "
""
"Returns updated {psbt} with (partial) contributions from peer. "
"If {commitments_secured} is true, next call may be to splicechannel_finalize, "
"otherwise keep calling splice_update passing back in the returned PSBT until "
"{commitments_secured} is true."
}; };
AUTODATA(json_command, &splice_update_command); AUTODATA(json_command, &splice_update_command);
static const struct json_command splice_signed_command = { static const struct json_command splice_signed_command = {
"splice_signed", "splice_signed",
json_splice_signed, json_splice_signed,
"Send our {signed_psbt}'s tx sigs for {channel_id}."
}; };
AUTODATA(json_command, &splice_signed_command); AUTODATA(json_command, &splice_signed_command);
@ -2272,7 +2263,6 @@ static struct command_result *json_dev_feerate(struct command *cmd,
static const struct json_command dev_feerate_command = { static const struct json_command dev_feerate_command = {
"dev-feerate", "dev-feerate",
json_dev_feerate, json_dev_feerate,
"Set feerate for {id} to {feerate}",
.dev_only = true, .dev_only = true,
}; };
AUTODATA(json_command, &dev_feerate_command); AUTODATA(json_command, &dev_feerate_command);
@ -2328,7 +2318,6 @@ static struct command_result *json_dev_quiesce(struct command *cmd,
static const struct json_command dev_quiesce_command = { static const struct json_command dev_quiesce_command = {
"dev-quiesce", "dev-quiesce",
json_dev_quiesce, json_dev_quiesce,
"Initiate quiscence protocol with peer",
.dev_only = true, .dev_only = true,
}; };
AUTODATA(json_command, &dev_quiesce_command); AUTODATA(json_command, &dev_quiesce_command);

View file

@ -118,6 +118,5 @@ static struct command_result *json_listclosedchannels(struct command *cmd,
static const struct json_command listclosedchannels_command = { static const struct json_command listclosedchannels_command = {
"listclosedchannels", "listclosedchannels",
json_listclosedchannels, json_listclosedchannels,
"Show historical (dead) channels."
}; };
AUTODATA(json_command, &listclosedchannels_command); AUTODATA(json_command, &listclosedchannels_command);

View file

@ -897,9 +897,5 @@ discard_unopened: {
static const struct json_command close_command = { static const struct json_command close_command = {
"close", "close",
json_close, json_close,
"Close the channel with {id} "
"(either peer ID, channel ID, or short channel ID). "
"Force a unilateral close after {unilateraltimeout} seconds (default 48h). "
"If {destination} address is provided, will be used as output address."
}; };
AUTODATA(json_command, &close_command); AUTODATA(json_command, &close_command);

View file

@ -328,7 +328,6 @@ modern:
static const struct json_command listconfigs_command = { static const struct json_command listconfigs_command = {
"listconfigs", "listconfigs",
json_listconfigs, json_listconfigs,
"List all configuration options, or with [config], just that one.",
}; };
AUTODATA(json_command, &listconfigs_command); AUTODATA(json_command, &listconfigs_command);
@ -635,6 +634,5 @@ static struct command_result *json_setconfig(struct command *cmd,
static const struct json_command setconfig_command = { static const struct json_command setconfig_command = {
"setconfig", "setconfig",
json_setconfig, json_setconfig,
"Set a dynamically-adjustable config."
}; };
AUTODATA(json_command, &setconfig_command); AUTODATA(json_command, &setconfig_command);

View file

@ -254,8 +254,6 @@ static struct command_result *json_connect(struct command *cmd,
static const struct json_command connect_command = { static const struct json_command connect_command = {
"connect", "connect",
json_connect, json_connect,
"Connect to {id} at {host} (which can end in ':port' if not default). "
"{id} can also be of the form id@host"
}; };
AUTODATA(json_command, &connect_command); AUTODATA(json_command, &connect_command);
@ -915,7 +913,6 @@ static struct command_result *json_sendcustommsg(struct command *cmd,
static const struct json_command sendcustommsg_command = { static const struct json_command sendcustommsg_command = {
"sendcustommsg", "sendcustommsg",
json_sendcustommsg, json_sendcustommsg,
"Send a custom message to the peer with the given {node_id}",
}; };
AUTODATA(json_command, &sendcustommsg_command); AUTODATA(json_command, &sendcustommsg_command);
@ -937,7 +934,6 @@ static struct command_result *json_dev_suppress_gossip(struct command *cmd,
static const struct json_command dev_suppress_gossip = { static const struct json_command dev_suppress_gossip = {
"dev-suppress-gossip", "dev-suppress-gossip",
json_dev_suppress_gossip, json_dev_suppress_gossip,
"Stop this node from sending any more gossip.",
.dev_only = true, .dev_only = true,
}; };
AUTODATA(json_command, &dev_suppress_gossip); AUTODATA(json_command, &dev_suppress_gossip);
@ -959,7 +955,6 @@ static struct command_result *json_dev_report_fds(struct command *cmd,
static const struct json_command dev_report_fds = { static const struct json_command dev_report_fds = {
"dev-report-fds", "dev-report-fds",
json_dev_report_fds, json_dev_report_fds,
"Ask connectd to report status of all its open files.",
.dev_only = true, .dev_only = true,
}; };
AUTODATA(json_command, &dev_report_fds); AUTODATA(json_command, &dev_report_fds);
@ -981,7 +976,6 @@ static struct command_result *json_dev_connectd_exhaust_fds(struct command *cmd,
static const struct json_command dev_connectd_exhaust_fds = { static const struct json_command dev_connectd_exhaust_fds = {
"dev-connectd-exhaust-fds", "dev-connectd-exhaust-fds",
json_dev_connectd_exhaust_fds, json_dev_connectd_exhaust_fds,
"Make connectd run out of file descriptors",
.dev_only = true, .dev_only = true,
}; };
AUTODATA(json_command, &dev_connectd_exhaust_fds); AUTODATA(json_command, &dev_connectd_exhaust_fds);

View file

@ -346,27 +346,23 @@ static struct command_result *json_datastoreusage(struct command *cmd,
static const struct json_command datastore_command = { static const struct json_command datastore_command = {
"datastore", "datastore",
json_datastore, json_datastore,
"Add a {key} and {hex}/{string} data to the data store",
}; };
AUTODATA(json_command, &datastore_command); AUTODATA(json_command, &datastore_command);
static const struct json_command deldatastore_command = { static const struct json_command deldatastore_command = {
"deldatastore", "deldatastore",
json_deldatastore, json_deldatastore,
"Remove a {key} from the data store",
}; };
AUTODATA(json_command, &deldatastore_command); AUTODATA(json_command, &deldatastore_command);
static const struct json_command listdatastore_command = { static const struct json_command listdatastore_command = {
"listdatastore", "listdatastore",
json_listdatastore, json_listdatastore,
"List the datastore, optionally only {key}",
}; };
AUTODATA(json_command, &listdatastore_command); AUTODATA(json_command, &listdatastore_command);
static const struct json_command datastoreusage_command = { static const struct json_command datastoreusage_command = {
"datastoreusage", "datastoreusage",
json_datastoreusage, json_datastoreusage,
"List the datastore usage, starting from an optional {key}",
}; };
AUTODATA(json_command, &datastoreusage_command); AUTODATA(json_command, &datastoreusage_command);

View file

@ -3893,8 +3893,6 @@ static struct command_result *json_queryrates(struct command *cmd,
static const struct json_command queryrates_command = { static const struct json_command queryrates_command = {
"dev-queryrates", "dev-queryrates",
json_queryrates, json_queryrates,
"Ask a peer what their contribution and liquidity rates are"
" for the given {amount} and {requested_amt}",
.dev_only = true, .dev_only = true,
}; };
@ -3903,34 +3901,26 @@ AUTODATA(json_command, &queryrates_command);
static const struct json_command openchannel_init_command = { static const struct json_command openchannel_init_command = {
"openchannel_init", "openchannel_init",
json_openchannel_init, json_openchannel_init,
"Init an open channel to {id} with {initialpsbt} for {amount} satoshis. "
"Returns updated {psbt} with (partial) contributions from peer"
}; };
static const struct json_command openchannel_update_command = { static const struct json_command openchannel_update_command = {
"openchannel_update", "openchannel_update",
json_openchannel_update, json_openchannel_update,
"Update {channel_id} with {psbt}. "
"Returns updated {psbt} with (partial) contributions from peer. "
"If {commitments_secured} is true, next call should be to openchannel_signed"
}; };
static const struct json_command openchannel_signed_command = { static const struct json_command openchannel_signed_command = {
"openchannel_signed", "openchannel_signed",
json_openchannel_signed, json_openchannel_signed,
"Send our {signed_psbt}'s tx sigs for {channel_id}."
}; };
static const struct json_command openchannel_bump_command = { static const struct json_command openchannel_bump_command = {
"openchannel_bump", "openchannel_bump",
json_openchannel_bump, json_openchannel_bump,
"Attempt to bump the fee on {channel_id}'s funding transaction."
}; };
static const struct json_command openchannel_abort_command = { static const struct json_command openchannel_abort_command = {
"openchannel_abort", "openchannel_abort",
json_openchannel_abort, json_openchannel_abort,
"Abort {channel_id}'s open. Usable while `commitment_signed=false`."
}; };
AUTODATA(json_command, &openchannel_init_command); AUTODATA(json_command, &openchannel_init_command);

View file

@ -237,7 +237,6 @@ static struct command_result *json_listforwards(struct command *cmd,
static const struct json_command listforwards_command = { static const struct json_command listforwards_command = {
"listforwards", "listforwards",
json_listforwards, json_listforwards,
"List all forwarded payments and their information optionally filtering by [status], [in_channel] and [out_channel]"
}; };
AUTODATA(json_command, &listforwards_command); AUTODATA(json_command, &listforwards_command);
@ -301,6 +300,5 @@ static struct command_result *json_delforward(struct command *cmd,
static const struct json_command delforward_command = { static const struct json_command delforward_command = {
"delforward", "delforward",
json_delforward, json_delforward,
"Delete a forwarded payment by [in_channel], [in_htlc_id] and [status]"
}; };
AUTODATA(json_command, &delforward_command); AUTODATA(json_command, &delforward_command);

View file

@ -371,9 +371,6 @@ static struct command_result *json_setleaserates(struct command *cmd,
static const struct json_command setleaserates_command = { static const struct json_command setleaserates_command = {
"setleaserates", "setleaserates",
json_setleaserates, json_setleaserates,
"Called by plugin to set the node's present channel lease rates."
" Not to be set without having a plugin which can handle"
" `openchannel2` hooks.",
}; };
AUTODATA(json_command, &setleaserates_command); AUTODATA(json_command, &setleaserates_command);
@ -422,7 +419,6 @@ static struct command_result *json_addgossip(struct command *cmd,
static const struct json_command addgossip_command = { static const struct json_command addgossip_command = {
"addgossip", "addgossip",
json_addgossip, json_addgossip,
"Inject gossip {message} into gossipd"
}; };
AUTODATA(json_command, &addgossip_command); AUTODATA(json_command, &addgossip_command);
@ -450,7 +446,6 @@ json_dev_set_max_scids_encode_size(struct command *cmd,
static const struct json_command dev_set_max_scids_encode_size = { static const struct json_command dev_set_max_scids_encode_size = {
"dev-set-max-scids-encode-size", "dev-set-max-scids-encode-size",
json_dev_set_max_scids_encode_size, json_dev_set_max_scids_encode_size,
"Set {max} bytes of short_channel_ids per reply_channel_range",
.dev_only = true, .dev_only = true,
}; };
AUTODATA(json_command, &dev_set_max_scids_encode_size); AUTODATA(json_command, &dev_set_max_scids_encode_size);
@ -477,7 +472,6 @@ static struct command_result *json_dev_gossip_set_time(struct command *cmd,
static const struct json_command dev_gossip_set_time = { static const struct json_command dev_gossip_set_time = {
"dev-gossip-set-time", "dev-gossip-set-time",
json_dev_gossip_set_time, json_dev_gossip_set_time,
"Ask gossipd to update the current time.",
.dev_only = true, .dev_only = true,
}; };
AUTODATA(json_command, &dev_gossip_set_time); AUTODATA(json_command, &dev_gossip_set_time);

View file

@ -288,6 +288,5 @@ static struct command_result *json_makesecret(struct command *cmd,
static const struct json_command makesecret_command = { static const struct json_command makesecret_command = {
"makesecret", "makesecret",
&json_makesecret, &json_makesecret,
"Get a pseudorandom secret key, using some {hex} data."
}; };
AUTODATA(json_command, &makesecret_command); AUTODATA(json_command, &makesecret_command);

View file

@ -1247,11 +1247,6 @@ static struct command_result *json_invoice(struct command *cmd,
static const struct json_command invoice_command = { static const struct json_command invoice_command = {
"invoice", "invoice",
json_invoice, json_invoice,
"Create an invoice for {msatoshi} with {label} "
"and {description} with optional {expiry} seconds "
"(default 1 week), optional {fallbacks} address list"
"(default empty list) and optional {preimage} "
"(default autogenerated)"
}; };
AUTODATA(json_command, &invoice_command); AUTODATA(json_command, &invoice_command);
@ -1380,8 +1375,6 @@ static struct command_result *json_listinvoices(struct command *cmd,
static const struct json_command listinvoices_command = { static const struct json_command listinvoices_command = {
"listinvoices", "listinvoices",
json_listinvoices, json_listinvoices,
"Show invoice matching {label}, {invstring}, {payment_hash} or {offerid} (or all, if "
"no query parameter specified)"
}; };
AUTODATA(json_command, &listinvoices_command); AUTODATA(json_command, &listinvoices_command);
@ -1467,7 +1460,6 @@ static struct command_result *json_delinvoice(struct command *cmd,
static const struct json_command delinvoice_command = { static const struct json_command delinvoice_command = {
"delinvoice", "delinvoice",
json_delinvoice, json_delinvoice,
"Delete unpaid invoice {label} with {status}",
}; };
AUTODATA(json_command, &delinvoice_command); AUTODATA(json_command, &delinvoice_command);
@ -1515,8 +1507,6 @@ static struct command_result *json_waitanyinvoice(struct command *cmd,
static const struct json_command waitanyinvoice_command = { static const struct json_command waitanyinvoice_command = {
"waitanyinvoice", "waitanyinvoice",
json_waitanyinvoice, json_waitanyinvoice,
"Wait for the next invoice to be paid, after {lastpay_index} (if supplied). "
"If {timeout} seconds is reached while waiting, fail with an error."
}; };
AUTODATA(json_command, &waitanyinvoice_command); AUTODATA(json_command, &waitanyinvoice_command);
@ -1564,7 +1554,6 @@ static struct command_result *json_waitinvoice(struct command *cmd,
static const struct json_command waitinvoice_command = { static const struct json_command waitinvoice_command = {
"waitinvoice", "waitinvoice",
json_waitinvoice, json_waitinvoice,
"Wait for an incoming payment matching the invoice with {label}, or if the invoice expires"
}; };
AUTODATA(json_command, &waitinvoice_command); AUTODATA(json_command, &waitinvoice_command);
@ -1602,7 +1591,6 @@ static struct command_result *json_decodepay(struct command *cmd,
static const struct json_command decodepay_command = { static const struct json_command decodepay_command = {
"decodepay", "decodepay",
json_decodepay, json_decodepay,
"Decode {bolt11}, using {description} if necessary"
}; };
AUTODATA(json_command, &decodepay_command); AUTODATA(json_command, &decodepay_command);
@ -1853,7 +1841,6 @@ static struct command_result *json_createinvoice(struct command *cmd,
static const struct json_command createinvoice_command = { static const struct json_command createinvoice_command = {
"createinvoice", "createinvoice",
json_createinvoice, json_createinvoice,
"Lowlevel command to sign and create invoice {invstring}, resolved with {preimage}, using unique {label}."
}; };
AUTODATA(json_command, &createinvoice_command); AUTODATA(json_command, &createinvoice_command);
@ -1911,7 +1898,6 @@ static struct command_result *json_preapproveinvoice(struct command *cmd,
static const struct json_command preapproveinvoice_command = { static const struct json_command preapproveinvoice_command = {
"preapproveinvoice", "preapproveinvoice",
json_preapproveinvoice, json_preapproveinvoice,
"Ask the HSM to preapprove an invoice."
}; };
AUTODATA(json_command, &preapproveinvoice_command); AUTODATA(json_command, &preapproveinvoice_command);
@ -1970,7 +1956,6 @@ static struct command_result *json_preapprovekeysend(struct command *cmd,
static const struct json_command preapprovekeysend_command = { static const struct json_command preapprovekeysend_command = {
"preapprovekeysend", "preapprovekeysend",
json_preapprovekeysend, json_preapprovekeysend,
"Ask the HSM to preapprove a keysend payment."
}; };
AUTODATA(json_command, &preapprovekeysend_command); AUTODATA(json_command, &preapprovekeysend_command);
@ -2025,7 +2010,6 @@ static struct command_result *json_signinvoice(struct command *cmd,
static const struct json_command signinvoice_command = { static const struct json_command signinvoice_command = {
"signinvoice", "signinvoice",
json_signinvoice, json_signinvoice,
"Lowlevel command to sign invoice {invstring}."
}; };
AUTODATA(json_command, &signinvoice_command); AUTODATA(json_command, &signinvoice_command);

View file

@ -187,7 +187,6 @@ static struct command_result *json_help(struct command *cmd,
static const struct json_command help_command = { static const struct json_command help_command = {
"help", "help",
json_help, json_help,
"List available commands, or give verbose help on one {command}.",
}; };
AUTODATA(json_command, &help_command); AUTODATA(json_command, &help_command);
@ -248,7 +247,6 @@ static struct command_result *json_stop(struct command *cmd,
static const struct json_command stop_command = { static const struct json_command stop_command = {
"stop", "stop",
json_stop, json_stop,
"Shut down the lightningd process"
}; };
AUTODATA(json_command, &stop_command); AUTODATA(json_command, &stop_command);
@ -354,7 +352,6 @@ static struct command_result *json_recover(struct command *cmd,
static const struct json_command recover_command = { static const struct json_command recover_command = {
"recover", "recover",
json_recover, json_recover,
"Restart an unused lightning node with --recover"
}; };
AUTODATA(json_command, &recover_command); AUTODATA(json_command, &recover_command);
@ -430,7 +427,6 @@ static struct command_result *json_dev(struct command *cmd UNUSED,
static const struct json_command dev_command = { static const struct json_command dev_command = {
"dev", "dev",
json_dev, json_dev,
"Developer command test multiplexer",
.dev_only = true, .dev_only = true,
}; };
AUTODATA(json_command, &dev_command); AUTODATA(json_command, &dev_command);
@ -466,7 +462,6 @@ static void json_add_help_command(struct command *cmd,
json_command->name)); json_command->name));
json_object_start(response, NULL); json_object_start(response, NULL);
json_add_string(response, "command", usage); json_add_string(response, "command", usage);
json_add_string(response, "description", json_command->description);
json_object_end(response); json_object_end(response);
} }
@ -1693,7 +1688,6 @@ static struct command_result *json_check(struct command *cmd,
static const struct json_command check_command = { static const struct json_command check_command = {
"check", "check",
json_check, json_check,
"Don't run {command_to_check}, just verify parameters.",
}; };
AUTODATA(json_command, &check_command); AUTODATA(json_command, &check_command);
@ -1718,7 +1712,6 @@ static struct command_result *json_notifications(struct command *cmd,
static const struct json_command notifications_command = { static const struct json_command notifications_command = {
"notifications", "notifications",
json_notifications, json_notifications,
"{enable} notifications",
}; };
AUTODATA(json_command, &notifications_command); AUTODATA(json_command, &notifications_command);
@ -1743,7 +1736,6 @@ static struct command_result *json_batching(struct command *cmd,
static const struct json_command batching_command = { static const struct json_command batching_command = {
"batching", "batching",
json_batching, json_batching,
"Database transaction batching {enable}",
}; };
AUTODATA(json_command, &batching_command); AUTODATA(json_command, &batching_command);
@ -1768,6 +1760,5 @@ static struct command_result *json_deprecations(struct command *cmd,
static const struct json_command deprecations_command = { static const struct json_command deprecations_command = {
"deprecations", "deprecations",
json_deprecations, json_deprecations,
"Set/unset deprecated APIs on this JSON connection (for developer testing)",
}; };
AUTODATA(json_command, &deprecations_command); AUTODATA(json_command, &deprecations_command);

View file

@ -59,7 +59,6 @@ struct json_command {
const char *buffer, const char *buffer,
const jsmntok_t *obj, const jsmntok_t *obj,
const jsmntok_t *params); const jsmntok_t *params);
const char *description;
bool dev_only; bool dev_only;
const char *depr_start, *depr_end; const char *depr_start, *depr_end;
/* Special hook if we want raw access for check command */ /* Special hook if we want raw access for check command */

View file

@ -1173,6 +1173,5 @@ static struct command_result *json_getlog(struct command *cmd,
static const struct json_command getlog_command = { static const struct json_command getlog_command = {
"getlog", "getlog",
json_getlog, json_getlog,
"Show logs, with optional log {level} (info|unusual|debug|io)"
}; };
AUTODATA(json_command, &getlog_command); AUTODATA(json_command, &getlog_command);

View file

@ -82,7 +82,6 @@ static struct command_result *json_memdump(struct command *cmd,
static const struct json_command dev_memdump_command = { static const struct json_command dev_memdump_command = {
"dev-memdump", "dev-memdump",
json_memdump, json_memdump,
"Show memory objects currently in use",
.dev_only = true, .dev_only = true,
}; };
AUTODATA(json_command, &dev_memdump_command); AUTODATA(json_command, &dev_memdump_command);
@ -267,7 +266,6 @@ static struct command_result *json_memleak(struct command *cmd,
static const struct json_command dev_memleak_command = { static const struct json_command dev_memleak_command = {
"dev-memleak", "dev-memleak",
json_memleak, json_memleak,
"Show unreferenced memory objects",
.dev_only = true, .dev_only = true,
}; };
AUTODATA(json_command, &dev_memleak_command); AUTODATA(json_command, &dev_memleak_command);

View file

@ -123,7 +123,6 @@ static struct command_result *json_createoffer(struct command *cmd,
static const struct json_command createoffer_command = { static const struct json_command createoffer_command = {
"createoffer", "createoffer",
json_createoffer, json_createoffer,
"Create and sign an offer {bolt12} with and optional {label}."
}; };
AUTODATA(json_command, &createoffer_command); AUTODATA(json_command, &createoffer_command);
@ -183,8 +182,6 @@ static struct command_result *json_listoffers(struct command *cmd,
static const struct json_command listoffers_command = { static const struct json_command listoffers_command = {
"listoffers", "listoffers",
json_listoffers, json_listoffers,
"If {offer_id} is set, show that."
" Otherwise, if {showdisabled} is true, list all, otherwise just non-disabled ones."
}; };
AUTODATA(json_command, &listoffers_command); AUTODATA(json_command, &listoffers_command);
@ -226,7 +223,6 @@ static struct command_result *json_disableoffer(struct command *cmd,
static const struct json_command disableoffer_command = { static const struct json_command disableoffer_command = {
"disableoffer", "disableoffer",
json_disableoffer, json_disableoffer,
"Disable offer {offer_id}",
}; };
AUTODATA(json_command, &disableoffer_command); AUTODATA(json_command, &disableoffer_command);
@ -493,7 +489,6 @@ static struct command_result *json_createinvoicerequest(struct command *cmd,
static const struct json_command createinvreq_command = { static const struct json_command createinvreq_command = {
"createinvoicerequest", "createinvoicerequest",
json_createinvoicerequest, json_createinvoicerequest,
"Create and sign an invoice_request {bolt12}, with {recurrence_label} if recurring, filling in payer_info and payer_key."
}; };
AUTODATA(json_command, &createinvreq_command); AUTODATA(json_command, &createinvreq_command);
@ -529,7 +524,6 @@ static struct command_result *json_payersign(struct command *cmd,
static const struct json_command payersign_command = { static const struct json_command payersign_command = {
"payersign", "payersign",
json_payersign, json_payersign,
"Sign {messagename} {fieldname} {merkle} (a 32-byte hex string) using public {tweak}",
}; };
AUTODATA(json_command, &payersign_command); AUTODATA(json_command, &payersign_command);
@ -590,8 +584,6 @@ static struct command_result *json_listinvoicerequests(struct command *cmd,
static const struct json_command listinvoicerequests_command = { static const struct json_command listinvoicerequests_command = {
"listinvoicerequests", "listinvoicerequests",
json_listinvoicerequests, json_listinvoicerequests,
"If {invreq_id} is set, show that."
" Otherwise, if {showdisabled} is true, list all, otherwise just non-disabled ones."
}; };
AUTODATA(json_command, &listinvoicerequests_command); AUTODATA(json_command, &listinvoicerequests_command);
@ -634,7 +626,6 @@ static struct command_result *json_disableinvoicerequest(struct command *cmd,
static const struct json_command disableinvoicerequest_command = { static const struct json_command disableinvoicerequest_command = {
"disableinvoicerequest", "disableinvoicerequest",
json_disableinvoicerequest, json_disableinvoicerequest,
"Disable invoice_request {invreq_id}",
}; };
AUTODATA(json_command, &disableinvoicerequest_command); AUTODATA(json_command, &disableinvoicerequest_command);

View file

@ -258,7 +258,6 @@ static struct command_result *json_injectonionmessage(struct command *cmd,
static const struct json_command injectonionmessage_command = { static const struct json_command injectonionmessage_command = {
"injectonionmessage", "injectonionmessage",
json_injectonionmessage, json_injectonionmessage,
"Unwrap using {blinding}, encoded over {hops} (id, tlv)"
}; };
AUTODATA(json_command, &injectonionmessage_command); AUTODATA(json_command, &injectonionmessage_command);
@ -314,6 +313,5 @@ static struct command_result *json_decryptencrypteddata(struct command *cmd,
static const struct json_command decryptencrypteddata_command = { static const struct json_command decryptencrypteddata_command = {
"decryptencrypteddata", "decryptencrypteddata",
json_decryptencrypteddata, json_decryptencrypteddata,
"Decrypt {encrypted_data} using {blinding}, return decryption and next blinding"
}; };
AUTODATA(json_command, &decryptencrypteddata_command); AUTODATA(json_command, &decryptencrypteddata_command);

View file

@ -1665,31 +1665,23 @@ static struct command_result *json_recoverchannel(struct command *cmd,
static const struct json_command fundchannel_start_command = { static const struct json_command fundchannel_start_command = {
"fundchannel_start", "fundchannel_start",
json_fundchannel_start, json_fundchannel_start,
"Start fund channel with {id} using {amount} satoshis. "
"Returns a bech32 address to use as an output for a funding transaction."
}; };
AUTODATA(json_command, &fundchannel_start_command); AUTODATA(json_command, &fundchannel_start_command);
static const struct json_command fundchannel_cancel_command = { static const struct json_command fundchannel_cancel_command = {
"fundchannel_cancel", "fundchannel_cancel",
json_fundchannel_cancel, json_fundchannel_cancel,
"Cancel inflight channel establishment with peer {id}."
}; };
AUTODATA(json_command, &fundchannel_cancel_command); AUTODATA(json_command, &fundchannel_cancel_command);
static const struct json_command fundchannel_complete_command = { static const struct json_command fundchannel_complete_command = {
"fundchannel_complete", "fundchannel_complete",
json_fundchannel_complete, json_fundchannel_complete,
"Complete channel establishment with peer {id} for funding transaction"
"with {psbt}. Returns true on success, false otherwise."
}; };
AUTODATA(json_command, &fundchannel_complete_command); AUTODATA(json_command, &fundchannel_complete_command);
static const struct json_command json_commitchan_command = { static const struct json_command json_commitchan_command = {
"recoverchannel", "recoverchannel",
json_recoverchannel, json_recoverchannel,
"Populate the DB with a channel and peer"
"Used for recovering the channel using DLP."
"This needs param in the form of an array [scb1,scb2,...]"
}; };
AUTODATA(json_command, &json_commitchan_command); AUTODATA(json_command, &json_commitchan_command);

View file

@ -1342,7 +1342,6 @@ static struct command_result *json_sendonion(struct command *cmd,
static const struct json_command sendonion_command = { static const struct json_command sendonion_command = {
"sendonion", "sendonion",
json_sendonion, json_sendonion,
"Send a payment with a pre-computed onion."
}; };
AUTODATA(json_command, &sendonion_command); AUTODATA(json_command, &sendonion_command);
@ -1598,7 +1597,6 @@ static struct command_result *json_sendpay(struct command *cmd,
static const struct json_command sendpay_command = { static const struct json_command sendpay_command = {
"sendpay", "sendpay",
json_sendpay, json_sendpay,
"Send along {route} in return for preimage of {payment_hash}"
}; };
AUTODATA(json_command, &sendpay_command); AUTODATA(json_command, &sendpay_command);
@ -1643,8 +1641,6 @@ static struct command_result *json_waitsendpay(struct command *cmd,
static const struct json_command waitsendpay_command = { static const struct json_command waitsendpay_command = {
"waitsendpay", "waitsendpay",
json_waitsendpay, json_waitsendpay,
"Wait for payment attempt on {payment_hash} to succeed or fail, "
"but only up to {timeout} seconds."
}; };
AUTODATA(json_command, &waitsendpay_command); AUTODATA(json_command, &waitsendpay_command);
@ -1805,7 +1801,6 @@ static struct command_result *json_listsendpays(struct command *cmd,
static const struct json_command listsendpays_command = { static const struct json_command listsendpays_command = {
"listsendpays", "listsendpays",
json_listsendpays, json_listsendpays,
"Show sendpay, old and current, optionally limiting to {bolt11} or {payment_hash}."
}; };
AUTODATA(json_command, &listsendpays_command); AUTODATA(json_command, &listsendpays_command);
@ -1908,7 +1903,6 @@ static struct command_result *json_delpay(struct command *cmd,
static const struct json_command delpay_command = { static const struct json_command delpay_command = {
"delpay", "delpay",
json_delpay, json_delpay,
"Delete payment with {payment_hash} and {status}",
}; };
AUTODATA(json_command, &delpay_command); AUTODATA(json_command, &delpay_command);
@ -1974,6 +1968,5 @@ static struct command_result *json_createonion(struct command *cmd,
static const struct json_command createonion_command = { static const struct json_command createonion_command = {
"createonion", "createonion",
json_createonion, json_createonion,
"Create an onion going through the provided nodes, each with its own payload"
}; };
AUTODATA(json_command, &createonion_command); AUTODATA(json_command, &createonion_command);

View file

@ -2305,7 +2305,6 @@ static struct command_result *json_listpeers(struct command *cmd,
static const struct json_command listpeers_command = { static const struct json_command listpeers_command = {
"listpeers", "listpeers",
json_listpeers, json_listpeers,
"Show current peers, if {level} is set, include logs for {id}"
}; };
/* Comment added to satisfice AUTODATA */ /* Comment added to satisfice AUTODATA */
AUTODATA(json_command, &listpeers_command); AUTODATA(json_command, &listpeers_command);
@ -2358,7 +2357,6 @@ static struct command_result *json_staticbackup(struct command *cmd,
static const struct json_command staticbackup_command = { static const struct json_command staticbackup_command = {
"staticbackup", "staticbackup",
json_staticbackup, json_staticbackup,
"Returns SCB of all the channels currently present in the DB"
}; };
/* Comment added to satisfice AUTODATA */ /* Comment added to satisfice AUTODATA */
AUTODATA(json_command, &staticbackup_command); AUTODATA(json_command, &staticbackup_command);
@ -2418,7 +2416,6 @@ static struct command_result *json_listpeerchannels(struct command *cmd,
static const struct json_command listpeerchannels_command = { static const struct json_command listpeerchannels_command = {
"listpeerchannels", "listpeerchannels",
json_listpeerchannels, json_listpeerchannels,
"Show channels with direct peers."
}; };
AUTODATA(json_command, &listpeerchannels_command); AUTODATA(json_command, &listpeerchannels_command);
@ -2658,7 +2655,6 @@ static struct command_result *json_disconnect(struct command *cmd,
static const struct json_command disconnect_command = { static const struct json_command disconnect_command = {
"disconnect", "disconnect",
json_disconnect, json_disconnect,
"Disconnect from {id} that has previously been connected to using connect; with {force} set, even if it has a current channel"
}; };
AUTODATA(json_command, &disconnect_command); AUTODATA(json_command, &disconnect_command);
@ -2796,7 +2792,6 @@ static struct command_result *json_getinfo(struct command *cmd,
static const struct json_command getinfo_command = { static const struct json_command getinfo_command = {
"getinfo", "getinfo",
json_getinfo, json_getinfo,
"Show information about this node"
}; };
AUTODATA(json_command, &getinfo_command); AUTODATA(json_command, &getinfo_command);
@ -2900,8 +2895,6 @@ static struct command_result *json_waitblockheight(struct command *cmd,
static const struct json_command waitblockheight_command = { static const struct json_command waitblockheight_command = {
"waitblockheight", "waitblockheight",
&json_waitblockheight, &json_waitblockheight,
"Wait for the blockchain to reach {blockheight}, up to "
"{timeout} seconds."
}; };
AUTODATA(json_command, &waitblockheight_command); AUTODATA(json_command, &waitblockheight_command);
@ -3167,11 +3160,6 @@ static struct command_result *json_setchannel(struct command *cmd,
static const struct json_command setchannel_command = { static const struct json_command setchannel_command = {
"setchannel", "setchannel",
json_setchannel, json_setchannel,
"Sets fees and/or htlc_max for channel with {id} "
"(either peer ID, channel ID, short channel ID or 'all'). "
"If {feebase}, {feeppm} or {htlcmax} is missing, it is unchanged."
"{base} can also be defined in other units, for example '1sat'. "
"If {id} is 'all', the fees will be applied for all channels. "
}; };
AUTODATA(json_command, &setchannel_command); AUTODATA(json_command, &setchannel_command);
@ -3246,7 +3234,6 @@ static struct command_result *json_sign_last_tx(struct command *cmd,
static const struct json_command dev_sign_last_tx = { static const struct json_command dev_sign_last_tx = {
"dev-sign-last-tx", "dev-sign-last-tx",
json_sign_last_tx, json_sign_last_tx,
"Sign and show the last commitment transaction with peer {id}",
.dev_only = true, .dev_only = true,
}; };
AUTODATA(json_command, &dev_sign_last_tx); AUTODATA(json_command, &dev_sign_last_tx);
@ -3272,7 +3259,6 @@ static struct command_result *json_dev_fail(struct command *cmd,
static const struct json_command dev_fail_command = { static const struct json_command dev_fail_command = {
"dev-fail", "dev-fail",
json_dev_fail, json_dev_fail,
"Fail with peer {id}",
.dev_only = true, .dev_only = true,
}; };
AUTODATA(json_command, &dev_fail_command); AUTODATA(json_command, &dev_fail_command);
@ -3320,7 +3306,6 @@ static struct command_result *json_dev_reenable_commit(struct command *cmd,
static const struct json_command dev_reenable_commit = { static const struct json_command dev_reenable_commit = {
"dev-reenable-commit", "dev-reenable-commit",
json_dev_reenable_commit, json_dev_reenable_commit,
"Re-enable the commit timer on peer {id}",
.dev_only = true, .dev_only = true,
}; };
AUTODATA(json_command, &dev_reenable_commit); AUTODATA(json_command, &dev_reenable_commit);
@ -3434,7 +3419,6 @@ static struct command_result *json_dev_forget_channel(struct command *cmd,
static const struct json_command dev_forget_channel_command = { static const struct json_command dev_forget_channel_command = {
"dev-forget-channel", "dev-forget-channel",
json_dev_forget_channel, json_dev_forget_channel,
"Forget the channel with peer {id}, ignore UTXO check with {force}='true'.",
.dev_only = true, .dev_only = true,
}; };
AUTODATA(json_command, &dev_forget_channel_command); AUTODATA(json_command, &dev_forget_channel_command);

View file

@ -2924,7 +2924,6 @@ static struct command_result *json_dev_ignore_htlcs(struct command *cmd,
static const struct json_command dev_ignore_htlcs = { static const struct json_command dev_ignore_htlcs = {
"dev-ignore-htlcs", "dev-ignore-htlcs",
json_dev_ignore_htlcs, json_dev_ignore_htlcs,
"Set ignoring incoming HTLCs for peer {id} to {ignore}",
.dev_only = true, .dev_only = true,
}; };
@ -3005,6 +3004,5 @@ static struct command_result *json_listhtlcs(struct command *cmd,
static const struct json_command listhtlcs_command = { static const struct json_command listhtlcs_command = {
"listhtlcs", "listhtlcs",
json_listhtlcs, json_listhtlcs,
"List all known HTLCS (optionally, just for [id] (scid or channel id))"
}; };
AUTODATA(json_command, &listhtlcs_command); AUTODATA(json_command, &listhtlcs_command);

View file

@ -92,6 +92,5 @@ static struct command_result *json_ping(struct command *cmd,
static const struct json_command ping_command = { static const struct json_command ping_command = {
"ping", "ping",
json_ping, json_ping,
"Send peer {id} a ping of length {len} (default 128) asking for {pongbytes} (default 128)"
}; };
AUTODATA(json_command, &ping_command); AUTODATA(json_command, &ping_command);

View file

@ -1389,12 +1389,11 @@ static const char *plugin_rpcmethod_add(struct plugin *plugin,
const char *buffer, const char *buffer,
const jsmntok_t *meth) const jsmntok_t *meth)
{ {
const jsmntok_t *nametok, *desctok, *usagetok, *deprtok; const jsmntok_t *nametok, *usagetok, *deprtok;
struct json_command *cmd; struct json_command *cmd;
const char *usage, *err; const char *usage, *err;
nametok = json_get_member(buffer, meth, "name"); nametok = json_get_member(buffer, meth, "name");
desctok = json_get_member(buffer, meth, "description");
usagetok = json_get_member(buffer, meth, "usage"); usagetok = json_get_member(buffer, meth, "usage");
deprtok = json_get_member(buffer, meth, "deprecated"); deprtok = json_get_member(buffer, meth, "deprecated");
@ -1404,13 +1403,6 @@ static const char *plugin_rpcmethod_add(struct plugin *plugin,
meth->end - meth->start, buffer + meth->start); meth->end - meth->start, buffer + meth->start);
} }
if (!desctok || desctok->type != JSMN_STRING) {
return tal_fmt(plugin,
"rpcmethod does not have a string "
"\"description\": %.*s",
meth->end - meth->start, buffer + meth->start);
}
if (usagetok && usagetok->type != JSMN_STRING) { if (usagetok && usagetok->type != JSMN_STRING) {
return tal_fmt(plugin, return tal_fmt(plugin,
"\"usage\" is not a string: %.*s", "\"usage\" is not a string: %.*s",
@ -1419,7 +1411,6 @@ static const char *plugin_rpcmethod_add(struct plugin *plugin,
cmd = notleak(tal(plugin, struct json_command)); cmd = notleak(tal(plugin, struct json_command));
cmd->name = json_strdup(cmd, buffer, nametok); cmd->name = json_strdup(cmd, buffer, nametok);
cmd->description = json_strdup(cmd, buffer, desctok);
if (usagetok) if (usagetok)
usage = json_strdup(tmpctx, buffer, usagetok); usage = json_strdup(tmpctx, buffer, usagetok);
else else

View file

@ -309,6 +309,5 @@ static struct command_result *json_plugin_control(struct command *cmd,
static const struct json_command plugin_control_command = { static const struct json_command plugin_control_command = {
"plugin", "plugin",
json_plugin_control, json_plugin_control,
"Control plugins (start, stop, startdir, rescan, list)",
}; };
AUTODATA(json_command, &plugin_control_command); AUTODATA(json_command, &plugin_control_command);

View file

@ -408,7 +408,6 @@ static struct command_result *json_showrunes(struct command *cmd,
static const struct json_command showrunes_command = { static const struct json_command showrunes_command = {
"showrunes", "showrunes",
json_showrunes, json_showrunes,
"Show the list of runes or decode an optional {rune}."
}; };
AUTODATA(json_command, &showrunes_command); AUTODATA(json_command, &showrunes_command);
@ -587,14 +586,12 @@ static struct command_result *json_createrune(struct command *cmd,
static const struct json_command creatrune_command = { static const struct json_command creatrune_command = {
"createrune", "createrune",
json_createrune, json_createrune,
"Create or restrict an optional {rune} with optional {restrictions} and returns {rune}"
}; };
AUTODATA(json_command, &creatrune_command); AUTODATA(json_command, &creatrune_command);
static const struct json_command invokerune_command = { static const struct json_command invokerune_command = {
"invokerune", "invokerune",
json_createrune, json_createrune,
"Invoke or restrict an optional {rune} with optional {restrictions} and returns {rune}"
}; };
AUTODATA(json_command, &invokerune_command); AUTODATA(json_command, &invokerune_command);
@ -698,14 +695,12 @@ static struct command_result *json_blacklistrune(struct command *cmd,
static const struct json_command blacklistrune_command = { static const struct json_command blacklistrune_command = {
"blacklistrune", "blacklistrune",
json_blacklistrune, json_blacklistrune,
"Blacklist a rune or range of runes by taking an optional {start} and an optional {end} and returns {blacklist} array containing {start}, {end}"
}; };
AUTODATA(json_command, &blacklistrune_command); AUTODATA(json_command, &blacklistrune_command);
static const struct json_command destroyrune_command = { static const struct json_command destroyrune_command = {
"destroyrune", "destroyrune",
json_blacklistrune, json_blacklistrune,
"Destroy a rune or range of runes by taking an optional {start} and an optional {end} and returns {blacklist} array containing {start}, {end}"
}; };
AUTODATA(json_command, &destroyrune_command); AUTODATA(json_command, &destroyrune_command);
@ -994,6 +989,5 @@ static struct command_result *json_checkrune(struct command *cmd,
static const struct json_command checkrune_command = { static const struct json_command checkrune_command = {
"checkrune", "checkrune",
json_checkrune, json_checkrune,
"Checks rune for validity with required {rune} and optional {nodeid}, {method}, {params} and returns {valid: true} or error message"
}; };
AUTODATA(json_command, &checkrune_command); AUTODATA(json_command, &checkrune_command);

View file

@ -112,7 +112,6 @@ static struct command_result *json_signmessage(struct command *cmd,
static const struct json_command json_signmessage_cmd = { static const struct json_command json_signmessage_cmd = {
"signmessage", "signmessage",
json_signmessage, json_signmessage,
"Create a digital signature of {message}",
}; };
AUTODATA(json_command, &json_signmessage_cmd); AUTODATA(json_command, &json_signmessage_cmd);
@ -242,6 +241,5 @@ static struct command_result *json_checkmessage(struct command *cmd,
static const struct json_command json_checkmessage_cmd = { static const struct json_command json_checkmessage_cmd = {
"checkmessage", "checkmessage",
json_checkmessage, json_checkmessage,
"Verify a digital signature {zbase} of {message} signed with {pubkey}",
}; };
AUTODATA(json_command, &json_checkmessage_cmd); AUTODATA(json_command, &json_checkmessage_cmd);

View file

@ -214,6 +214,5 @@ static struct command_result *json_wait(struct command *cmd,
static const struct json_command wait_command = { static const struct json_command wait_command = {
"wait", "wait",
json_wait, json_wait,
"Wait for {subsystem} {indexname} to reach or exceed {value})"
}; };
AUTODATA(json_command, &wait_command); AUTODATA(json_command, &wait_command);

View file

@ -104,10 +104,8 @@ def verify_rune(plugin, rune, rpc_method, rpc_params):
def process_help_response(help_response): def process_help_response(help_response):
# Use json5.loads due to single quotes in response # Use json5.loads due to single quotes in response
processed_res = json5.loads(str(help_response))["help"] processed_res = json5.loads(str(help_response))["help"]
line = "\n---------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\n" line = "\n\n---------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n\n"
processed_html_res = "" processed_html_res = "\n"
for row in processed_res: for row in processed_res:
processed_html_res += f"Command: {row['command']}\n" processed_html_res += row['command'] + line
processed_html_res += f"Description: {row['description']}\n"
processed_html_res += line
return processed_html_res return processed_html_res

View file

@ -48,8 +48,7 @@ def test_plugin_start(node_factory):
assert l1.rpc.help("testmethod") == { assert l1.rpc.help("testmethod") == {
'help': [ 'help': [
{ {
'command': 'testmethod ', 'command': 'testmethod '
'description': 'This is a test'
} }
], ],
'format-hint': 'simple' 'format-hint': 'simple'

View file

@ -149,7 +149,7 @@ def test_clnrest_list_methods(node_factory):
http_session = http_session_with_retry() http_session = http_session_with_retry()
response = http_session.get(base_url + '/v1/list-methods', verify=ca_cert) response = http_session.get(base_url + '/v1/list-methods', verify=ca_cert)
assert response.status_code == 200 assert response.status_code == 200
assert response.text.find('Command: getinfo') > 0 assert response.text.find('getinfo') > 0
def test_clnrest_unknown_method(node_factory): def test_clnrest_unknown_method(node_factory):

View file

@ -974,7 +974,7 @@ def test_cli(node_factory):
.format(l1.daemon.lightning_dir), .format(l1.daemon.lightning_dir),
'help']).decode('utf-8') 'help']).decode('utf-8')
# Test some known output. # Test some known output.
assert 'help [command]\n List available commands, or give verbose help on one {command}' in out assert 'addgossip message\n\naddpsbtoutput' in out
# Check JSON id is as expected # Check JSON id is as expected
l1.daemon.wait_for_log(r'jsonrpc#[0-9]*: "cli:help#[0-9]*"\[IN\]') l1.daemon.wait_for_log(r'jsonrpc#[0-9]*: "cli:help#[0-9]*"\[IN\]')
@ -988,7 +988,6 @@ def test_cli(node_factory):
'help']).decode('utf-8') 'help']).decode('utf-8')
j, _ = json.JSONDecoder().raw_decode(out) j, _ = json.JSONDecoder().raw_decode(out)
assert j['help'][0]['command'] is not None assert j['help'][0]['command'] is not None
assert j['help'][0]['description'] is not None
# Test keyword input (autodetect) # Test keyword input (autodetect)
out = subprocess.check_output(['cli/lightning-cli', out = subprocess.check_output(['cli/lightning-cli',
@ -1179,7 +1178,7 @@ def test_cli_commando(node_factory):
.format(l1.daemon.lightning_dir), .format(l1.daemon.lightning_dir),
'help']).decode('utf-8') 'help']).decode('utf-8')
# Test some known output. # Test some known output.
assert 'help [command]\n List available commands, or give verbose help on one {command}' in out assert 'addgossip message\n\naddpsbtoutput' in out
# Check JSON id is as expected # Check JSON id is as expected
l1.daemon.wait_for_log(r'jsonrpc#[0-9]*: "cli:help#[0-9]*"\[IN\]') l1.daemon.wait_for_log(r'jsonrpc#[0-9]*: "cli:help#[0-9]*"\[IN\]')
@ -1286,7 +1285,7 @@ def test_daemon_option(node_factory):
'--lightning-dir={}' '--lightning-dir={}'
.format(l1.daemon.lightning_dir), .format(l1.daemon.lightning_dir),
'help']).decode('utf-8') 'help']).decode('utf-8')
assert 'help [command]\n List available commands, or give verbose help on one {command}' in out assert 'addgossip message\n\naddpsbtoutput' in out
subprocess.run(['cli/lightning-cli', subprocess.run(['cli/lightning-cli',
'--network={}'.format(TEST_NETWORK), '--network={}'.format(TEST_NETWORK),

View file

@ -137,7 +137,6 @@ static struct command_result *json_reserveinputs(struct command *cmd,
static const struct json_command reserveinputs_command = { static const struct json_command reserveinputs_command = {
"reserveinputs", "reserveinputs",
json_reserveinputs, json_reserveinputs,
"Reserve utxos (or increase their reservation)",
false false
}; };
AUTODATA(json_command, &reserveinputs_command); AUTODATA(json_command, &reserveinputs_command);
@ -220,7 +219,6 @@ static struct command_result *json_unreserveinputs(struct command *cmd,
static const struct json_command unreserveinputs_command = { static const struct json_command unreserveinputs_command = {
"unreserveinputs", "unreserveinputs",
json_unreserveinputs, json_unreserveinputs,
"Unreserve utxos (or at least, reduce their reservation)",
false false
}; };
AUTODATA(json_command, &unreserveinputs_command); AUTODATA(json_command, &unreserveinputs_command);
@ -641,7 +639,6 @@ static struct command_result *json_fundpsbt(struct command *cmd,
static const struct json_command fundpsbt_command = { static const struct json_command fundpsbt_command = {
"fundpsbt", "fundpsbt",
json_fundpsbt, json_fundpsbt,
"Create PSBT using enough utxos to allow an output of {satoshi} at {feerate}",
false false
}; };
AUTODATA(json_command, &fundpsbt_command); AUTODATA(json_command, &fundpsbt_command);
@ -734,7 +731,6 @@ static struct command_result *json_addpsbtoutput(struct command *cmd,
static const struct json_command addpsbtoutput_command = { static const struct json_command addpsbtoutput_command = {
"addpsbtoutput", "addpsbtoutput",
json_addpsbtoutput, json_addpsbtoutput,
"Create a PSBT (or modify existing {initialpsbt}) with an output receiving {satoshi} amount.",
false false
}; };
AUTODATA(json_command, &addpsbtoutput_command); AUTODATA(json_command, &addpsbtoutput_command);
@ -911,7 +907,6 @@ static struct command_result *json_utxopsbt(struct command *cmd,
static const struct json_command utxopsbt_command = { static const struct json_command utxopsbt_command = {
"utxopsbt", "utxopsbt",
json_utxopsbt, json_utxopsbt,
"Create PSBT using these utxos",
false false
}; };
AUTODATA(json_command, &utxopsbt_command); AUTODATA(json_command, &utxopsbt_command);

View file

@ -174,7 +174,6 @@ static struct command_result *json_newaddr(struct command *cmd,
static const struct json_command newaddr_command = { static const struct json_command newaddr_command = {
"newaddr", "newaddr",
json_newaddr, json_newaddr,
"Get a new {bech32} (or all) address to fund a channel",
}; };
AUTODATA(json_command, &newaddr_command); AUTODATA(json_command, &newaddr_command);
@ -244,7 +243,6 @@ static struct command_result *json_listaddrs(struct command *cmd,
static const struct json_command listaddrs_command = { static const struct json_command listaddrs_command = {
"dev-listaddrs", "dev-listaddrs",
json_listaddrs, json_listaddrs,
"Show addresses list up to derivation {index} (default is the last bip32 index)",
.dev_only = true, .dev_only = true,
}; };
AUTODATA(json_command, &listaddrs_command); AUTODATA(json_command, &listaddrs_command);
@ -389,7 +387,6 @@ static struct command_result *json_listfunds(struct command *cmd,
static const struct json_command listfunds_command = { static const struct json_command listfunds_command = {
"listfunds", "listfunds",
json_listfunds, json_listfunds,
"Show available funds from the internal wallet",
}; };
AUTODATA(json_command, &listfunds_command); AUTODATA(json_command, &listfunds_command);
@ -462,7 +459,6 @@ static struct command_result *json_dev_rescan_outputs(struct command *cmd,
static const struct json_command dev_rescan_output_command = { static const struct json_command dev_rescan_output_command = {
"dev-rescan-outputs", "dev-rescan-outputs",
json_dev_rescan_outputs, json_dev_rescan_outputs,
"Synchronize the state of our funds with bitcoind",
.dev_only = true, .dev_only = true,
}; };
AUTODATA(json_command, &dev_rescan_output_command); AUTODATA(json_command, &dev_rescan_output_command);
@ -562,7 +558,6 @@ static struct command_result *json_listtransactions(struct command *cmd,
static const struct json_command listtransactions_command = { static const struct json_command listtransactions_command = {
"listtransactions", "listtransactions",
json_listtransactions, json_listtransactions,
"List transactions that we stored in the wallet",
}; };
AUTODATA(json_command, &listtransactions_command); AUTODATA(json_command, &listtransactions_command);
@ -782,7 +777,6 @@ static struct command_result *json_signpsbt(struct command *cmd,
static const struct json_command signpsbt_command = { static const struct json_command signpsbt_command = {
"signpsbt", "signpsbt",
json_signpsbt, json_signpsbt,
"Sign this wallet's inputs on a provided PSBT.",
false false
}; };
@ -819,7 +813,6 @@ static struct command_result *json_setpsbtversion(struct command *cmd,
static const struct json_command setpsbtversion_command = { static const struct json_command setpsbtversion_command = {
"setpsbtversion", "setpsbtversion",
json_setpsbtversion, json_setpsbtversion,
"Convert a given PSBT to the {version} requested (v0 or v2)",
false false
}; };
@ -980,7 +973,6 @@ static struct command_result *json_sendpsbt(struct command *cmd,
static const struct json_command sendpsbt_command = { static const struct json_command sendpsbt_command = {
"sendpsbt", "sendpsbt",
json_sendpsbt, json_sendpsbt,
"Finalize, extract and send a PSBT.",
false false
}; };