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

85 lines
2 KiB
JSON

{
"$schema": "../rpc-schema-draft.json",
"type": "object",
"rpc": "waitblockheight",
"title": "Command for waiting for blocks on the blockchain",
"description": [
"The **waitblockheight** RPC command waits until the blockchain has reached the specified *blockheight*."
],
"request": {
"required": [
"blockheight"
],
"additionalProperties": false,
"properties": {
"blockheight": {
"type": "u32",
"description": [
"Current blockheight of the blockchain if the value is greater than this number. If it is a present or past block height, then the command returns immediately."
]
},
"timeout": {
"type": "u32",
"description": [
"Only wait up to specified seconds."
],
"default": "60 seconds"
}
}
},
"response": {
"required": [
"blockheight"
],
"additionalProperties": false,
"properties": {
"blockheight": {
"type": "u32",
"description": [
"The current block height (>= *blockheight* parameter)."
]
}
},
"post_return_value_notes": [
"If *timeout* seconds is reached without the specified blockheight being reached, this command will fail with a code of `2000`."
]
},
"errors": [
"The following error codes may occur:",
"",
"- 2000: Timed out."
],
"author": [
"ZmnSCPxj <<ZmnSCPxj@protonmail.com>> is mainly responsible."
],
"resources": [
"Main web site: <https://github.com/ElementsProject/lightning>"
],
"examples": [
{
"request": {
"id": "example:waitblockheight#1",
"method": "waitblockheight",
"params": {
"blockheight": 129,
"timeout": 600
}
},
"response": {
"blockheight": 130
}
},
{
"request": {
"id": "example:waitblockheight#2",
"method": "waitblockheight",
"params": {
"blockheight": 131
}
},
"response": {
"blockheight": 131
}
}
]
}