fix web-app

This commit is contained in:
johba 2025-09-24 14:02:28 +02:00
parent 967e9085ac
commit 4467d41edf
4 changed files with 195 additions and 21 deletions

View file

@ -90,7 +90,7 @@ log() {
wait_for_rpc() {
local url="$1"
for _ in {1..60}; do
if curl -s -o /dev/null -X POST "$url" -H "Content-Type: application/json" \
if curl --max-time 1 --connect-timeout 1 -s -o /dev/null -X POST "$url" -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'; then
return 0
fi
@ -103,7 +103,7 @@ wait_for_rpc() {
wait_for_http() {
local url="$1"
for _ in {1..60}; do
if curl -sSf "$url" >/dev/null 2>&1; then
if curl --max-time 1 --connect-timeout 1 -sSf "$url" >/dev/null 2>&1; then
return 0
fi
sleep 1
@ -186,7 +186,8 @@ start_anvil() {
log "Starting Anvil (forking $FORK_URL)"
local anvil_args=("--fork-url" "$FORK_URL" "--chain-id" 31337 "--block-time" 1 \
"--host" 127.0.0.1 "--port" 8545)
"--host" 127.0.0.1 "--port" 8545 "--threads" 4 "--timeout" 2000 "--retries" 2 \
"--fork-retry-backoff" 100)
if [[ -f "$MNEMONIC_FILE" ]]; then
local mnemonic
@ -305,7 +306,7 @@ prepare_application_state() {
prime_chain_for_indexing() {
log "Pre-mining blocks for indexer stability"
for _ in {1..1200}; do
for _ in {1..2000}; do
"$CAST" rpc --rpc-url "$ANVIL_RPC" evm_mine > /dev/null 2>&1 || true
done
}
@ -393,9 +394,12 @@ start_frontend() {
"VITE_LOCAL_RPC_PROXY_TARGET=$ANVIL_RPC"
"VITE_KRAIKEN_ADDRESS=$KRAIKEN"
"VITE_STAKE_ADDRESS=$STAKE"
"VITE_LIQUIDITY_MANAGER=$LIQUIDITY_MANAGER"
"VITE_SWAP_ROUTER=$SWAP_ROUTER"
"VITE_PONDER_BASE_SEPOLIA_LOCAL_FORK=$GRAPHQL_ENDPOINT"
"VITE_TXNBOT_BASE_SEPOLIA_LOCAL_FORK=$LOCAL_TXNBOT_URL"
"VITE_ENABLE_EVENT_STREAM=false"
"VITE_POSITIONS_POLL_MS=0"
)
log "Starting frontend (Vite dev server)"