2024-01-15 13:35:14 -08:00
{
"$schema" : "../rpc-schema-draft.json" ,
"type" : "object" ,
"rpc" : "commando" ,
"title" : "Command to Send a Command to a Remote Peer" ,
"description" : [
"The **commando** RPC command is a homage to bad 80s movies. It also sends a directly-connected *peer_id* a custom message, containing a request to run *method* (with an optional dictionary of *params*); generally the peer will only allow you to run a command if it has provided you with a *rune* which allows it."
] ,
"request" : {
"required" : [
"peer_id" ,
"method"
] ,
2024-10-30 09:38:42 +10:30
"additionalProperties" : false ,
2024-01-15 13:35:14 -08:00
"properties" : {
"peer_id" : {
"type" : "pubkey" ,
"description" : [
"Peer to command."
]
} ,
"method" : {
"type" : "string" ,
"description" : [
"Method to invoke on peer."
]
} ,
"params" : {
"oneOf" : [
{
"type" : "array" ,
"description" : [
"Array of positional parameters."
]
} ,
{
"type" : "object" ,
"description" : [
"Parameters for method."
]
}
]
} ,
"rune" : {
"type" : "string" ,
"description" : [
"Rune to authorize the command."
]
} ,
"filter" : {
"type" : "object" ,
"description" : [
"Filter to peer to apply to any successful result."
]
}
}
} ,
"response" : {
"required" : [ ] ,
2024-10-30 09:38:42 +10:30
"additionalProperties" : true ,
2024-01-15 13:35:14 -08:00
"properties" : { } ,
"pre_return_value_notes" : [
"On success, the return depends on the *method* invoked."
]
} ,
"errors" : [
"On failure, one of the following error codes may be returned:" ,
"" ,
"- -32600: Usually means peer is not connected" ,
"- 19535: the local commando plugin discovered an error." ,
"- 19536: the remote commando plugin discovered an error." ,
"- 19537: the remote commando plugin said we weren't authorized." ,
"" ,
"It can also fail if the peer does not respond, in which case it will simply hang awaiting a response."
] ,
2024-06-20 14:57:02 -07:00
"author" : [
"Rusty Russell <<rusty@rustcorp.com.au>> wrote the original Python commando.py plugin, the in-tree commando plugin, and this manual page." ,
"" ,
"Christian Decker came up with the name \"commando\", which almost excuses his previous adoption of the name \"Eltoo\"."
] ,
"see_also" : [
"lightning-commando-rune(7)"
] ,
"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:commando#1" ,
"method" : "commando" ,
2024-01-15 13:35:14 -08:00
"params" : {
2024-08-09 22:44:53 -07:00
"peer_id" : "nodeid020202020202020202020202020202020202020202020202020202020202" ,
2024-07-18 00:28:22 -07:00
"rune" : "_RWaZZRI7wAYU2hqlFBmYgC_dFczcpAdI_9O87YbDpg9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl" ,
2024-03-27 18:45:18 -07:00
"method" : "getinfo" ,
"params" : { }
2024-01-15 13:35:14 -08:00
}
2024-03-27 18:45:18 -07:00
} ,
"response" : {
2024-08-09 22:44:53 -07:00
"id" : "nodeid020202020202020202020202020202020202020202020202020202020202" ,
"alias" : "SILENTARTIST" ,
2024-07-18 00:28:22 -07:00
"color" : "022d22" ,
"num_peers" : 3 ,
2024-03-27 18:45:18 -07:00
"num_pending_channels" : 0 ,
2024-07-18 00:28:22 -07:00
"num_active_channels" : 3 ,
"num_inactive_channels" : 1 ,
2024-03-27 18:45:18 -07:00
"address" : [ ] ,
"binding" : [
{
"type" : "ipv4" ,
"address" : "127.0.0.1" ,
2024-08-09 22:44:53 -07:00
"port" : 19735
2024-03-27 18:45:18 -07:00
}
] ,
2024-11-27 12:05:12 -08:00
"version" : "v24.11rc1" ,
2024-07-18 00:28:22 -07:00
"blockheight" : 130 ,
2024-03-27 18:45:18 -07:00
"network" : "regtest" ,
2024-07-18 00:28:22 -07:00
"fees_collected_msat" : 106 ,
"lightning-dir" : "/tmp/.lightning/regtest" ,
2024-03-27 18:45:18 -07:00
"our_features" : {
2024-08-09 22:44:53 -07:00
"init" : "08a0882a8a59a1" ,
"node" : "88a0882a8a59a1" ,
2024-03-27 18:45:18 -07:00
"channel" : "" ,
"invoice" : "02000002024100"
2024-01-15 13:35:14 -08:00
}
}
} ,
{
2024-03-27 18:45:18 -07:00
"request" : {
"id" : "example:commando#2" ,
"method" : "commando" ,
"params" : {
2024-08-09 22:44:53 -07:00
"peer_id" : "nodeid020202020202020202020202020202020202020202020202020202020202" ,
2024-07-18 00:28:22 -07:00
"rune" : "RXgu0DD_i0wSPEZkIDyZIWL0bSAGdhvJ_GHOQdTg04A9MSZpZF4wMjY2ZTQ1OThkMWQzYzQxNWY1NyZtZXRob2Q9bGlzdHBlZXJz" ,
2024-03-27 18:45:18 -07:00
"method" : "listpeers" ,
"params" : [
2024-08-09 22:44:53 -07:00
"nodeid030303030303030303030303030303030303030303030303030303030303"
2024-01-15 13:35:14 -08:00
]
}
2024-03-27 18:45:18 -07:00
} ,
"response" : {
"peers" : [
{
2024-08-09 22:44:53 -07:00
"id" : "nodeid030303030303030303030303030303030303030303030303030303030303" ,
2024-03-27 18:45:18 -07:00
"connected" : true ,
2024-07-18 00:28:22 -07:00
"num_channels" : 2 ,
2024-03-27 18:45:18 -07:00
"netaddr" : [
2024-08-09 22:44:53 -07:00
"127.0.0.1:19736"
2024-03-27 18:45:18 -07:00
] ,
2024-08-09 22:44:53 -07:00
"features" : "08a0882a8a59a1"
2024-03-27 18:45:18 -07:00
}
]
}
2024-01-15 13:35:14 -08:00
} ,
{
2024-03-27 18:45:18 -07:00
"request" : {
"id" : "example:commando#3" ,
"method" : "commando" ,
"params" : {
2024-08-09 22:44:53 -07:00
"peer_id" : "nodeid020202020202020202020202020202020202020202020202020202020202" ,
2024-07-18 00:28:22 -07:00
"rune" : "QUJEYMLGgiaJvMDv_MhR2hiMKIBTbq-PrL-KxcIlirQ9MiZtZXRob2Q9cGF5JnBuYW1lYW1vdW50bXNhdDwxMDAwMA==" ,
2024-03-27 18:45:18 -07:00
"method" : "pay" ,
"params" : {
2024-08-09 22:44:53 -07:00
"bolt11" : "lnbcrt100n1pnt2bolt11invl020300000000bolt11invl020300000000bolt11invl020300000000bolt11invl020300000000bolt11invl020300000000bolt11invl020300000000bolt11invl020300000000bolt11invl020300000000bolt11invl020300000000bolt11invl020300000000" ,
2024-07-18 00:28:22 -07:00
"amount_msat" : 9900
2024-03-27 18:45:18 -07:00
}
}
} ,
"response" : {
2024-08-09 22:44:53 -07:00
"destination" : "nodeid020202020202020202020202020202020202020202020202020202020202" ,
"payment_hash" : "paymenthashcmdpycp10cp10cp10cp10cp10cp10cp10cp10cp10cp10cp10cp10" ,
"created_at" : 1738000000 ,
2024-03-27 18:45:18 -07:00
"parts" : 1 ,
2024-07-18 00:28:22 -07:00
"amount_msat" : 9900 ,
"amount_sent_msat" : 9900 ,
2024-08-09 22:44:53 -07:00
"payment_preimage" : "paymentpreimagec010101010101010101010101010101010101010101010101" ,
2024-03-27 18:45:18 -07:00
"status" : "complete"
}
2024-01-15 13:35:14 -08:00
}
]
}