core-lightning/doc/schemas/lightning-dev-forget-channel.json
Rusty Russell b327bd30c3 doc: fix all JSON schemas to enforce no additional properties.
Without this, we have hardly any enforcement.  This is why the schema
mistake fixed in the previous patches weren't spotted immediately.

The hard work was done by:

```
$ for f in lightning-*.json; do grep -v '^  "additionalProperties": false,' $f | bagto $f; done
$ for f in lightning-*.json; do sed 's/"properties": {/"additionalProperties": false, "properties": {/' $f | bagto $f; done
$ make fmt-schemas
```

Then checking where 'additionalProperties: true' had been turned to
false (we deliberately use it in some places where there are if
statements in the schema, or occasionally where there can be arbitrary
fields).

[Including doc/rpc-schema-draft.json update by Shahana]
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-10-30 15:39:12 +10:30

132 lines
4.0 KiB
JSON
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"$schema": "../rpc-schema-draft.json",
"type": "object",
"rpc": "dev-forget-channel",
"title": "Command to remove the DB entries from the database after a close",
"warning": "For advanced users only",
"description": [
"Never use any `dev` command, including this one, unless you know exactly what you are doing; and have checked with a developer that your understanding is correct. They are meant only as a means of last resort and have the potential to mess things up. You have been warned❗",
"",
"The **dev-forget-channel** forgets the channel with given details. It will perform additional checks on whether it is safe to forget the channel, and only then remove the channel from the DB. Notice that this command is only available if CLN was started with --developer.",
"",
"Also see https://docs.corelightning.org/docs/faq#how-to-forget-about-a-channel"
],
"request": {
"required": [
"id"
],
"additionalProperties": false,
"properties": {
"id": {
"type": "pubkey",
"description": [
"The peer id of the channel to be forgotten. Checks if the channel is still active by checking its funding transaction."
]
},
"short_channel_id": {
"type": "short_channel_id",
"description": [
"The short channel id of the channel you want to remove."
]
},
"channel_id": {
"type": "hash",
"description": [
"The channel id of the channel you want to remove."
]
},
"force": {
"type": "boolean",
"description": [
"Ignores UTXO check for forced removal."
],
"default": "False"
}
}
},
"response": {
"required": [
"forced",
"funding_unspent",
"funding_txid"
],
"additionalProperties": false,
"properties": {
"forced": {
"type": "boolean",
"description": [
"If the command was forced or not."
]
},
"funding_unspent": {
"type": "boolean",
"description": [
"The funding is spent or not in the channel."
]
},
"funding_txid": {
"type": "txid",
"description": [
"The id of the funding transaction."
]
}
}
},
"errors": [
"The following errors may be reported:",
"",
"- -32602: If the given parameters are missing or wrong.",
"- -1: Catch all nonspecific errors, eg. `Multiple channels: please specify short_channel_id.` OR `No channels matching that peer_id and that short_channel_id.`, etc."
],
"author": [
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
],
"see_also": [
"lightning-close(7)",
"lightning-listchannels(7)",
"lightning-listpeerchannels(7)",
"lightning-listfunds(7)"
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"description": [
"Forget a channel by peer pubkey when only one channel exists with the peer:"
],
"request": {
"id": "example:dev-forget-channel#1",
"method": "dev-forget-channel",
"params": {
"id": "032cf15d1ad9c4a08d26eab1918f732d8ef8fdc6abb9640bf3db174372c491304e"
}
},
"response": {
"forced": false,
"funding_unspent": false,
"funding_txid": "c40c9d52aaac47f76c67163a2efc005df189b36b855b0ad209da7d0d066358b1"
}
},
{
"description": [
"Forget a channel by short channel id when peer has multiple channels:"
],
"request": {
"id": "example:dev-forget-channel#2",
"method": "dev-forget-channel",
"params": {
"id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d",
"short_channel_id": "111x1x0",
"force": true
}
},
"response": {
"forced": true,
"funding_unspent": false,
"funding_txid": "cd23f0517eefc27194981253eb07b19b055246df77033e052c66eaf2bbb00483"
}
}
]
}