Skip to content

http://${targetIP}/peers requests are timing out for ips mentioned in network.js #11

@llk23r

Description

@llk23r

let cores = config.array('cores', ['3.142.136.148', '18.118.26.31', '3.133.161.241', '18.220.31.138', '3.145.43.113'])
has the following ips mentioned:
['3.142.136.148', '18.118.26.31', '3.133.161.241', '18.220.31.138', '3.145.43.113']

And the requests to http://${targetIP}/peers are failing where targetIP is one of the above IPs.

The following script:

const axios = require('axios');
const _ = require('lodash');
const IP_ADDRESSES = ["3.142.136.148", "18.118.26.31", "3.133.161.241", "18.220.31.138", "3.145.43.113"];
const TOTAL_ATTEMPTS = 100;

async function testRandomPeerEndpoints() {
  let successCount = 0, failureCount = 0;
  for (let i = 0; i < TOTAL_ATTEMPTS; i++) {
    const randomIp = _.sample(IP_ADDRESSES);
    try {
      console.log(`Attempt ${i + 1}: Testing ${randomIp}...`);
      await axios.get(`http://${randomIp}/peers`, {timeout: 30000}); // 30 seconds timeout
      console.log(`Success for ${randomIp}`);
      successCount++;
    } catch (error) {
      console.log(`Failed for ${randomIp}: `, error.message);
      failureCount++;
    }
  }
  console.log(`\nSummary: ${successCount} successes, ${failureCount} failures out of ${TOTAL_ATTEMPTS} attempts.`);
}

testRandomPeerEndpoints();

Produces the following result:
Screenshot 2024-02-15 at 7 43 55 PM

None of the IPs seem to be responding 😕
Please share if I'm doing something incorrectly here. Many thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions