Skip to content

Commit 93fb58f

Browse files
committed
Fix: wait for P2P service at startup
Problem: some users experience an issue where the node crashes at startup on the first attempt to connect to the P2P service. This occurs because the P2P service takes too long to start its HTTP server, usually because one of the bootstrap peers is too slow to respond or because of a configuration issue. Solution: wait for the P2P service HTTP server to be available in the node startup script.
1 parent dede5fd commit 93fb58f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

deployment/scripts/run_aleph_ccn.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,15 @@ IPFS_HOST=$(get_config ipfs.host)
4444
IPFS_PORT=$(get_config ipfs.port)
4545
RABBITMQ_HOST=$(get_config rabbitmq.host)
4646
RABBITMQ_PORT=$(get_config rabbitmq.port)
47+
P2P_SERVICE_HOST=$(get_config p2p.daemon_host)
48+
P2P_SERVICE_CONTROL_PORT=$(get_config p2p.control_port)
4749

4850
if [ "$(get_config ipfs.enabled)" = "True" ]; then
4951
wait_for_it -h "${IPFS_HOST}" -p "${IPFS_PORT}"
5052
fi
5153

5254
wait_for_it -h "${POSTGRES_HOST}" -p "${POSTGRES_PORT}"
5355
wait_for_it -h "${RABBITMQ_HOST}" -p "${RABBITMQ_PORT}"
56+
wait_for_it -h "${P2P_SERVICE_HOST}" -p "${P2P_SERVICE_CONTROL_PORT}"
5457

5558
exec pyaleph "${PYALEPH_ARGS[@]}"

0 commit comments

Comments
 (0)