Skip to content

Commit

Permalink
rpc: Removing category, description and verbose from json_comma…
Browse files Browse the repository at this point in the history
…nd struct

As suggested by @rustyrussell, removing redundant fields `category`, `description` and `verbose` from all rpc commands. These should be described in the documentation schema.

Changelog-None.
  • Loading branch information
ShahanaFarooqui committed Jul 23, 2024
1 parent ef0ca16 commit e2aa506
Show file tree
Hide file tree
Showing 30 changed files with 2 additions and 342 deletions.
4 changes: 0 additions & 4 deletions lightningd/chaintopology.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,9 +755,7 @@ 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)."
};
AUTODATA(json_command, &feerates_command);

Expand All @@ -782,9 +780,7 @@ 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."
};
AUTODATA(json_command, &parse_feerate_command);

Expand Down
16 changes: 0 additions & 16 deletions lightningd/channel_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -2198,31 +2198,19 @@ 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"
};
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}. "
""
"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);

static const struct json_command splice_signed_command = {
"splice_signed",
"channels",
json_splice_signed,
"Send our {signed_psbt}'s tx sigs for {channel_id}."
};
AUTODATA(json_command, &splice_signed_command);

Expand Down Expand Up @@ -2274,9 +2262,7 @@ 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,
};
AUTODATA(json_command, &dev_feerate_command);
Expand Down Expand Up @@ -2331,9 +2317,7 @@ 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,
};
AUTODATA(json_command, &dev_quiesce_command);
2 changes: 0 additions & 2 deletions lightningd/closed_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +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."
};
AUTODATA(json_command, &listclosedchannels_command);
5 changes: 0 additions & 5 deletions lightningd/closing_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -896,11 +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). "
"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);
8 changes: 0 additions & 8 deletions lightningd/configs.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,7 @@ static struct command_result *json_listconfigs(struct command *cmd,

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);

Expand Down Expand Up @@ -639,8 +633,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."
};
AUTODATA(json_command, &setconfig_command);
12 changes: 0 additions & 12 deletions lightningd/connect_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,7 @@ 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"
};
AUTODATA(json_command, &connect_command);

Expand Down Expand Up @@ -915,10 +912,7 @@ 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);
Expand All @@ -939,9 +933,7 @@ 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,
};
AUTODATA(json_command, &dev_suppress_gossip);
Expand All @@ -962,9 +954,7 @@ 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,
};
AUTODATA(json_command, &dev_report_fds);
Expand All @@ -985,9 +975,7 @@ 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,
};
AUTODATA(json_command, &dev_connectd_exhaust_fds);
8 changes: 0 additions & 8 deletions lightningd/datastore.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,32 +345,24 @@ 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",
};
AUTODATA(json_command, &datastore_command);

static const struct json_command deldatastore_command = {
"deldatastore",
"utility",
json_deldatastore,
"Remove a {key} from the data store",
};
AUTODATA(json_command, &deldatastore_command);

static const struct json_command listdatastore_command = {
"listdatastore",
"utility",
json_listdatastore,
"List the datastore, optionally only {key}",
};
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}",
};
AUTODATA(json_command, &datastoreusage_command);
16 changes: 0 additions & 16 deletions lightningd/dual_open_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -3892,51 +3892,35 @@ 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}",
.dev_only = true,
};

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"
};

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. "
"If {commitments_secured} is true, next call should be to openchannel_signed"
};

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`."
};

AUTODATA(json_command, &openchannel_init_command);
Expand Down
4 changes: 0 additions & 4 deletions lightningd/forwards.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,7 @@ 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]"
};
AUTODATA(json_command, &listforwards_command);

Expand Down Expand Up @@ -301,8 +299,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]"
};
AUTODATA(json_command, &delforward_command);
10 changes: 0 additions & 10 deletions lightningd/gossip_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,7 @@ 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"
" `openchannel2` hooks.",
};

AUTODATA(json_command, &setleaserates_command);
Expand Down Expand Up @@ -422,9 +418,7 @@ 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"
};
AUTODATA(json_command, &addgossip_command);

Expand All @@ -451,9 +445,7 @@ 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,
};
AUTODATA(json_command, &dev_set_max_scids_encode_size);
Expand All @@ -479,9 +471,7 @@ 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,
};
AUTODATA(json_command, &dev_gossip_set_time);
2 changes: 0 additions & 2 deletions lightningd/hsm_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +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."
};
AUTODATA(json_command, &makesecret_command);
Loading

0 comments on commit e2aa506

Please sign in to comment.