-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Devnet setup for p2p bootstrap node (#6660)
Fixes #6513
- Loading branch information
Showing
12 changed files
with
140 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
yarn-project/aztec-faucet/terraform/servicediscovery-drain.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
[ $# -ne 1 ] && echo "Usage: $0 <service-id>" && exit 1 | ||
|
||
serviceId="--service-id=$1" | ||
|
||
echo "Draining servicediscovery instances from $1 ..." | ||
ids="$(aws servicediscovery list-instances $serviceId --query 'Instances[].Id' --output text | tr '\t' ' ')" | ||
|
||
found= | ||
for id in $ids; do | ||
if [ -n "$id" ]; then | ||
echo "Deregistering $1 / $id ..." | ||
aws servicediscovery deregister-instance $serviceId --instance-id "$id" | ||
found=1 | ||
fi | ||
done | ||
|
||
# Yes, I'm being lazy here... | ||
[ -n "$found" ] && sleep 5 || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,15 @@ | ||
import { type DebugLogger } from '@aztec/aztec.js'; | ||
import { type LogFn } from '@aztec/foundation/log'; | ||
import { BootstrapNode, type P2PConfig, getP2PConfigEnvVars } from '@aztec/p2p'; | ||
import { type P2PConfig, getP2PConfigEnvVars } from '@aztec/p2p'; | ||
import runBootstrapNode from '@aztec/p2p-bootstrap'; | ||
|
||
import { mergeEnvVarsAndCliOptions, parseModuleOptions } from '../util.js'; | ||
|
||
export const startP2PBootstrap = async ( | ||
options: any, | ||
signalHandlers: (() => Promise<void>)[], | ||
userLog: LogFn, | ||
debugLogger: DebugLogger, | ||
) => { | ||
export const startP2PBootstrap = async (options: any, userLog: LogFn, debugLogger: DebugLogger) => { | ||
// Start a P2P bootstrap node. | ||
const envVars = getP2PConfigEnvVars(); | ||
const cliOptions = parseModuleOptions(options.p2pBootstrap); | ||
const bootstrapNode = new BootstrapNode(debugLogger); | ||
const config = mergeEnvVarsAndCliOptions<P2PConfig>(envVars, cliOptions); | ||
await bootstrapNode.start(config); | ||
userLog(`P2P bootstrap node started on ${config.tcpListenIp}:${config.tcpListenPort}`); | ||
signalHandlers.push(bootstrapNode.stop); | ||
await runBootstrapNode(config, debugLogger); | ||
userLog(`P2P bootstrap node started on ${config.udpListenIp}:${config.udpListenPort}`); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,9 @@ | |
{ | ||
"path": "../p2p" | ||
}, | ||
{ | ||
"path": "../p2p-bootstrap" | ||
}, | ||
{ | ||
"path": "../protocol-contracts" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.