Skip to content

Commit

Permalink
Fixes required for upgrade-test to run successfully.
Browse files Browse the repository at this point in the history
  • Loading branch information
MxmUrw committed Nov 18, 2024
1 parent 92fd496 commit fcc5e8c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/upgrade-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,12 @@ jobs:
run: |
cat /tmp/chainflip/chainflip-lp-api.*log
- name: Print chainflip-deposit-monitor logs 🔬
if: always()
continue-on-error: true
run: |
cat /tmp/chainflip/chainflip-deposit-monitor.*log
- name: Print localnet init debug logs 🕵️‍♂️
if: always()
continue-on-error: true
Expand Down
13 changes: 3 additions & 10 deletions bouncer/shared/upgrade_network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,19 +342,12 @@ export async function upgradeNetworkPrebuilt(
if (cleanOldVersion.startsWith('1.7')) {
console.log('Starting up deposit-monitor.');

execWithLog(`${localnetInitPath}/scripts/start-broker-api.sh`, 'start-broker-api', {
execWithLog(`${localnetInitPath}/scripts/start-deposit-monitor.sh`, 'start-deposit-monitor', {
LOCALNET_INIT_DIR: `${localnetInitPath}`,
DEPOSIT_MONITOR_CONTAINER: 'deposit-monitor',
DOCKER_COMPOSE_CMD: 'docker-compose',
DOCKER_COMPOSE_CMD: 'docker compose',
additional_docker_compose_up_args: '--quiet-pull',
});

try {
const pid = execSync(`lsof -t -i:6060`);
console.log(`New deposit-monitor PID: ${pid.toString()}`);
} catch (e) {
console.error(`Error starting deposit-monitor: ${e}`);
throw e;
}
}

if (cleanOldVersion === nodeVersion) {
Expand Down
1 change: 1 addition & 0 deletions localnet/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ build-localnet() {
KEYS_DIR=$KEYS_DIR ./$LOCALNET_INIT_DIR/scripts/start-lp-api.sh $BINARY_ROOT_PATH

echo "🔬 Starting Deposit Monitor ..."
LOCALNET_INIT_DIR=$LOCALNET_INIT_DIR \
DOCKER_COMPOSE_CMD=$DOCKER_COMPOSE_CMD \
DEPOSIT_MONITOR_CONTAINER=$DEPOSIT_MONITOR_CONTAINER \
additional_docker_compose_up_args=$additional_docker_compose_up_args \
Expand Down
7 changes: 5 additions & 2 deletions localnet/init/scripts/start-deposit-monitor.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
#!/bin/bash
set -e
DATETIME=$(date '+%Y-%m-%d_%H-%M-%S')

source ./localnet/helper.sh
source $LOCALNET_INIT_DIR/../helper.sh

# On some machines (e.g. MacOS), 172.17.0.1 is not accessible from inside the container, so we need to use host.docker.internal
if [[ $CI == true ]]; then
export CFDM_BROKER_API_URL='ws://172.17.0.1:10997'
else
export CFDM_BROKER_API_URL='ws://host.docker.internal:10997'
fi
$DOCKER_COMPOSE_CMD -f localnet/docker-compose.yml -p "chainflip-localnet" up $DEPOSIT_MONITOR_CONTAINER $additional_docker_compose_up_args -d >>$DEBUG_OUTPUT_DESTINATION 2>&1
$DOCKER_COMPOSE_CMD -f $LOCALNET_INIT_DIR/../docker-compose.yml -p "chainflip-localnet" up $DEPOSIT_MONITOR_CONTAINER $additional_docker_compose_up_args -d \
> /tmp/chainflip/chainflip-deposit-monitor.$DATETIME.log 2>&1

while true; do
echo "🩺 Checking deposit-monitor's health ..."
REPLY=$(check_endpoint_health 'http://localhost:6060/health')
Expand Down

0 comments on commit fcc5e8c

Please sign in to comment.