diff --git a/containers/anvil-entrypoint.sh b/containers/anvil-entrypoint.sh index 63f40cf..8fb34b4 100755 --- a/containers/anvil-entrypoint.sh +++ b/containers/anvil-entrypoint.sh @@ -4,13 +4,22 @@ set -euo pipefail MNEMONIC_FILE=/workspace/onchain/.secret.local ANVIL_STATE_DIR=/home/foundry/.foundry/anvil/tmp -# Cleanup old state snapshots (files older than 24 hours) -# Prevents disk bloat from accumulating JSON snapshots +# Cleanup ALL old state snapshots on start + periodic cleanup in background +# Anvil fork mode generates thousands of JSON snapshots that fill disk fast if [[ -d "$ANVIL_STATE_DIR" ]]; then - echo "[anvil] Cleaning up state snapshots older than 24 hours..." - find "$ANVIL_STATE_DIR" -type f -name "*.json" -mtime +1 -delete 2>/dev/null || true + echo "[anvil] Cleaning up all state snapshots..." + rm -rf "$ANVIL_STATE_DIR"/* 2>/dev/null || true fi +# Background cleanup: every 6 hours, delete snapshots older than 1 hour +(while true; do + sleep 21600 + if [[ -d "$ANVIL_STATE_DIR" ]]; then + find "$ANVIL_STATE_DIR" -type f -name "*.json" -mmin +60 -delete 2>/dev/null || true + find "$ANVIL_STATE_DIR" -type d -empty -delete 2>/dev/null || true + fi +done) & + ANVIL_CMD=(anvil --fork-url "${FORK_URL:-https://sepolia.base.org}" --chain-id 31337 --block-time 1 --host 0.0.0.0 --port 8545 --threads 4 --timeout 2000 --retries 2 --fork-retry-backoff 100 --steps-tracing --no-storage-caching) if [[ -f "$MNEMONIC_FILE" ]]; then diff --git a/containers/landing-entrypoint.sh b/containers/landing-entrypoint.sh index d2695ca..efacad8 100755 --- a/containers/landing-entrypoint.sh +++ b/containers/landing-entrypoint.sh @@ -17,4 +17,13 @@ export CHOKIDAR_USEPOLLING=${CHOKIDAR_USEPOLLING:-1} export HOST=0.0.0.0 export PORT=${PORT:-5174} +# Source contract addresses from bootstrap output +CONTRACTS_ENV="$ROOT_DIR/tmp/containers/contracts.env" +if [[ -f "$CONTRACTS_ENV" ]]; then + source "$CONTRACTS_ENV" + export VITE_KRAIKEN_ADDRESS="${KRAIKEN:-}" + export VITE_STAKE_ADDRESS="${STAKE:-}" + echo "[landing-entrypoint] Contract addresses loaded: KRK=${KRAIKEN:-unset} STAKE=${STAKE:-unset}" +fi + exec npm run dev -- --host 0.0.0.0 --port 5174 diff --git a/docker-compose.yml b/docker-compose.yml index cd69484..e025c4a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -160,6 +160,7 @@ services: environment: - CHOKIDAR_USEPOLLING=1 - GIT_BRANCH=${GIT_BRANCH:-} + - VITE_APP_URL=http://localhost:5173/app expose: - "5174" restart: unless-stopped diff --git a/landing/package.json b/landing/package.json index a3ce872..76861d6 100644 --- a/landing/package.json +++ b/landing/package.json @@ -17,12 +17,13 @@ "prepare": "husky" }, "dependencies": { - "sass": "^1.83.4", - "vue": "^3.5.13", - "vue-router": "^4.5.0", "@harb/web3": "*", + "@tanstack/vue-query": "^5.92.9", "@wagmi/vue": "^0.2.8", - "viem": "^2.22.13" + "sass": "^1.83.4", + "viem": "^2.22.13", + "vue": "^3.5.13", + "vue-router": "^4.5.0" }, "devDependencies": { "@tsconfig/node22": "^22.0.0", diff --git a/landing/src/components/WalletCard.vue b/landing/src/components/WalletCard.vue index ed510fe..4811857 100644 --- a/landing/src/components/WalletCard.vue +++ b/landing/src/components/WalletCard.vue @@ -1,7 +1,6 @@