19 lines
611 B
Bash
Executable File
19 lines
611 B
Bash
Executable File
#!/bin/bash
|
|
|
|
BASEPATH="$(dirname "$0")"
|
|
source $BASEPATH/.env
|
|
|
|
echo "running in $BASEPATH"
|
|
|
|
target_file="op-lisk-sepolia-node-$(date +'%Y-%m-%d-%H-%M-%S').peers"
|
|
|
|
echo "wait 10 seconds for the node to come online"
|
|
sleep 10
|
|
|
|
newest_file=$(ls -1 /backup/op-lisk-sepolia-node-*.peers 2>/dev/null | sort | tail -n 1)
|
|
|
|
while IFS= read -r line; do
|
|
# Process each line here
|
|
docker exec rpc-op-lisk-sepolia-node-1 curl -s -X POST -H "Content-Type: application/json" --data "{\"jsonrpc\":\"2.0\",\"method\":\"opp2p_connectPeer\",\"params\":[$line],\"id\":1}" http://localhost:8545
|
|
done < "$newest_file"
|