mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +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>
113 lines
4.2 KiB
JSON
113 lines
4.2 KiB
JSON
{
|
|
"$schema": "../rpc-schema-draft.json",
|
|
"type": "object",
|
|
"rpc": "fundchannel_complete",
|
|
"title": "Command for completing channel establishment",
|
|
"description": [
|
|
"`fundchannel_complete` is a lower level RPC command. It allows a user to complete an initiated channel establishment with a connected peer.",
|
|
"",
|
|
"Note that the funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed, as the commitment transactions for this channel are not secured until this command successfully completes. Broadcasting transaction before can lead to unrecoverable loss of funds."
|
|
],
|
|
"request": {
|
|
"required": [
|
|
"id",
|
|
"psbt"
|
|
],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"id": {
|
|
"type": "pubkey",
|
|
"description": [
|
|
"Node id of the remote peer."
|
|
]
|
|
},
|
|
"psbt": {
|
|
"type": "string",
|
|
"description": [
|
|
"Transaction to use for funding (does not need to be signed but must be otherwise complete)."
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"response": {
|
|
"required": [
|
|
"channel_id",
|
|
"commitments_secured"
|
|
],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"channel_id": {
|
|
"type": "hash",
|
|
"description": [
|
|
"The channel_id of the resulting channel."
|
|
]
|
|
},
|
|
"commitments_secured": {
|
|
"type": "boolean",
|
|
"enum": [
|
|
true
|
|
],
|
|
"description": [
|
|
"Indication that channel is safe to use."
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"errors": [
|
|
"On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
|
|
"",
|
|
"- -32602: If the given parameters are wrong.",
|
|
"- -1: Catchall nonspecific error.",
|
|
"- 305: Peer is not connected.",
|
|
"- 306: Unknown peer id.",
|
|
"- 309: PSBT does not have a unique, correct output to fund the channel."
|
|
],
|
|
"author": [
|
|
"Lisa Neigut <<niftynei@gmail.com>> is mainly responsible."
|
|
],
|
|
"see_also": [
|
|
"lightning-connect(7)",
|
|
"lightning-fundchannel(7)",
|
|
"lightning-multifundchannel(7)",
|
|
"lightning-fundchannel_start(7)",
|
|
"lightning-fundchannel_cancel(7)",
|
|
"lightning-openchannel_init(7)",
|
|
"lightning-openchannel_update(7)",
|
|
"lightning-openchannel_signed(7)",
|
|
"lightning-openchannel_bump(7)",
|
|
"lightning-openchannel_abort(7)"
|
|
],
|
|
"resources": [
|
|
"Main web site: <https://github.com/ElementsProject/lightning>"
|
|
],
|
|
"examples": [
|
|
{
|
|
"request": {
|
|
"id": "example:fundchannel_complete#1",
|
|
"method": "fundchannel_complete",
|
|
"params": [
|
|
"027ba5906fad81fcdbb774b4c806eb572b7fac3bee4720b12c44e7f70931d4b7cc",
|
|
"cHNidP8BAgQCAAAAAQMElQAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQBxAgAAAAFpz79e9wou5mbmtaiB+6WfRTf8SpZxmrd6n+rIFcWewQAAAAAA/f///wLS79/eAAAAABYAFE35CMxYA4yQx9XLuFj0/q5uNmligJaYAQAAAAAWABT/hTPq8LE5vAc9KiJjjmygoIN81UsAAAABAR+AlpgBAAAAABYAFP+FM+rwsTm8Bz0qImOObKCgg3zVAQ4gl0vCMXO3vKmwYNrBKr0bsVjo7Wmj501PavWRmxX1dywBDwQBAAAAARAE/f///wABAwgAAAABAAAAAAEEIgAgrcWu1QvOE7IcR/Pw6wFIFh6/TLwoeKjo5eUoi7suzsEAAQMIQYOYAAAAAAABBCJRIIHaDT4wURNaieL52F4urfZh+Vm/sF5nEJeFRnLP0Kx9AA=="
|
|
]
|
|
},
|
|
"response": {
|
|
"channel_id": "4ef7fbec78160e41ac53e32bb7d4d491222070cf719bd236a03a27109a306ced",
|
|
"commitments_secured": true
|
|
}
|
|
},
|
|
{
|
|
"request": {
|
|
"id": "example:fundchannel_complete#2",
|
|
"method": "fundchannel_complete",
|
|
"params": {
|
|
"id": "027ba5906fad81fcdbb774b4c806eb572b7fac3bee4720b12c44e7f70931d4b7cc",
|
|
"psbt": "cHNidP8BAgQCAAAAAQMETgAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQCJAgAAAAGXS8Ixc7e8qbBg2sEqvRuxWOjtaaPnTU9q9ZGbFfV3LAEAAAAA/f///wIAAAABAAAAACIAIK3FrtULzhOyHEfz8OsBSBYev0y8KHio6OXlKIu7Ls7BQYOYAAAAAAAiUSCB2g0+MFETWoni+dheLq32YflZv7BeZxCXhUZyz9CsfZUAAAABAStBg5gAAAAAACJRIIHaDT4wURNaieL52F4urfZh+Vm/sF5nEJeFRnLP0Kx9AQ4gTvf77HgWDkGsU+Mrt9TUkSIgcM9xm9I2oDonEJowbO0BDwQBAAAAARAE/f///wABAwhAQg8AAAAAAAEEIgAgyeosZcqM3Ce8Ew/hH15S4XVHXg4xtkWx3MODLcT3540AAQMIwi2JAAAAAAABBCJRIHdLHCqbSwqdzkO0Y5WUDaIAERXUAPo2Z5CeyGpdNlGLAA=="
|
|
}
|
|
},
|
|
"response": {
|
|
"channel_id": "589340033fb4e1ace8a5f6239a9bcc88e2d65191f68e4ad3f2ad37818718a2e9",
|
|
"commitments_secured": true
|
|
}
|
|
}
|
|
]
|
|
}
|