Open
Description
Issue and Steps to Reproduce
When runes end with =
and we don't use -k
flag, lightning-cli
(v23.05.02) breaks with the commands decode
, commando-listrunes
and
commando-rune
:
$ source ../../repos/lightning/contrib/startup_regtest.sh
$ start_ln
$ l1-cli commando-rune
{
"rune": "GSCXiIISZ-SpxAw8jAFsexCLfem5QMFKBapxq8WJCQ89MA==",
"unique_id": "0",
"warning_unrestricted_rune": "WARNING: This rune has no restrictions! Anyone who has access to this rune could drain funds from your node. Be careful when giving this to apps that you don't trust. Consider using the restrictions parameter to only allow access to specific rpc methods."
}
Without -k
(breaks):
$ l1-cli decode GSCXiIISZ-SpxAw8jAFsexCLfem5QMFKBapxq8WJCQ89MA==
{
"code": -32602,
"message": "unknown parameter: GSCXiIISZ-SpxAw8jAFsexCLfem5QMFKBapxq8WJCQ89MA, this may be caused by a failure to autodetect key=value-style parameters. Please try using the -k flag and explicit key=value pairs of parameters."
}
$ l1-cli commando-listrunes GSCXiIISZ-SpxAw8jAFsexCLfem5QMFKBapxq8WJCQ89MA==
{
"code": -32602,
"message": "unknown parameter: GSCXiIISZ-SpxAw8jAFsexCLfem5QMFKBapxq8WJCQ89MA, this may be caused by a failure to autodetect key=value-style parameters. Please try using the -k flag and explicit key=value pairs of parameters."
}
$ l1-cli commando-rune GSCXiIISZ-SpxAw8jAFsexCLfem5QMFKBapxq8WJCQ89MA== '[["method=getinfo"]]'
lightning-cli: Some parameters are malformed, cannot create a valid JSON-RPC request: { "jsonrpc" : "2.0", "method" : "commando-rune", "id" : "cli:commando-rune#646927", "params" :{ "GSCXiIISZ-SpxAw8jAFsexCLfem5QMFKBapxq8WJCQ89MA" : "=", "[["method" : "getinfo\"]]"} }
With -k
(works):
$ l1-cli -k commando-rune rune=GSCXiIISZ-SpxAw8jAFsexCLfem5QMFKBapxq8WJCQ89MA== restrictions='[["method=getinfo"]]'
{
"rune": "4ut8GJ6zGyTx159Fm5Ew2RoutolItcdy8DMSkNd4WI89MCZtZXRob2Q9Z2V0aW5mbw==",
"unique_id": "0"
}
$ l1-cli -k commando-listrunes rune=GSCXiIISZ-SpxAw8jAFsexCLfem5QMFKBapxq8WJCQ89MA==
{
"runes": [
{
"rune": "19209788821267e4a9c40c3c8c016c7b108b7de9b940c14a05aa71abc589090f:=0",
"stored": false,
"unique_id": "0",
"restrictions": [],
"restrictions_as_english": ""
}
]
}
$ l1-cli -k decode string=GSCXiIISZ-SpxAw8jAFsexCLfem5QMFKBapxq8WJCQ89MA==
{
"type": "rune",
"unique_id": "0",
"string": "19209788821267e4a9c40c3c8c016c7b108b7de9b940c14a05aa71abc589090f:=0",
"restrictions": [],
"valid": true
}
getinfo
output
$ l1-cli getinfo
{
"id": "024a3f211e5250e340a9b0a073a7a9b067ceb04669bceff516fec8ce64276df47b",
"alias": "WRONGPHOTO",
"color": "024a3f",
"num_peers": 0,
"num_pending_channels": 0,
"num_active_channels": 0,
"num_inactive_channels": 0,
"address": [],
"binding": [
{
"type": "ipv4",
"address": "127.0.0.1",
"port": 7171
}
],
"version": "v23.05.2",
"blockheight": 1,
"network": "regtest",
"fees_collected_msat": 0,
"lightning-dir": "/tmp/l1-regtest/regtest",
"our_features": {
"init": "08a0000a0269a2",
"node": "88a0000a0269a2",
"channel": "",
"invoice": "02000002024100"
}
}