Closed bodymindarts closed 2 years ago
Macaroon root keys are generated randomly: https://github.com/lightningnetwork/lnd/blob/master/macaroons/store.go#L353
It would be possible to instead accept the param when running w/ the dev
build/debug tag on.
Cool that would solve the Macaroon related part. What about the identity_pubkey
(retrieved via lncli getinfo | jq -r .identity_pubkey
). Is this also derived from that randomness?
The node public key is derived from the seed with path m/1017'/0'/6/0/1
, so re-using a seed will always yield the same node public key.
The node public key is derived from the seed with path m/1017'/0'/6/0/1, so re-using a seed will always yield the same node public key.
I'm aware of that. I just cannot see where I can provide the seed deterministically. I cannot find an option in the lnd.conf
file.
It's part of the initialization/wallet creation process, see https://api.lightning.community/#initwallet.
Will be fixed by https://github.com/lightningnetwork/lnd/pull/6457 (the macaroon part, as mentioned above the identity part is already solved by using the same seed in the wallet initialization process).
Background
For https://github.com/GaloyMoney/galoy we run integration tests with 4 LND instances running at the same time brought up in
docker-compose
. Our server runtime requires knowledge of theadmin.macaroon
andidentity_pubkey
. Currently these are only retrievable once LND has bootstrapped but this adds overhead to running the tests that we would prefer to avoid.We want to be able to start an LND process in a container with a predetermined
admin
macaroon andidentity_pubkey
so that we don't have to wait for LND to start running in order to retrieve the information and continue on with the test setup.Is there a way to start LND with this data being pre-defined? Or would it be possible to add this as a feature?