mably / lncli-web

Light-weight web client for the lnd daemon written in NodeJS / Angular.
https://github.com/lightningnetwork/lnd
GNU Affero General Public License v3.0
184 stars 58 forks source link

Failed to read macaroon from Path #184

Open jiyu3 opened 5 years ago

jiyu3 commented 5 years ago

I edited config/defaults.js as below:

// config/defaults.js

module.exports = {
   :  
   :  
  macaroonPath: `~/.lnd/data/chain/bitcoin/mainnet/admin.macaroon`,
   :  
   :  
};

ls ~/.lnd/data/chain/bitcoin/mainnet/admin.macaroon works, so that file exists.

But I failed to run node server --lndhost=localhost:10009 with that error:

Macaroon support is enabled. Macaroon path is ~/.lnd/data/chain/bitcoin/mainnet/admin.macaroon
info:    Recreating active client
error:   The specified macaroon file ~/.lnd/data/chain/bitcoin/mainnet/admin.macaroon was not found.
Please add the missing lnd macaroon file or update/remove the path in the application configuration.

I succeed to run lncli getinfo, so lnd and lncli are working.

My lnd.conf is below:

[Application Options]
externalip=35.211.30.191:9999
listen=0.0.0.0:9999
listen=[::1]:9998
rpclisten=0.0.0.0:10009

[Bitcoin]
bitcoin.active=1
bitcoin.mainnet=1
bitcoin.node=bitcoind

(I exactly opened port 9999, 9998 and 10009)

Any clue?

mably commented 5 years ago

Related code is here: https://github.com/mably/lncli-web/blob/master/app/lightning.js

Can't see anything wrong there. Probably some access rights missing somewhere.

veritasdigitalis commented 4 years ago

I had this issue and fixed it by specifying the path directly:

/home/user/.lnd/data/chain/bitcoin/mainnet/admin.macaroon