copy wallet and macaroon dbs for deterministic wallets/macaroons

This commit is contained in:
keyan 2024-03-08 18:40:10 -06:00
parent 215f330771
commit 0e02aa7d8d
10 changed files with 39 additions and 17 deletions

View File

@ -65,9 +65,9 @@ JWT_SIGNING_PRIVATE_KEY={"kty":"oct","kid":"FvD__hmeKoKHu2fKjUrWbRKfhjimIM4IKshy
INVOICE_HMAC_KEY=a4c1d9c81edb87b79d28809876a18cf72293eadb39f92f3f4f2f1cfbdf907c91 INVOICE_HMAC_KEY=a4c1d9c81edb87b79d28809876a18cf72293eadb39f92f3f4f2f1cfbdf907c91
# lnd # lnd
# xxd -p -c0 docker/lnd/sn/macaroons/admin.macaroon # xxd -p -c0 docker/lnd/sn/regtest/admin.macaroon
LND_CERT=2d2d2d2d2d424547494e2043455254494649434154452d2d2d2d2d0a4d494943516a43434165696741774942416749516139493834682b48653350385a437541525854554d54414b42676771686b6a4f50515144416a41344d5238770a485159445651514b45785a73626d5167595856306232646c626d56795958526c5a43426a5a584a304d5255774577594456515144457778694e6a41785a5749780a4d474d354f444d774868634e4d6a51774d7a41334d5463774d6a45355768634e4d6a55774e5441794d5463774d6a4535576a41344d523877485159445651514b0a45785a73626d5167595856306232646c626d56795958526c5a43426a5a584a304d5255774577594456515144457778694e6a41785a5749784d474d354f444d770a5754415442676371686b6a4f5051494242676771686b6a4f50514d4242774e4341415365596a4b62542b4a4a4a37624b6770677a6d6c3278496130364e3174680a2f4f7033533173382b4f4a41387836647849682f326548556b4f7578675a36703549434b496f375a544c356a5963764375793941334b6e466f3448544d4948510a4d41344741315564447745422f775145417749437044415442674e56485355454444414b4267677242674546425163444154415042674e5648524d42416638450a425441444151482f4d4230474131556444675157424252545756796e653752786f747568717354727969466d6a36736c557a423542674e5648524545636a42770a676778694e6a41785a5749784d474d354f444f4343577876593246736147397a64494947633235666247356b6768526f62334e304c6d52765932746c636935700a626e526c636d356862494945645735706549494b64573570654842685932746c64494948596e566d59323975626f6345667741414159635141414141414141410a41414141414141414141414141596345724273414254414b42676771686b6a4f5051514441674e4941444246416945413873616c4a667134476671465557532f0a35347a335461746c6447736673796a4a383035425a5263334f326f434943794e6e3975716976566f5575365935345143624c3966394c575779547a516e61616e0a656977482f51696b0a2d2d2d2d2d454e442043455254494649434154452d2d2d2d2d0a LND_CERT=2d2d2d2d2d424547494e2043455254494649434154452d2d2d2d2d0a4d494943516a43434165696741774942416749516139493834682b48653350385a437541525854554d54414b42676771686b6a4f50515144416a41344d5238770a485159445651514b45785a73626d5167595856306232646c626d56795958526c5a43426a5a584a304d5255774577594456515144457778694e6a41785a5749780a4d474d354f444d774868634e4d6a51774d7a41334d5463774d6a45355768634e4d6a55774e5441794d5463774d6a4535576a41344d523877485159445651514b0a45785a73626d5167595856306232646c626d56795958526c5a43426a5a584a304d5255774577594456515144457778694e6a41785a5749784d474d354f444d770a5754415442676371686b6a4f5051494242676771686b6a4f50514d4242774e4341415365596a4b62542b4a4a4a37624b6770677a6d6c3278496130364e3174680a2f4f7033533173382b4f4a41387836647849682f326548556b4f7578675a36703549434b496f375a544c356a5963764375793941334b6e466f3448544d4948510a4d41344741315564447745422f775145417749437044415442674e56485355454444414b4267677242674546425163444154415042674e5648524d42416638450a425441444151482f4d4230474131556444675157424252545756796e653752786f747568717354727969466d6a36736c557a423542674e5648524545636a42770a676778694e6a41785a5749784d474d354f444f4343577876593246736147397a64494947633235666247356b6768526f62334e304c6d52765932746c636935700a626e526c636d356862494945645735706549494b64573570654842685932746c64494948596e566d59323975626f6345667741414159635141414141414141410a41414141414141414141414141596345724273414254414b42676771686b6a4f5051514441674e4941444246416945413873616c4a667134476671465557532f0a35347a335461746c6447736673796a4a383035425a5263334f326f434943794e6e3975716976566f5575365935345143624c3966394c575779547a516e61616e0a656977482f51696b0a2d2d2d2d2d454e442043455254494649434154452d2d2d2d2d0a
LND_MACAROON=0201036c6e6402f801030a10206f3a63d5bf8355755851ace460077d1201301a160a0761646472657373120472656164120577726974651a130a04696e666f120472656164120577726974651a170a08696e766f69636573120472656164120577726974651a210a086d616361726f6f6e120867656e6572617465120472656164120577726974651a160a076d657373616765120472656164120577726974651a170a086f6666636861696e120472656164120577726974651a160a076f6e636861696e120472656164120577726974651a140a057065657273120472656164120577726974651a180a067369676e6572120867656e657261746512047265616400000620bc992b1c727644c462370b69a3dd39575666f3a7ac9ec120c97e3e7906dc4cb2 LND_MACAROON=0201036c6e6402f801030a106cf4e146abffa5d766befbbf4c73b5a31201301a160a0761646472657373120472656164120577726974651a130a04696e666f120472656164120577726974651a170a08696e766f69636573120472656164120577726974651a210a086d616361726f6f6e120867656e6572617465120472656164120577726974651a160a076d657373616765120472656164120577726974651a170a086f6666636861696e120472656164120577726974651a160a076f6e636861696e120472656164120577726974651a140a057065657273120472656164120577726974651a180a067369676e6572120867656e6572617465120472656164000006202c3bfd55c191e925cbffd73712c9d4b9b4a8440410bde5f8a0a6e33af8b3d876
LND_SOCKET=sn_lnd:10009 LND_SOCKET=sn_lnd:10009
# nostr (NIP-57 zap receipts) # nostr (NIP-57 zap receipts)
@ -113,8 +113,13 @@ ZMQ_TX_PORT=28335
LND_REST_PORT=8080 LND_REST_PORT=8080
LND_GRPC_PORT=10009 LND_GRPC_PORT=10009
LND_P2P_PORT=9735 LND_P2P_PORT=9735
# docker exec -u lnd sn_lnd lncli newaddress p2tr --unused
LND_ADDR=bcrt1phujdlvh2ttfdxcsc2c3p3vv6g5uutua9pr846r94ae33636gxy7qkly70z
# stacker lnd container stuff # stacker lnd container stuff
STACKER_LND_REST_PORT=9090 STACKER_LND_REST_PORT=9090
STACKER_LND_GRPC_PORT=10010 STACKER_LND_GRPC_PORT=10010
STACKER_LND_P2P_PORT=9736 # docker exec -u lnd stacker_lnd lncli newaddress p2tr --unused
STACKER_LND_ADDR=bcrt1pn0ach38n7k5ejxw7e2mx02gqe237em7d9eev3dcd2yst3tlyhtdswkgd89
LNCLI_NETWORK=regtest

View File

@ -181,7 +181,10 @@ services:
volumes: volumes:
- bitcoin:/home/bitcoin/.bitcoin - bitcoin:/home/bitcoin/.bitcoin
sn_lnd: sn_lnd:
image: polarlightning/lnd:0.17.4-beta build:
context: ./docker/lnd
args:
- LN_NODE_FOR=sn
container_name: sn_lnd container_name: sn_lnd
restart: unless-stopped restart: unless-stopped
healthcheck: healthcheck:
@ -215,6 +218,9 @@ services:
- '--bitcoind.rpcpass=${RPC_PASS}' - '--bitcoind.rpcpass=${RPC_PASS}'
- '--bitcoind.zmqpubrawblock=tcp://bitcoin:${ZMQ_BLOCK_PORT}' - '--bitcoind.zmqpubrawblock=tcp://bitcoin:${ZMQ_BLOCK_PORT}'
- '--bitcoind.zmqpubrawtx=tcp://bitcoin:${ZMQ_TX_PORT}' - '--bitcoind.zmqpubrawtx=tcp://bitcoin:${ZMQ_TX_PORT}'
- '--protocol.wumbo-channels'
- '--maxchansize=1000000000'
- '--allow-circular-route'
expose: expose:
- "${LND_P2P_PORT}" - "${LND_P2P_PORT}"
ports: ports:
@ -222,11 +228,11 @@ services:
- "${LND_GRPC_PORT}:${LND_GRPC_PORT}" - "${LND_GRPC_PORT}:${LND_GRPC_PORT}"
volumes: volumes:
- sn_lnd:/home/lnd/.lnd - sn_lnd:/home/lnd/.lnd
- ./docker/lnd/sn/macaroons/macaroons.db:/home/lnd/.lnd/data/chain/bitcoin/regtest/macaroons.db
- ./docker/lnd/sn/tls.cert:/home/lnd/.lnd/tls.cert
- ./docker/lnd/sn/tls.key:/home/lnd/.lnd/tls.key
stacker_lnd: stacker_lnd:
image: polarlightning/lnd:0.17.4-beta build:
context: ./docker/lnd
args:
- LN_NODE_FOR=stacker
container_name: stacker_lnd container_name: stacker_lnd
restart: unless-stopped restart: unless-stopped
healthcheck: healthcheck:
@ -241,6 +247,8 @@ services:
restart: true restart: true
env_file: env_file:
- .env.sndev - .env.sndev
environment:
- LN_NODE_FOR=stacker
command: command:
- 'lnd' - 'lnd'
- '--noseedbackup' - '--noseedbackup'
@ -249,9 +257,9 @@ services:
- '--externalip=stacker_lnd' - '--externalip=stacker_lnd'
- '--tlsextradomain=stacker_lnd' - '--tlsextradomain=stacker_lnd'
- '--tlsextradomain=host.docker.internal' - '--tlsextradomain=host.docker.internal'
- '--listen=0.0.0.0:${STACKER_LND_P2P_PORT}' - '--listen=0.0.0.0:${LND_P2P_PORT}'
- '--rpclisten=0.0.0.0:${STACKER_LND_GRPC_PORT}' - '--rpclisten=0.0.0.0:${LND_GRPC_PORT}'
- '--restlisten=0.0.0.0:${STACKER_LND_REST_PORT}' - '--restlisten=0.0.0.0:${LND_REST_PORT}'
- '--bitcoin.active' - '--bitcoin.active'
- '--bitcoin.regtest' - '--bitcoin.regtest'
- '--bitcoin.node=bitcoind' - '--bitcoin.node=bitcoind'
@ -260,15 +268,16 @@ services:
- '--bitcoind.rpcpass=${RPC_PASS}' - '--bitcoind.rpcpass=${RPC_PASS}'
- '--bitcoind.zmqpubrawblock=tcp://bitcoin:${ZMQ_BLOCK_PORT}' - '--bitcoind.zmqpubrawblock=tcp://bitcoin:${ZMQ_BLOCK_PORT}'
- '--bitcoind.zmqpubrawtx=tcp://bitcoin:${ZMQ_TX_PORT}' - '--bitcoind.zmqpubrawtx=tcp://bitcoin:${ZMQ_TX_PORT}'
- '--protocol.wumbo-channels'
- '--maxchansize=1000000000'
- '--allow-circular-route'
expose: expose:
- "${STACKER_LND_P2P_PORT}" - "${LND_P2P_PORT}"
ports: ports:
- "${STACKER_LND_REST_PORT}:${STACKER_LND_REST_PORT}" - "${STACKER_LND_REST_PORT}:${LND_REST_PORT}"
- "${STACKER_LND_GRPC_PORT}:${STACKER_LND_GRPC_PORT}" - "${STACKER_LND_GRPC_PORT}:${LND_GRPC_PORT}"
volumes: volumes:
- stacker_lnd:/home/lnd/.lnd - stacker_lnd:/home/lnd/.lnd
- ./docker/lnd/stacker/tls.cert:/home/lnd/.lnd/tls.cert
- ./docker/lnd/stacker/tls.key:/home/lnd/.lnd/tls.key
volumes: volumes:
db: db:
os: os:

6
docker/lnd/Dockerfile Normal file
View File

@ -0,0 +1,6 @@
FROM polarlightning/lnd:0.17.4-beta
ARG LN_NODE_FOR
COPY ["./$LN_NODE_FOR/regtest/*", "/home/lnd/.lnd/data/chain/bitcoin/regtest/"]
COPY ["./$LN_NODE_FOR/tls.*", "/home/lnd/.lnd/"]

View File

@ -1,3 +1,5 @@
We assume control of certs so that the app container doesn't need to inspect lnd for these things. We assume control of certs so that the app container doesn't need to inspect lnd for these things.
For the admin.macaroon, we do the same but we also need to store `macaroons.db` because it contains the master key. For the admin.macaroon, we do the same but we also need to store `macaroons.db` because it contains the master key.
For the wallet addresses, we do the same but we also need to store `wallet.db` because it contains the master key.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.