mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 22:45:27 +01:00
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>
103 lines
2.8 KiB
JSON
103 lines
2.8 KiB
JSON
{
|
|
"$schema": "../rpc-schema-draft.json",
|
|
"type": "object",
|
|
"rpc": "check",
|
|
"title": "Command for verifying parameters",
|
|
"description": [
|
|
"The **check** RPC command verifies another command without actually making any changes.",
|
|
"",
|
|
"This is guaranteed to be safe, and will do all checks up to the point where something in the system would need to be altered (such as checking that channels are in the right state, peers connected, etc).",
|
|
"",
|
|
"It does not guarantee successful execution of the command in all cases. For example, a call to lightning-getroute(7) may still fail to find a route even if checking the parameters succeeds."
|
|
],
|
|
"request": {
|
|
"required": [
|
|
"command_to_check"
|
|
],
|
|
"additionalProperties": true,
|
|
"properties": {
|
|
"command_to_check": {
|
|
"type": "string",
|
|
"description": [
|
|
"Name of the relevant command."
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"response": {
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"command_to_check": {
|
|
"type": "string",
|
|
"description": [
|
|
"The *command_to_check* argument."
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"command_to_check"
|
|
]
|
|
},
|
|
"author": [
|
|
"Mark Beckwith <<wythe@intrig.com>> and Rusty Russell <<rusty@rustcorp.com.au>> are mainly responsible."
|
|
],
|
|
"resources": [
|
|
"Main web site: <https://github.com/ElementsProject/lightning>"
|
|
],
|
|
"examples": [
|
|
{
|
|
"request": {
|
|
"id": "example:check#1",
|
|
"method": "check",
|
|
"params": {
|
|
"command_to_check": "sendpay",
|
|
"route": [
|
|
{
|
|
"amount_msat": 1011,
|
|
"id": "035d2b1192dfba134e10e540875d366ebc8bc353d5aa766b80c090b39c3a5d885d",
|
|
"delay": 20,
|
|
"channel": "111x1x0"
|
|
},
|
|
{
|
|
"amount_msat": 1000,
|
|
"id": "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199",
|
|
"delay": 10,
|
|
"channel": "113x1x1"
|
|
}
|
|
],
|
|
"payment_hash": "0000000000000000000000000000000000000000000000000000000000000000"
|
|
}
|
|
},
|
|
"response": {
|
|
"command_to_check": "sendpay"
|
|
}
|
|
},
|
|
{
|
|
"request": {
|
|
"id": "example:check#2",
|
|
"method": "check",
|
|
"params": {
|
|
"command_to_check": "dev",
|
|
"subcommand": "slowcmd",
|
|
"msec": 1000
|
|
}
|
|
},
|
|
"response": {
|
|
"command_to_check": "dev"
|
|
}
|
|
},
|
|
{
|
|
"request": {
|
|
"id": "example:check#3",
|
|
"method": "check",
|
|
"params": {
|
|
"command_to_check": "recover",
|
|
"hsmsecret": "6c696768746e696e672d31000000000000000000000000000000000000000000"
|
|
}
|
|
},
|
|
"response": {
|
|
"command_to_check": "recover"
|
|
}
|
|
}
|
|
]
|
|
}
|