ipv4
This commit is contained in:
@@ -119,7 +119,7 @@ echo ""
|
||||
# Run the command to get the list of enode strings from source
|
||||
echo "Fetching peers from source node..."
|
||||
echo "DEBUG: Executing: curl -X POST -H \"Content-Type: application/json\" --data '{\"jsonrpc\":\"2.0\",\"method\":\"admin_peers\",\"params\":[],\"id\":1}' \"$SOURCE_URL\""
|
||||
enodes=$(curl -X POST -H "Content-Type: application/json" --silent --data "{\"jsonrpc\":\"2.0\",\"method\":\"admin_peers\",\"params\":[],\"id\":1}" "$SOURCE_URL" | jq -r '.result[].enode' 2>/dev/null)
|
||||
enodes=$(curl --ipv4 -X POST -H "Content-Type: application/json" --silent --data "{\"jsonrpc\":\"2.0\",\"method\":\"admin_peers\",\"params\":[],\"id\":1}" "$SOURCE_URL" | jq -r '.result[].enode' 2>/dev/null)
|
||||
|
||||
# Check if the command was successful
|
||||
if [ $? -ne 0 ] || [ -z "$enodes" ]; then
|
||||
@@ -147,7 +147,7 @@ while IFS= read -r enode; do
|
||||
continue
|
||||
fi
|
||||
echo "DEBUG: Executing: curl -X POST -H \"Content-Type: application/json\" --data '{\"jsonrpc\":\"2.0\",\"method\":\"admin_addPeer\",\"params\":[\"${enode}\"],\"id\":1}' \"$TARGET_URL\""
|
||||
result=$(curl -X POST -H "Content-Type: application/json" --silent --data "{\"jsonrpc\":\"2.0\",\"method\":\"admin_addPeer\",\"params\":[\"${enode}\"],\"id\":1}" "$TARGET_URL" | jq -r '.result' 2>/dev/null)
|
||||
result=$(curl --ipv4 -X POST -H "Content-Type: application/json" --silent --data "{\"jsonrpc\":\"2.0\",\"method\":\"admin_addPeer\",\"params\":[\"${enode}\"],\"id\":1}" "$TARGET_URL" | jq -r '.result' 2>/dev/null)
|
||||
|
||||
if [ "$result" = "true" ] || [ "$result" = "null" ]; then
|
||||
echo " ✓ Success"
|
||||
|
||||
Reference in New Issue
Block a user