Skip to content

Commit

Permalink
feat: auto-gen p2p private key (#6910)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexghr authored Jun 5, 2024
1 parent 0435e9a commit 0fc9677
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ services:
PEER_ID_PRIVATE_KEY:
secrets:
- ethereum-host
- p2p-private-key
- p2p-boot-node
entrypoint:
[
"/bin/sh",
"-c",
"export ETHEREUM_HOST=$$(cat /var/run/secrets/ethereum-host);\
export PEER_ID_PRIVATE_KEY=$$(cat /var/run/secrets/p2p-private-key);\
export BOOTSTRAP_NODES=$$(cat /var/run/secrets/p2p-boot-node);\
test -z \"$PEER_ID_PRIVATE_KEY\" -a ! -f /var/lib/aztec/p2p-private-key && node /usr/src/yarn-project/cli/dest/bin/index.js generate-p2p-private-key | head -1 | cut -d' ' -f 3 | tee /var/lib/aztec/p2p-private-key || echo 'Re-using existing P2P private key';\
test -z \"$PEER_ID_PRIVATE_KEY\" && export PEER_ID_PRIVATE_KEY=$$(cat /var/lib/aztec/p2p-private-key);\
node /usr/src/yarn-project/aztec/dest/bin/index.js start --node --archiver",
]
volumes:
Expand Down Expand Up @@ -100,5 +100,3 @@ secrets:
environment: ETHEREUM_HOST
p2p-boot-node:
environment: BOOTSTRAP_NODES
p2p-private-key:
environment: PEER_ID_PRIVATE_KEY

0 comments on commit 0fc9677

Please sign in to comment.