core-lightning/doc/schemas/lightning-recover.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

78 lines
2.1 KiB
JSON

{
"$schema": "../rpc-schema-draft.json",
"type": "object",
"rpc": "recover",
"title": "Reinitialize Your Node for Recovery",
"description": [
"The **recover** RPC command wipes your node and restarts it with the `--recover` option. This is only permitted if the node is unused: no channels, no bitcoin addresses issued (you can use `check` to see if recovery is possible).",
"",
"*hsmsecret* is either a codex32 secret starting with \"cl1\" as returned by `hsmtool getcodexsecret`, or a raw 64 character hex string.",
"",
"NOTE: this command only currently works with the `sqlite3` database backend."
],
"request": {
"required": [
"hsmsecret"
],
"additionalProperties": false,
"properties": {
"hsmsecret": {
"type": "string",
"description": [
"Either a codex32 secret starting with `cl1` as returned by `hsmtool getcodexsecret`, or a raw 64 character hex string."
]
}
}
},
"response": {
"required": [
"result"
],
"additionalProperties": false,
"properties": {
"result": {
"type": "string",
"added": "v24.05",
"enum": [
"Recovery restart in progress"
]
}
}
},
"author": [
"Rusty Russell <<rusty@blockstream.com>> is mainly responsible."
],
"see_also": [
"lightning-hsmtool(7)"
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"request": {
"id": "example:recover#1",
"method": "recover",
"params": {
"hsmsecret": "6c696768746e696e672d36000000000000000000000000000000000000000000"
}
},
"response": {
"result": "Recovery restart in progress"
}
},
{
"request": {
"id": "example:recover#2",
"method": "recover",
"params": {
"hsmsecret": "cl10leetsd35kw6r5de5kueedxyesqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqluplcg0lxenqd"
}
},
"response": {
"result": "Recovery restart in progress"
}
}
]
}