lnd: admin.macaroon is not created when running lnd

Background

I successfully completed stage 1 of the tutorial using --no-macaroons. Now I’m trying to learn how to use macaroons.

The tutorial does not explain how to create the admin.macaroon file. When I run lnd, it waits for the either lncli create or lncli unlock. No admin.macaroon file can be found anywhere on disk at this point.

These commands (lncli) however seem to require the existence of an admin.macaroon file.

>lncli --rpcserver=localhost:10001 --macaroonpath=C:\work\lnd\alice\data\admin.macroon getinfo
[lncli] open C:\work\lnd\alice\data\admin.macroon: The system cannot find the file specified.

Tried to touch it and then I got

[lncli] empty macaroon data

So, how do I create an initial macaroon file?

Your environment

  • lnd version 0.4.1-beta commit=097fd50747356a39593e5ac7625bf0b0fb1305a1
  • Windows 10
  • btcd compiled from source today from roasbeef branch commit a03db407e40d3b66ea29984263bbc8bf4d2f04c4

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (8 by maintainers)

Most upvoted comments

The admin.macaroon is only created after you run lncli unlock or lncli create. So you should run either of these commands first. The macaroons.db is where the root key for the macaroons is stored, so it’s in a different format and cannot be used for the --macaroonpath parameter.

The admin.macaroon is only created after you run lncli unlock or lncli create. So you should run either of these commands first. The macaroons.db is where the root key for the macaroons is stored, so it’s in a different format and cannot be used for the --macaroonpath parameter.

When I do “lncli --rpcserver=localhost:10001 --macaroonpath=data/admin.macaroon create” no admin.macaroon file is created. Like the OP I have been able to do the tutorial with --no-macaroons on but when I try to complete the tutorial with macaroons, I have serious problem with no admin.macaroon file existing.

@autemox @ereztdev the network parameter needs to be passed like lncli --network=testnet .... The macaroons are no longer stored in the top level data directory, they are stored in /data/chain/bitcoin/<network> iirc. Passing the network flag instructs lncli to grab the proper one

@autemox you shouldn’t have to pass a macaroon to create, that would create a cyclic dependency requiring the macaroon be generated before lnd has ever started