Can't figure out how to use /v1/initwallet byte macaroon. #5934
-
Hello, I'm currently trying to make my first project with LND. In order to do so I need to initialize my wallet using the rest LND api endpoint: /v1/initwallet. Can anyone help me with that ? If it's my question is not clear do not hesitate to ask for precisions. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
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
If you use the one you get in the response to |
Beta Was this translation helpful? Give feedback.
-
Alright thanks. What I was missing was the fact that the REST responded a
|
Beta Was this translation helpful? Give feedback.
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:
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.