File tree Expand file tree Collapse file tree 3 files changed +54
-0
lines changed
Expand file tree Collapse file tree 3 files changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,9 @@ ipfs swarm connect /ip4/127.0.0.1/tcp/12347/ws/p2p/12D3KooWRkZhiRhsqmrQ28rt73K7V
6161# Or docker (change 127.0.0.1 -> 172.17.0.1)
6262docker exec -it ipfs-node ipfs swarm connect /ip4/172.17.0.1/tcp/10001/ws/p2p/12D3KooWQCkBm1BYtkHpocxCwMgR8yjitEeHGx8spzcDLGt2gkBm
6363docker exec -it ipfs-node ipfs swarm connect /ip4/172.17.0.1/tcp/12347/ws/p2p/12D3KooWRkZhiRhsqmrQ28rt73K7V3aCBpqKrLGSXmZ99PTcTZby
64+
65+ # Or run script which reconnects every 2 seconds
66+ ./scripts/ipfs-reconnect-solo.sh
6467```
6568
6669## Run Bulletin (Westend) parachain with ` --ipfs-server `
@@ -72,6 +75,9 @@ POLKADOT_BINARY_PATH=~/local_bridge_testing/bin/polkadot POLKADOT_PARACHAIN_BINA
7275# For docker (change 127.0.0.1 -> 172.17.0.1)
7376docker exec -it ipfs-node ipfs swarm connect /ip4/172.17.0.1/tcp/10001/ws/p2p/12D3KooWJKVVNYByvML4Pgx1GWAYryYo6exA68jQX9Mw3AJ6G5gQ
7477docker exec -it ipfs-node ipfs swarm connect /ip4/172.17.0.1/tcp/12347/ws/p2p/12D3KooWJ8sqAYtMBX3z3jy2iM98XGLFVzVfUPtmgDzxXSPkVpZZ
78+
79+ # Or run script which reconnects every 2 seconds
80+ ./scripts/ipfs-reconnect-westend.sh
7581```
7682
7783## Trigger authorize, store and IPFS get
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Peers to monitor
4+ PEERS_TO_CHECK=(
5+ " /ip4/172.17.0.1/tcp/10001/ws/p2p/12D3KooWQCkBm1BYtkHpocxCwMgR8yjitEeHGx8spzcDLGt2gkBm"
6+ " /ip4/172.17.0.1/tcp/12347/ws/p2p/12D3KooWRkZhiRhsqmrQ28rt73K7V3aCBpqKrLGSXmZ99PTcTZby"
7+ )
8+
9+ while true ; do
10+ # Read all current connections once
11+ PEERS=$( docker exec ipfs-node ipfs swarm peers)
12+
13+ for PEER in " ${PEERS_TO_CHECK[@]} " ; do
14+ echo " $PEERS " | grep -q " $PEER "
15+ if [ $? -ne 0 ]; then
16+ echo " $( date) - $PEER disconnected. Reconnecting..."
17+ docker exec ipfs-node ipfs swarm connect " $PEER "
18+ else
19+ echo " $( date) - $PEER connected."
20+ fi
21+ done
22+
23+ sleep 2
24+ done
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Peers to monitor
4+ PEERS_TO_CHECK=(
5+ " /ip4/172.17.0.1/tcp/10001/ws/p2p/12D3KooWJKVVNYByvML4Pgx1GWAYryYo6exA68jQX9Mw3AJ6G5gQ"
6+ " /ip4/172.17.0.1/tcp/12347/ws/p2p/12D3KooWJ8sqAYtMBX3z3jy2iM98XGLFVzVfUPtmgDzxXSPkVpZZ"
7+ )
8+
9+ while true ; do
10+ # Read all current connections once
11+ PEERS=$( docker exec ipfs-node ipfs swarm peers)
12+
13+ for PEER in " ${PEERS_TO_CHECK[@]} " ; do
14+ echo " $PEERS " | grep -q " $PEER "
15+ if [ $? -ne 0 ]; then
16+ echo " $( date) - $PEER disconnected. Reconnecting..."
17+ docker exec ipfs-node ipfs swarm connect " $PEER "
18+ else
19+ echo " $( date) - $PEER connected."
20+ fi
21+ done
22+
23+ sleep 2
24+ done
You can’t perform that action at this time.
0 commit comments