Skip to content

Commit ddbcbff

Browse files
committed
only check network connection if it is not a dry run
1 parent 42833cc commit ddbcbff

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

script/deploy.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,19 @@ echo
5757
# Set environment variable for the script
5858
export MANAGER_ADDRESS=$MANAGER_ADDRESS
5959

60-
echo "Testing RPC connection..."
61-
if ! curl -s -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' "$RPC_URL" > /dev/null; then
62-
echo "Can't connect to $RPC_URL"
63-
exit 1
64-
fi
65-
66-
echo "Running..."
67-
6860
# Build forge command with dry-run support
6961
FORGE_CMD="forge script script/DeployKeyManager.s.sol:DeployKeyManager --rpc-url $RPC_URL"
7062

7163
if [ "$DRY_RUN" = true ]; then
7264
echo "Running simulation (dry run)"
7365
FORGE_CMD="$FORGE_CMD -- --dry-run"
7466
else
67+
echo "Testing blockchain network connection..."
68+
if ! curl -s -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' "$RPC_URL" > /dev/null; then
69+
echo "Can't connect to $RPC_URL"
70+
exit 1
71+
fi
72+
echo "Network is reachable. Running deployment..."
7573
FORGE_CMD="$FORGE_CMD --broadcast"
7674
fi
7775

0 commit comments

Comments
 (0)