rpc: Removing category and verbose from json_command struct

This commit is contained in:
ShahanaFarooqui 2024-07-23 14:19:47 -07:00 committed by Rusty Russell
parent 58e3ea574c
commit 89c182e2be
41 changed files with 125 additions and 355 deletions

View File

@ -183,9 +183,7 @@ static void human_help(char *buffer, const jsmntok_t *result)
/* Contains all commands objects, which have the following structure :
* {
* "command": "The command name and usage",
* "category": "The command category",
* "description": "The command's description",
* "verbose": "The command's detailed description"
* "description": "The command's description"
* }
*/
const jsmntok_t * help_array = json_get_member(buffer, result, "help");

Binary file not shown.

BIN
cln-grpc/src/convert.rs generated

Binary file not shown.

BIN
cln-rpc/src/model.rs generated

Binary file not shown.

View File

@ -12568,9 +12568,7 @@
"additionalProperties": true,
"required": [
"command",
"category",
"description",
"verbose"
"description"
],
"properties": {
"command": {
@ -12579,23 +12577,11 @@
"The command."
]
},
"category": {
"type": "string",
"description": [
"The category for this command (useful for grouping)."
]
},
"description": {
"type": "string",
"description": [
"A one-line description of the purpose of this command."
]
},
"verbose": {
"type": "string",
"description": [
"A full description of this command (including whether it's deprecated)."
]
}
}
}
@ -12636,9 +12622,7 @@
"help": [
{
"command": "pay bolt11 [amount_msat] [label] [riskfactor] [maxfeepercent] [retry_for] [maxdelay] [exemptfee] [localinvreqid] [exclude] [maxfee] [description] [dev_use_shadow]",
"category": "plugin",
"description": "Send payment specified by {bolt11}",
"verbose": "Attempt to pay the {bolt11} invoice."
"description": "Send payment specified by {bolt11}"
}
],
"format-hint": "simple"
@ -12656,9 +12640,7 @@
"help": [
{
"command": "dev subcommand=crash|rhash|slowcmd",
"category": "developer",
"description": "Developer command test multiplexer",
"verbose": "dev rhash {secret}\n\tShow SHA256 of {secret}\ndev crash\n\tCrash lightningd by calling fatal()\ndev slowcmd {msec}\n\tTorture test for slow commands, optional {msec}\n"
"description": "Developer command test multiplexer"
}
],
"format-hint": "simple"

File diff suppressed because one or more lines are too long

View File

@ -2617,10 +2617,8 @@ def stop2py(m):
def help_help2py(m):
return remove_default({
"category": m.category, # PrimitiveField in generate_composite
"command": m.command, # PrimitiveField in generate_composite
"description": m.description, # PrimitiveField in generate_composite
"verbose": m.verbose, # PrimitiveField in generate_composite
})

View File

@ -32,9 +32,7 @@
"additionalProperties": true,
"required": [
"command",
"category",
"description",
"verbose"
"description"
],
"properties": {
"command": {
@ -43,23 +41,11 @@
"The command."
]
},
"category": {
"type": "string",
"description": [
"The category for this command (useful for grouping)."
]
},
"description": {
"type": "string",
"description": [
"A one-line description of the purpose of this command."
]
},
"verbose": {
"type": "string",
"description": [
"A full description of this command (including whether it's deprecated)."
]
}
}
}
@ -100,9 +86,7 @@
"help": [
{
"command": "pay bolt11 [amount_msat] [label] [riskfactor] [maxfeepercent] [retry_for] [maxdelay] [exemptfee] [localinvreqid] [exclude] [maxfee] [description] [dev_use_shadow]",
"category": "plugin",
"description": "Send payment specified by {bolt11}",
"verbose": "Attempt to pay the {bolt11} invoice."
"description": "Send payment specified by {bolt11}"
}
],
"format-hint": "simple"
@ -120,9 +104,7 @@
"help": [
{
"command": "dev subcommand=crash|rhash|slowcmd",
"category": "developer",
"description": "Developer command test multiplexer",
"verbose": "dev rhash {secret}\n\tShow SHA256 of {secret}\ndev crash\n\tCrash lightningd by calling fatal()\ndev slowcmd {msec}\n\tTorture test for slow commands, optional {msec}\n"
"description": "Developer command test multiplexer"
}
],
"format-hint": "simple"

View File

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

View File

