seth586 / guides

69 stars 18 forks source link

unable to find rpcuser in config, cannot start w/o RPC connectionError #23

Closed omid-1985 closed 1 year ago

omid-1985 commented 1 year ago

On the lnd page and on the LND Startup and initialization section, the result of running lnd package under lnd user is: su -m lnd -c 'lnd --configfile=/usr/local/etc/lnd.conf'

Screenshot from 2022-11-29 15-33-28

But running it under root is fine: lnd --configfile=/usr/local/etc/lnd.conf

Screenshot from 2022-11-29 15-36-10

following this instruction stops you here as lnd user does not have permission to read from /var/db/bitcoin. Screenshot from 2022-11-29 15-49-03

omid-1985 commented 1 year ago

Reading more about it, lnd Github repo explicitly mentions that: "The auth parameters rpcuser and rpcpass parameters can typically be determined by lnd for a bitcoind instance running under the same user."

We have lnd running under lnd user and running bitcoind under bitcoin user. Thus we need to pass the auth parameters in lnd.conf by adding these parameters into /usr/local/etc/lnd.conf: bitcoind.rpcuser=***youruser*** bitcoind.rpcpass=***yourpass*** bitcoind.zmqpubrawblock=tcp://127.0.0.1:28332 bitcoind.zmqpubrawtx=tcp://127.0.0.1:28333

The above help to go as far as lnd wallet creation, but after that lnd process fails due to another permission issue: Screenshot 2022-12-09 180607

marcoacheron commented 1 year ago

@omid-1985 In order to get past the cookie error, I had to add lnd to the _tor group.

pw usermod lnd -G lnd,_tor

seth586 commented 1 year ago

Yeah for the cookie authentication the lnd user needs to be added to the tor and bitcoin groups pw usermod lnd -G lnd,_tor,bitcoin

Fixed!