pull down to refresh

@ek Please note that I needed an extra pair of angle brackets. With the single brackets my CLN log showed:

INFO    lightningd: JSON COMMAND createrune: Invalid parameter restrictions (not a valid restriction (should be array)): token '"method=invoice"'

Might want to change/amend
https://github.com/stackernews/stacker.news/blob/53b8f6f9564bee813c8e0dfd9f7295ea164d3256/wallets/cln/index.js#L24
(Not logging into Github because reasons 😎).

0 sats \ 5 replies \ @ek 25 Jan

Which CLN version are you running? It works with a single bracket for me:

$ lightning-cli createrune restrictions='["method=invoice"]'

We are testing with v23.08

reply

I'm on v24.11.1

reply
0 sats \ 3 replies \ @ek 25 Jan

Did you use first ' and then inside " or the other way around?

I also get an error if I run

$ lightning-cli createrune restrictions="['method=invoice']"
lightning-cli: Some parameters are malformed, cannot create a valid JSON-RPC request: { "jsonrpc" : "2.0", "method" : "createrune", "id" : "cli:createrune#3018", "params" :{ "restrictions" : ['method=invoice']} }

but I don't if I run

$ lightning-cli createrune restrictions='["method=invoice"]'

It's probably some shell expansion that is consuming the brackets if you use " since " does not disable shell expansion but ' does.

reply
1010 sats \ 2 replies \ @Lumor OP 25 Jan

I was trying the second one ('["method=invoice"]'). $SHELL is bash. Maybe something in newer CLN versions made the parameter actually be an array of arrays?

reply
21 sats \ 1 reply \ @ek 25 Jan

Mhh, reading the createrune docs, that might indeed be the case:

restrictions (one of, optional): It can be the string readonly, or an array of restrictions. Each restriction is an array of one or more alternatives

Will test with v24.11

update: you are right, on v24.11, I need to run this:

$ lightning-cli createrune restrictions='[["method=invoice"]]'

and this throws:

$ lightning-cli createrune restrictions='["method=invoice"]'
{
   "code": -32602,
   "message": "restrictions: not a valid restriction (should be array): invalid token (see logs for details)"
}
reply