2024-01-15 13:35:14 -08:00
{
"$schema" : "../rpc-schema-draft.json" ,
"type" : "object" ,
"additionalProperties" : false ,
"rpc" : "disconnect" ,
"title" : "Command for disconnecting from another lightning node" ,
"description" : [
"The disconnect RPC command closes an existing connection to a peer, identified by *id*, in the Lightning Network, as long as it doesn't have an active channel."
] ,
"request" : {
"required" : [
"id"
] ,
"properties" : {
"id" : {
"type" : "pubkey" ,
"description" : [
2024-07-03 12:37:22 -07:00
"The public key of the peer to terminate the connection. It can be discovered as peer_id in the output of the listpeerchannels command."
2024-01-15 13:35:14 -08:00
]
} ,
"force" : {
"type" : "boolean" ,
"description" : [
"If set to True, it will disconnect even with an active channel."
]
}
}
} ,
"response" : {
"properties" : { }
} ,
"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."
] ,
2024-06-20 14:57:02 -07:00
"author" : [
"Michael Hawkins <<michael.hawkins@protonmail.com>>."
] ,
"see_also" : [
2024-07-03 12:37:22 -07:00
"lightning-connect(7)" ,
"lightning-listpeerchannels(7)"
2024-06-20 14:57:02 -07:00
] ,
"resources" : [
"Main web site: <https://github.com/ElementsProject/lightning>"
] ,
"examples" : [
2024-01-15 13:35:14 -08:00
{
2024-03-27 18:45:18 -07:00
"request" : {
"id" : "example:disconnect#1" ,
"method" : "disconnect" ,
"params" : {
2024-07-18 00:28:22 -07:00
"id" : "0382ce59ebf18be7d84677c2e35f23294b9992ceca95491fcf8a56c6cb2d9de199" ,
2024-03-27 18:45:18 -07:00
"force" : false
}
} ,
"response" : { }
2024-01-15 13:35:14 -08:00
} ,
{
2024-03-27 18:45:18 -07:00
"request" : {
"id" : "example:disconnect#2" ,
"method" : "disconnect" ,
"params" : {
2024-07-18 00:28:22 -07:00
"id" : "032cf15d1ad9c4a08d26eab1918f732d8ef8fdc6abb9640bf3db174372c491304e" ,
2024-03-27 18:45:18 -07:00
"force" : true
}
} ,
"response" : { }
2024-01-15 13:35:14 -08:00
}
]
}