50 lines
2.6 KiB
Bash
Executable File
50 lines
2.6 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Script de test de connectivité pour sdk_relay
|
|
set -e
|
|
|
|
echo "🔍 Test de connectivité pour sdk_relay..."
|
|
echo ""
|
|
|
|
# Test 1: Vérifier que le container sdk_relay peut résoudre les noms d'hôtes
|
|
echo "📡 Test 1: Résolution DNS depuis sdk_relay"
|
|
if sudo docker run --rm --network 4nk_node_btcnet --name test_sdk_relay lecoffre_node_sdk_relay getent hosts bitcoin 2>/dev/null | grep -q "bitcoin"; then
|
|
echo "✅ Résolution DNS 'bitcoin' OK"
|
|
else
|
|
echo "❌ Résolution DNS 'bitcoin' échoue"
|
|
fi
|
|
|
|
if sudo docker run --rm --network 4nk_node_btcnet --name test_sdk_relay lecoffre_node_sdk_relay getent hosts blindbit 2>/dev/null | grep -q "blindbit"; then
|
|
echo "✅ Résolution DNS 'blindbit' OK"
|
|
else
|
|
echo "❌ Résolution DNS 'blindbit' échoue"
|
|
fi
|
|
|
|
# Test 2: Vérifier la connectivité depuis sdk_relay
|
|
echo ""
|
|
echo "📡 Test 2: Connectivité depuis sdk_relay"
|
|
if sudo docker run --rm --network 4nk_node_btcnet --name test_sdk_relay lecoffre_node_sdk_relay sh -c "nc -z bitcoin 18443" 2>/dev/null; then
|
|
echo "✅ Bitcoin Core accessible depuis sdk_relay"
|
|
else
|
|
echo "❌ Bitcoin Core inaccessible depuis sdk_relay"
|
|
fi
|
|
|
|
if sudo docker run --rm --network 4nk_node_btcnet --name test_sdk_relay lecoffre_node_sdk_relay sh -c "nc -z blindbit 8000" 2>/dev/null; then
|
|
echo "✅ Blindbit accessible depuis sdk_relay"
|
|
else
|
|
echo "❌ Blindbit inaccessible depuis sdk_relay"
|
|
fi
|
|
|
|
# Test 3: Vérifier la configuration dans le container sdk_relay
|
|
echo ""
|
|
echo "📡 Test 3: Configuration dans sdk_relay"
|
|
echo "Configuration .conf.docker:"
|
|
sudo docker run --rm --network 4nk_node_btcnet --name test_sdk_relay lecoffre_node_sdk_relay cat /home/bitcoin/.conf.docker 2>/dev/null || echo "❌ Impossible de lire .conf.docker"
|
|
|
|
echo ""
|
|
echo "🎯 Résumé:"
|
|
echo " - DNS bitcoin: $(if sudo docker run --rm --network 4nk_node_btcnet --name test_sdk_relay lecoffre_node_sdk_relay getent hosts bitcoin 2>/dev/null | grep -q "bitcoin"; then echo "✅"; else echo "❌"; fi)"
|
|
echo " - DNS blindbit: $(if sudo docker run --rm --network 4nk_node_btcnet --name test_sdk_relay lecoffre_node_sdk_relay getent hosts blindbit 2>/dev/null | grep -q "blindbit"; then echo "✅"; else echo "❌"; fi)"
|
|
echo " - Connectivité Bitcoin: $(if sudo docker run --rm --network 4nk_node_btcnet --name test_sdk_relay lecoffre_node_sdk_relay sh -c "nc -z bitcoin 18443" 2>/dev/null; then echo "✅"; else echo "❌"; fi)"
|
|
echo " - Connectivité Blindbit: $(if sudo docker run --rm --network 4nk_node_btcnet --name test_sdk_relay lecoffre_node_sdk_relay sh -c "nc -z blindbit 8000" 2>/dev/null; then echo "✅"; else echo "❌"; fi)"
|