How do I run lncli command

Hello, How do I run lncli ? I have tried

sudo docker exec -it lnd.embassy lncli listchannels

but the command is invalid. thanks

We no longer use docker - switched to podman.

sudo podman exec -it lnd.embassy lncli listchannels

sudo podman exec -it lnd.embassy lncli getinfo
[lncli] rpc error: code = Unavailable desc = connection error: desc = “transport: Error while dialing: dial tcp 127.0.0.1:10009: connect: connection refused”

In the lnd.conf it’s set to:
rpclisten=172.18.0.8:10009
restlisten=172.18.0.7:8080

should I change the IP to 0.0.0.0 or 127.0.0.1 ?

First enter container running:

sudo podman exec -it lnd.embassy bash

then run:

lncli --rpcserver lnd.embassy listchannels

or you can combine them to one command:

sudo podman exec -it lnd.embassy lncli --rpcserver lnd.embassy listchannels

I forgot LND wants the rpcserver flag, thanks H0mer.

1 Like