1

I configured bitcoind RPC to authenticate clients with an authentication cookie. However I cant figure out if it's possible to use this method with lnd while connecting to bitcoind RPC.

I would like to clarify that I'm running bitcoind and lnd in two separated docker containers that share a volume where bitcoind save the authentication cookie. The problem is that lnd doesn't allow to specify the folder in which it could find the cookie... In bitcoin.conf for exemple you can specify the path where you can find the authentication cookie of the tor control port for example...

Someone knows how to do this in lnd ? Is it possible ?

Thank you!

2
  • It should be possible: lightningwiki.net/index.php/RPC_auth_for_bitcoind
    – MeshCollider
    Nov 23 '19 at 4:39
  • RPCauth is not the authentication cookie, with authentication cookie you don't need to create a password, a cookie is generated and shared between bitcoind and lnd on the same file system or shared folder...
    – Zighy Blue
    Nov 25 '19 at 21:01
2

It is supported according to the LND installation guide

NOTE:

The auth parameters rpcuser and rpcpass parameters can typically be determined by lnd for a bitcoind instance running under the same user, including when using cookie auth. In this case, you can exclude them from the lnd options entirely.

1
  • I'm running bitcoind and lnd in two separated docker containers that share a volume where bitcoind save the authentication cookie. The problem is that lnd doesn't allow to specify the folder in which it could find the cookie... In bitcoin.conf for exemple you can specify the path where you can find the authentication cookie of the tor control port...
    – Zighy Blue
    Nov 25 '19 at 20:54
0

The auth cookie lives in the data_dir for bitcoind.

lnd finds the data_dir by first finding the bitcoin.conf file, which it finds based on the bitcoind.dir argument passed at runtime. It then parses that for the data_dir directive.

You can see this in the src code: https://github.com/lightningnetwork/lnd/blob/master/config.go#L1505

So, if you are using a non-default location for your data_dir you need to ensure that you have a data_dir directive in your bitcoin.conf file and that you pass the bitcoind.dir at runtime.

Note: lnd won't find your data_dir directive if you preface it with main ot test.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.