@ -2198,7 +2198,6 @@ static struct command_result *json_splice_signed(struct command *cmd,
static const struct json_command splice_init_command = {
"splice_init",
"channels",
json_splice_init,
"Init a channel splice to {channel_id} for {relative_amount} satoshis with {initialpsbt}. "
"Returns updated {psbt} with (partial) contributions from peer"
@ -2207,7 +2206,6 @@ AUTODATA(json_command, &splice_init_command);
static const struct json_command splice_update_command = {
"splice_update",
"channels",
json_splice_update,
"Update {channel_id} currently active negotiated splice with {psbt}. "
""
@ -2220,7 +2218,6 @@ AUTODATA(json_command, &splice_update_command);
static const struct json_command splice_signed_command = {
"splice_signed",
"channels",
json_splice_signed,
"Send our {signed_psbt}'s tx sigs for {channel_id}."
};
@ -2274,7 +2271,6 @@ static struct command_result *json_dev_feerate(struct command *cmd,
static const struct json_command dev_feerate_command = {
"dev-feerate",
"developer",
json_dev_feerate,
"Set feerate for {id} to {feerate}",
.dev_only = true,
@ -2331,7 +2327,6 @@ static struct command_result *json_dev_quiesce(struct command *cmd,
static const struct json_command dev_quiesce_command = {
"dev-quiesce",
"developer",
json_dev_quiesce,
"Initiate quiscence protocol with peer",
.dev_only = true,

View File

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

View File

@ -896,7 +896,6 @@ discard_unopened: {
static const struct json_command close_command = {
"close",
"channels",
json_close,
"Close the channel with {id} "
"(either peer ID, channel ID, or short channel ID). "

View File

@ -327,13 +327,8 @@ modern:
static const struct json_command listconfigs_command = {
"listconfigs",
"utility",
json_listconfigs,
"List all configuration options, or with [config], just that one.",
.verbose = "listconfigs [config]\n"
"Outputs an object, with each field a config options\n"
"(Option names which start with # are comments)\n"
"With [config], object only has that field"
};
AUTODATA(json_command, &listconfigs_command);
@ -639,7 +634,6 @@ static struct command_result *json_setconfig(struct command *cmd,
static const struct json_command setconfig_command = {
"setconfig",
"utility",
json_setconfig,
"Set a dynamically-adjustable config."
};

View File

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

View File

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

View File

@ -3892,7 +3892,6 @@ static struct command_result *json_queryrates(struct command *cmd,
static const struct json_command queryrates_command = {
"dev-queryrates",
"channels",
json_queryrates,
"Ask a peer what their contribution and liquidity rates are"
" for the given {amount} and {requested_amt}",
@ -3903,7 +3902,6 @@ AUTODATA(json_command, &queryrates_command);
static const struct json_command openchannel_init_command = {
"openchannel_init",
"channels",
json_openchannel_init,
"Init an open channel to {id} with {initialpsbt} for {amount} satoshis. "
"Returns updated {psbt} with (partial) contributions from peer"
@ -3911,7 +3909,6 @@ static const struct json_command openchannel_init_command = {
static const struct json_command openchannel_update_command = {
"openchannel_update",
"channels",
json_openchannel_update,
"Update {channel_id} with {psbt}. "
"Returns updated {psbt} with (partial) contributions from peer. "
@ -3920,21 +3917,18 @@ static const struct json_command openchannel_update_command = {
static const struct json_command openchannel_signed_command = {
"openchannel_signed",
"channels",
json_openchannel_signed,
"Send our {signed_psbt}'s tx sigs for {channel_id}."
};
static const struct json_command openchannel_bump_command = {
"openchannel_bump",
"channels",
json_openchannel_bump,
"Attempt to bump the fee on {channel_id}'s funding transaction."
};
static const struct json_command openchannel_abort_command = {
"openchannel_abort",
"channels",
json_openchannel_abort,
"Abort {channel_id}'s open. Usable while `commitment_signed=false`."
};

View File

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

View File

@ -370,7 +370,6 @@ static struct command_result *json_setleaserates(struct command *cmd,
static const struct json_command setleaserates_command = {
"setleaserates",
"channels",
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"
@ -422,7 +421,6 @@ static struct command_result *json_addgossip(struct command *cmd,
static const struct json_command addgossip_command = {
"addgossip",
"utility",
json_addgossip,
"Inject gossip {message} into gossipd"
};
@ -451,7 +449,6 @@ json_dev_set_max_scids_encode_size(struct command *cmd,
static const struct json_command dev_set_max_scids_encode_size = {
"dev-set-max-scids-encode-size",
"developer",
json_dev_set_max_scids_encode_size,
"Set {max} bytes of short_channel_ids per reply_channel_range",
.dev_only = true,
@ -479,7 +476,6 @@ static struct command_result *json_dev_gossip_set_time(struct command *cmd,
static const struct json_command dev_gossip_set_time = {
"dev-gossip-set-time",
"developer",
json_dev_gossip_set_time,
"Ask gossipd to update the current time.",
.dev_only = true,

View File

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

View File

@ -1246,13 +1246,13 @@ static struct command_result *json_invoice(struct command *cmd,
static const struct json_command invoice_command = {
"invoice",
"payment",
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)"};
"(default autogenerated)"
};
AUTODATA(json_command, &invoice_command);
static void json_add_invoices(struct json_stream *response,
@ -1379,7 +1379,6 @@ static struct command_result *json_listinvoices(struct command *cmd,
static const struct json_command listinvoices_command = {
"listinvoices",
"payment",
json_listinvoices,
"Show invoice matching {label}, {invstring}, {payment_hash} or {offerid} (or all, if "
"no query parameter specified)"
@ -1467,7 +1466,6 @@ static struct command_result *json_delinvoice(struct command *cmd,
static const struct json_command delinvoice_command = {
"delinvoice",
"payment",
json_delinvoice,
"Delete unpaid invoice {label} with {status}",
};
@ -1516,7 +1514,6 @@ static struct command_result *json_waitanyinvoice(struct command *cmd,
static const struct json_command waitanyinvoice_command = {
"waitanyinvoice",
"payment",
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."
@ -1566,7 +1563,6 @@ static struct command_result *json_waitinvoice(struct command *cmd,
static const struct json_command waitinvoice_command = {
"waitinvoice",
"payment",
json_waitinvoice,
"Wait for an incoming payment matching the invoice with {label}, or if the invoice expires"
};
@ -1605,7 +1601,6 @@ static struct command_result *json_decodepay(struct command *cmd,
static const struct json_command decodepay_command = {
"decodepay",
"payment",
json_decodepay,
"Decode {bolt11}, using {description} if necessary"
};
@ -1857,7 +1852,6 @@ static struct command_result *json_createinvoice(struct command *cmd,
static const struct json_command createinvoice_command = {
"createinvoice",
"payment",
json_createinvoice,
"Lowlevel command to sign and create invoice {invstring}, resolved with {preimage}, using unique {label}."
};
@ -1916,7 +1910,6 @@ static struct command_result *json_preapproveinvoice(struct command *cmd,
static const struct json_command preapproveinvoice_command = {
"preapproveinvoice",
"payment",
json_preapproveinvoice,
"Ask the HSM to preapprove an invoice."
};
@ -1976,7 +1969,6 @@ static struct command_result *json_preapprovekeysend(struct command *cmd,
static const struct json_command preapprovekeysend_command = {
"preapprovekeysend",
"payment",
json_preapprovekeysend,
"Ask the HSM to preapprove a keysend payment."
};
@ -2032,7 +2024,6 @@ static struct command_result *json_signinvoice(struct command *cmd,
static const struct json_command signinvoice_command = {
"signinvoice",
"payment",
json_signinvoice,
"Lowlevel command to sign invoice {invstring}."
};

View File

@ -186,15 +186,8 @@ static struct command_result *json_help(struct command *cmd,
static const struct json_command help_command = {
"help",
"utility",
json_help,
"List available commands, or give verbose help on one {command}.",
.verbose = "help [command]\n"
"Without [command]:\n"
" Outputs an array of objects with 'command' and 'description'\n"
"With [command]:\n"
" Give a single object containing 'verbose', which completely describes\n"
" the command inputs and outputs."
};
AUTODATA(json_command, &help_command);
@ -254,7 +247,6 @@ static struct command_result *json_stop(struct command *cmd,
static const struct json_command stop_command = {
"stop",
"utility",
json_stop,
"Shut down the lightningd process"
};
@ -361,7 +353,6 @@ static struct command_result *json_recover(struct command *cmd,
static const struct json_command recover_command = {
"recover",
"utility",
json_recover,
"Restart an unused lightning node with --recover"
};
@ -438,15 +429,8 @@ static struct command_result *json_dev(struct command *cmd UNUSED,
static const struct json_command dev_command = {
"dev",
"developer",
json_dev,
"Developer command test multiplexer",
.verbose = "dev rhash {secret}\n"
" Show SHA256 of {secret}\n"
"dev crash\n"
" Crash lightningd by calling fatal()\n"
"dev slowcmd {msec}\n"
" Torture test for slow commands, optional {msec}\n",
.dev_only = true,
};
AUTODATA(json_command, &dev_command);
@ -481,25 +465,9 @@ static void json_add_help_command(struct command *cmd,
strmap_get(&cmd->ld->jsonrpc->usagemap,
json_command->name));
json_object_start(response, NULL);
json_add_string(response, "command", usage);
json_add_string(response, "category", json_command->category);
json_add_string(response, "description", json_command->description);
if (!json_command->verbose) {
json_add_string(response, "verbose",
"HELP! Please contribute"
" a description for this"
" json_command!");
} else {
struct json_escape *esc;
esc = json_escape(NULL, json_command->verbose);
json_add_escaped_string(response, "verbose", take(esc));
}
json_object_end(response);
}
static const struct json_command *find_command(struct json_command **commands,
@ -1724,10 +1692,8 @@ static struct command_result *json_check(struct command *cmd,
static const struct json_command check_command = {
"check",
"utility",
json_check,
"Don't run {command_to_check}, just verify parameters.",
.verbose = "check command_to_check [parameters...]\n"
};
AUTODATA(json_command, &check_command);
@ -1751,7 +1717,6 @@ static struct command_result *json_notifications(struct command *cmd,
static const struct json_command notifications_command = {
"notifications",
"utility",
json_notifications,
"{enable} notifications",
};
@ -1777,7 +1742,6 @@ static struct command_result *json_batching(struct command *cmd,
static const struct json_command batching_command = {
"batching",
"utility",
json_batching,
"Database transaction batching {enable}",
};
@ -1803,7 +1767,6 @@ static struct command_result *json_deprecations(struct command *cmd,
static const struct json_command deprecations_command = {
"deprecations",
"utility",
json_deprecations,
"Set/unset deprecated APIs on this JSON connection (for developer testing)",
};

View File

@ -55,13 +55,11 @@ struct command_result;
struct json_command {
const char *name;
const char *category;
struct command_result *(*dispatch)(struct command *,
const char *buffer,
const jsmntok_t *obj,
const jsmntok_t *params);
const char *description;
const char *verbose;
bool dev_only;
const char *depr_start, *depr_end;
/* Special hook if we want raw access for check command */

View File

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

View File

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

View File

@ -122,7 +122,6 @@ static struct command_result *json_createoffer(struct command *cmd,
static const struct json_command createoffer_command = {
"createoffer",
"payment",
json_createoffer,
"Create and sign an offer {bolt12} with and optional {label}."
};
@ -183,7 +182,6 @@ static struct command_result *json_listoffers(struct command *cmd,
static const struct json_command listoffers_command = {
"listoffers",
"payment",
json_listoffers,
"If {offer_id} is set, show that."
" Otherwise, if {showdisabled} is true, list all, otherwise just non-disabled ones."
@ -227,7 +225,6 @@ static struct command_result *json_disableoffer(struct command *cmd,
static const struct json_command disableoffer_command = {
"disableoffer",
"payment",
json_disableoffer,
"Disable offer {offer_id}",
};
@ -495,7 +492,6 @@ static struct command_result *json_createinvoicerequest(struct command *cmd,
static const struct json_command createinvreq_command = {
"createinvoicerequest",
"payment",
json_createinvoicerequest,
"Create and sign an invoice_request {bolt12}, with {recurrence_label} if recurring, filling in payer_info and payer_key."
};
@ -532,7 +528,6 @@ static struct command_result *json_payersign(struct command *cmd,
static const struct json_command payersign_command = {
"payersign",
"payment",
json_payersign,
"Sign {messagename} {fieldname} {merkle} (a 32-byte hex string) using public {tweak}",
};
@ -594,7 +589,6 @@ static struct command_result *json_listinvoicerequests(struct command *cmd,
static const struct json_command listinvoicerequests_command = {
"listinvoicerequests",
"payment",
json_listinvoicerequests,
"If {invreq_id} is set, show that."
" Otherwise, if {showdisabled} is true, list all, otherwise just non-disabled ones."
@ -639,7 +633,6 @@ static struct command_result *json_disableinvoicerequest(struct command *cmd,
static const struct json_command disableinvoicerequest_command = {
"disableinvoicerequest",
"payment",
json_disableinvoicerequest,
"Disable invoice_request {invreq_id}",
};

View File

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

View File

@ -1664,7 +1664,6 @@ static struct command_result *json_recoverchannel(struct command *cmd,
static const struct json_command fundchannel_start_command = {
"fundchannel_start",
"channels",
json_fundchannel_start,
"Start fund channel with {id} using {amount} satoshis. "
"Returns a bech32 address to use as an output for a funding transaction."
@ -1673,7 +1672,6 @@ AUTODATA(json_command, &fundchannel_start_command);
static const struct json_command fundchannel_cancel_command = {
"fundchannel_cancel",
"channels",
json_fundchannel_cancel,
"Cancel inflight channel establishment with peer {id}."
};
@ -1681,7 +1679,6 @@ AUTODATA(json_command, &fundchannel_cancel_command);
static const struct json_command fundchannel_complete_command = {
"fundchannel_complete",
"channels",
json_fundchannel_complete,
"Complete channel establishment with peer {id} for funding transaction"
"with {psbt}. Returns true on success, false otherwise."
@ -1690,7 +1687,6 @@ AUTODATA(json_command, &fundchannel_complete_command);
static const struct json_command json_commitchan_command = {
"recoverchannel",
"channels",
json_recoverchannel,
"Populate the DB with a channel and peer"
"Used for recovering the channel using DLP."

View File

@ -1341,7 +1341,6 @@ static struct command_result *json_sendonion(struct command *cmd,
static const struct json_command sendonion_command = {
"sendonion",
"payment",
json_sendonion,
"Send a payment with a pre-computed onion."
};
@ -1598,7 +1597,6 @@ static struct command_result *json_sendpay(struct command *cmd,
static const struct json_command sendpay_command = {
"sendpay",
"payment",
json_sendpay,
"Send along {route} in return for preimage of {payment_hash}"
};
@ -1644,7 +1642,6 @@ static struct command_result *json_waitsendpay(struct command *cmd,
static const struct json_command waitsendpay_command = {
"waitsendpay",
"payment",
json_waitsendpay,
"Wait for payment attempt on {payment_hash} to succeed or fail, "
"but only up to {timeout} seconds."
@ -1807,7 +1804,6 @@ static struct command_result *json_listsendpays(struct command *cmd,
static const struct json_command listsendpays_command = {
"listsendpays",
"payment",
json_listsendpays,
"Show sendpay, old and current, optionally limiting to {bolt11} or {payment_hash}."
};
@ -1911,7 +1907,6 @@ static struct command_result *json_delpay(struct command *cmd,
static const struct json_command delpay_command = {
"delpay",
"payment",
json_delpay,
"Delete payment with {payment_hash} and {status}",
};
@ -1978,7 +1973,6 @@ static struct command_result *json_createonion(struct command *cmd,
static const struct json_command createonion_command = {
"createonion",
"payment",
json_createonion,
"Create an onion going through the provided nodes, each with its own payload"
};

View File

@ -2304,7 +2304,6 @@ static struct command_result *json_listpeers(struct command *cmd,
static const struct json_command listpeers_command = {
"listpeers",
"network",
json_listpeers,
"Show current peers, if {level} is set, include logs for {id}"
};
@ -2358,7 +2357,6 @@ static struct command_result *json_staticbackup(struct command *cmd,
static const struct json_command staticbackup_command = {
"staticbackup",
"backup",
json_staticbackup,
"Returns SCB of all the channels currently present in the DB"
};
@ -2419,7 +2417,6 @@ static struct command_result *json_listpeerchannels(struct command *cmd,
static const struct json_command listpeerchannels_command = {
"listpeerchannels",
"network",
json_listpeerchannels,
"Show channels with direct peers."
};
@ -2660,7 +2657,6 @@ static struct command_result *json_disconnect(struct command *cmd,
static const struct json_command disconnect_command = {
"disconnect",
"network",
json_disconnect,
"Disconnect from {id} that has previously been connected to using connect; with {force} set, even if it has a current channel"
};
@ -2799,7 +2795,6 @@ static struct command_result *json_getinfo(struct command *cmd,
static const struct json_command getinfo_command = {
"getinfo",
"utility",
json_getinfo,
"Show information about this node"
};
@ -2904,7 +2899,6 @@ static struct command_result *json_waitblockheight(struct command *cmd,
static const struct json_command waitblockheight_command = {
"waitblockheight",
"utility",
&json_waitblockheight,
"Wait for the blockchain to reach {blockheight}, up to "
"{timeout} seconds."
@ -3172,7 +3166,6 @@ static struct command_result *json_setchannel(struct command *cmd,
static const struct json_command setchannel_command = {
"setchannel",
"channels",
json_setchannel,
"Sets fees and/or htlc_max for channel with {id} "
"(either peer ID, channel ID, short channel ID or 'all'). "
@ -3252,7 +3245,6 @@ static struct command_result *json_sign_last_tx(struct command *cmd,
static const struct json_command dev_sign_last_tx = {
"dev-sign-last-tx",
"developer",
json_sign_last_tx,
"Sign and show the last commitment transaction with peer {id}",
.dev_only = true,
@ -3279,7 +3271,6 @@ static struct command_result *json_dev_fail(struct command *cmd,
static const struct json_command dev_fail_command = {
"dev-fail",
"developer",
json_dev_fail,
"Fail with peer {id}",
.dev_only = true,
@ -3328,7 +3319,6 @@ static struct command_result *json_dev_reenable_commit(struct command *cmd,
static const struct json_command dev_reenable_commit = {
"dev-reenable-commit",
"developer",
json_dev_reenable_commit,
"Re-enable the commit timer on peer {id}",
.dev_only = true,
@ -3443,10 +3433,8 @@ static struct command_result *json_dev_forget_channel(struct command *cmd,
static const struct json_command dev_forget_channel_command = {
"dev-forget-channel",
"developer",
json_dev_forget_channel,
"Forget the channel with peer {id}, ignore UTXO check with {force}='true'.",
.verbose = "Forget the channel with peer {id}. Checks if the channel is still active by checking its funding transaction. Check can be ignored by setting {force} to 'true'",
.dev_only = true,
};
AUTODATA(json_command, &dev_forget_channel_command);

View File

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

View File

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

View File

@ -1389,15 +1389,12 @@ static const char *plugin_rpcmethod_add(struct plugin *plugin,
const char *buffer,
const jsmntok_t *meth)
{
const jsmntok_t *nametok, *categorytok, *desctok, *longdesctok,
*usagetok, *deprtok;
const jsmntok_t *nametok, *desctok, *usagetok, *deprtok;
struct json_command *cmd;
const char *usage, *err;
nametok = json_get_member(buffer, meth, "name");
categorytok = json_get_member(buffer, meth, "category");
desctok = json_get_member(buffer, meth, "description");
longdesctok = json_get_member(buffer, meth, "long_description");
usagetok = json_get_member(buffer, meth, "usage");
deprtok = json_get_member(buffer, meth, "deprecated");
@ -1414,12 +1411,6 @@ static const char *plugin_rpcmethod_add(struct plugin *plugin,
meth->end - meth->start, buffer + meth->start);
}
if (longdesctok && longdesctok->type != JSMN_STRING) {
return tal_fmt(plugin,
"\"long_description\" is not a string: %.*s",
meth->end - meth->start, buffer + meth->start);
}
if (usagetok && usagetok->type != JSMN_STRING) {
return tal_fmt(plugin,
"\"usage\" is not a string: %.*s",
@ -1428,15 +1419,7 @@ static const char *plugin_rpcmethod_add(struct plugin *plugin,
cmd = notleak(tal(plugin, struct json_command));
cmd->name = json_strdup(cmd, buffer, nametok);
if (categorytok)
cmd->category = json_strdup(cmd, buffer, categorytok);
else
cmd->category = "plugin";
cmd->description = json_strdup(cmd, buffer, desctok);
if (longdesctok)
cmd->verbose = json_strdup(cmd, buffer, longdesctok);
else
cmd->verbose = cmd->description;
if (usagetok)
usage = json_strdup(tmpctx, buffer, usagetok);
else

View File

@ -307,21 +307,8 @@ static struct command_result *json_plugin_control(struct command *cmd,
}
static const struct json_command plugin_control_command = {
"plugin",
"plugin",
json_plugin_control,
"Control plugins (start, stop, startdir, rescan, list)",
.verbose = "Usage :\n"
"plugin start /path/to/a/plugin\n"
" adds a new plugin to Core Lightning\n"
"plugin stop plugin_name\n"
" stops an already registered plugin\n"
"plugin startdir /path/to/a/plugin_dir/\n"
" adds a new plugin directory\n"
"plugin rescan\n"
" loads not-already-loaded plugins from the default plugins dir\n"
"plugin list\n"
" lists all active plugins\n"
"\n"
};
AUTODATA(json_command, &plugin_control_command);

View File

@ -407,7 +407,6 @@ static struct command_result *json_showrunes(struct command *cmd,
static const struct json_command showrunes_command = {
"showrunes",
"utility",
json_showrunes,
"Show the list of runes or decode an optional {rune}."
};
@ -587,7 +586,6 @@ static struct command_result *json_createrune(struct command *cmd,
static const struct json_command creatrune_command = {
"createrune",
"utility",
json_createrune,
"Create or restrict an optional {rune} with optional {restrictions} and returns {rune}"
};
@ -595,7 +593,6 @@ AUTODATA(json_command, &creatrune_command);
static const struct json_command invokerune_command = {
"invokerune",
"utility",
json_createrune,
"Invoke or restrict an optional {rune} with optional {restrictions} and returns {rune}"
};
@ -700,7 +697,6 @@ static struct command_result *json_blacklistrune(struct command *cmd,
static const struct json_command blacklistrune_command = {
"blacklistrune",
"utility",
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}"
};
@ -708,7 +704,6 @@ AUTODATA(json_command, &blacklistrune_command);
static const struct json_command destroyrune_command = {
"destroyrune",
"utility",
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}"
};
@ -998,7 +993,6 @@ static struct command_result *json_checkrune(struct command *cmd,
static const struct json_command checkrune_command = {
"checkrune",
"utility",
json_checkrune,
"Checks rune for validity with required {rune} and optional {nodeid}, {method}, {params} and returns {valid: true} or error message"
};

View File

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

View File

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

View File

@ -108,8 +108,6 @@ def process_help_response(help_response):
processed_html_res = ""
for row in processed_res:
processed_html_res += f"Command: {row['command']}\n"
processed_html_res += f"Category: {row['category']}\n"
processed_html_res += f"Description: {row['description']}\n"
processed_html_res += f"Verbose: {row['verbose']}\n"
processed_html_res += line
return processed_html_res

View File

@ -49,9 +49,7 @@ def test_plugin_start(node_factory):
'help': [
{
'command': 'testmethod ',
'category': 'plugin',
'description': 'This is a test',
'verbose': 'This is a test'
'description': 'This is a test'
}
],
'format-hint': 'simple'

View File

@ -998,7 +998,7 @@ def test_cli(node_factory):
'-J',
'help', 'command=help']).decode('utf-8')
j, _ = json.JSONDecoder().raw_decode(out)
assert 'help [command]' in j['help'][0]['verbose']
assert 'help [command]' in j['help'][0]['command']
# Test keyword input (forced)
out = subprocess.check_output(['cli/lightning-cli',
@ -1008,7 +1008,7 @@ def test_cli(node_factory):
'-J', '-k',
'help', 'command=help']).decode('utf-8')
j, _ = json.JSONDecoder().raw_decode(out)
assert 'help [command]' in j['help'][0]['verbose']
assert 'help [command]' in j['help'][0]['command']
# Test ordered input (autodetect)
out = subprocess.check_output(['cli/lightning-cli',
@ -1018,7 +1018,7 @@ def test_cli(node_factory):
'-J',
'help', 'help']).decode('utf-8')
j, _ = json.JSONDecoder().raw_decode(out)
assert 'help [command]' in j['help'][0]['verbose']
assert 'help [command]' in j['help'][0]['command']
# Test ordered input (forced)
out = subprocess.check_output(['cli/lightning-cli',
@ -1028,7 +1028,7 @@ def test_cli(node_factory):
'-J', '-o',
'help', 'help']).decode('utf-8')
j, _ = json.JSONDecoder().raw_decode(out)
assert 'help [command]' in j['help'][0]['verbose']
assert 'help [command]' in j['help'][0]['command']
# Test filtering
out = subprocess.check_output(['cli/lightning-cli',
@ -1196,7 +1196,7 @@ def test_cli_commando(node_factory):
'-J', '-k',
'help', 'command=help']).decode('utf-8')
j, _ = json.JSONDecoder().raw_decode(out)
assert 'help [command]' in j['help'][0]['verbose']
assert 'help [command]' in j['help'][0]['command']
# Test ordered input (forced)
out = subprocess.check_output(['cli/lightning-cli',
@ -1207,7 +1207,7 @@ def test_cli_commando(node_factory):
'-J', '-o',
'help', 'help']).decode('utf-8')
j, _ = json.JSONDecoder().raw_decode(out)
assert 'help [command]' in j['help'][0]['verbose']
assert 'help [command]' in j['help'][0]['command']
# Test filtering
out = subprocess.check_output(['cli/lightning-cli',

View File

@ -136,7 +136,6 @@ static struct command_result *json_reserveinputs(struct command *cmd,
static const struct json_command reserveinputs_command = {
"reserveinputs",
"bitcoin",
json_reserveinputs,
"Reserve utxos (or increase their reservation)",
false
@ -220,7 +219,6 @@ static struct command_result *json_unreserveinputs(struct command *cmd,
static const struct json_command unreserveinputs_command = {
"unreserveinputs",
"bitcoin",
json_unreserveinputs,
"Unreserve utxos (or at least, reduce their reservation)",
false
@ -642,7 +640,6 @@ static struct command_result *json_fundpsbt(struct command *cmd,
static const struct json_command fundpsbt_command = {
"fundpsbt",
"bitcoin",
json_fundpsbt,
"Create PSBT using enough utxos to allow an output of {satoshi} at {feerate}",
false
@ -736,7 +733,6 @@ static struct command_result *json_addpsbtoutput(struct command *cmd,
static const struct json_command addpsbtoutput_command = {
"addpsbtoutput",
"bitcoin",
json_addpsbtoutput,
"Create a PSBT (or modify existing {initialpsbt}) with an output receiving {satoshi} amount.",
false
@ -914,7 +910,6 @@ static struct command_result *json_utxopsbt(struct command *cmd,
}
static const struct json_command utxopsbt_command = {
"utxopsbt",
"bitcoin",
json_utxopsbt,
"Create PSBT using these utxos",
false

View File

@ -173,10 +173,8 @@ static struct command_result *json_newaddr(struct command *cmd,
static const struct json_command newaddr_command = {
"newaddr",
"bitcoin",
json_newaddr,
"Get a new {bech32} (or all) address to fund a channel",
.verbose = "Generates a new address that belongs to the internal wallet. Funds sent to these addresses will be managed by lightningd. Use `withdraw` to withdraw funds to an external wallet."
};
AUTODATA(json_command, &newaddr_command);
@ -245,10 +243,8 @@ static struct command_result *json_listaddrs(struct command *cmd,
static const struct json_command listaddrs_command = {
"dev-listaddrs",
"developer",
json_listaddrs,
"Show addresses list up to derivation {index} (default is the last bip32 index)",
.verbose = "Show addresses of your internal wallet. Use `newaddr` to generate a new address.",
.dev_only = true,
};
AUTODATA(json_command, &listaddrs_command);
@ -392,13 +388,8 @@ static struct command_result *json_listfunds(struct command *cmd,
static const struct json_command listfunds_command = {
"listfunds",
"utility",
json_listfunds,
"Show available funds from the internal wallet",
.verbose = "Returns a list of funds (outputs) that can be used "
"by the internal wallet to open new channels "
"or can be withdrawn, using the `withdraw` command, to another wallet. "
"Includes spent outputs if {spent} is set to true."
};
AUTODATA(json_command, &listfunds_command);
@ -470,10 +461,8 @@ static struct command_result *json_dev_rescan_outputs(struct command *cmd,
static const struct json_command dev_rescan_output_command = {
"dev-rescan-outputs",
"developer",
json_dev_rescan_outputs,
"Synchronize the state of our funds with bitcoind",
.verbose = "For each output stored in the internal wallet ask `bitcoind` whether we are in sync with its state (spent vs. unspent)",
.dev_only = true,
};
AUTODATA(json_command, &dev_rescan_output_command);
@ -572,13 +561,8 @@ static struct command_result *json_listtransactions(struct command *cmd,
static const struct json_command listtransactions_command = {
"listtransactions",
"payment",
json_listtransactions,
"List transactions that we stored in the wallet",
.verbose = "Returns transactions tracked in the wallet. This includes deposits, "
"withdrawals and transactions related to channels. A transaction may have "
"multiple types, e.g., a transaction may both be a close and a deposit if "
"it closes the channel and returns funds to the wallet."
};
AUTODATA(json_command, &listtransactions_command);
@ -797,7 +781,6 @@ static struct command_result *json_signpsbt(struct command *cmd,
static const struct json_command signpsbt_command = {
"signpsbt",
"bitcoin",
json_signpsbt,
"Sign this wallet's inputs on a provided PSBT.",
false
@ -835,7 +818,6 @@ static struct command_result *json_setpsbtversion(struct command *cmd,
static const struct json_command setpsbtversion_command = {
"setpsbtversion",
"bitcoin",
json_setpsbtversion,
"Convert a given PSBT to the {version} requested (v0 or v2)",
false
@ -997,7 +979,6 @@ static struct command_result *json_sendpsbt(struct command *cmd,
static const struct json_command sendpsbt_command = {
"sendpsbt",
"bitcoin",
json_sendpsbt,
"Finalize, extract and send a PSBT.",
false