Skip to content

Can't figure out how to use /v1/initwallet byte macaroon. #5934

Answered by guggero
lucas-naman asked this question in Q&A
Discussion options

You must be logged in to vote

You don't have to use the macaroon that is returned to you. You can also use one of the files created by default in ~/.lnd/data/chain/bitcoin/<network>/*.macaroon.
In any case, the macaroon must be hex encoded in the header field:

  headers: {
    'Grpc-Metadata-macaroon': macaroon,
  },

If you use the one you get in the response to /v1/initwallet you might need to convert it, as it's base64 in REST responses: base64 -> raw bytes/buffer -> encode as hex.
If you use a file, you get the raw bytes from the file and also need to hex encode them.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@lucas-naman
Comment options

Answer selected by lucas-naman
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants