I coded simple js app that fetch data from arveawe, but getting and EHOSTUNREACH error
import fetch from 'node-fetch';
import fs from 'fs';
let rawfile = fs.readFileSync('./Result.json');
let file = JSON.parse(rawfile);
console.log(`Items:`);
console.log(`========================================================`);
let nameAndUri = {};
let map = {};
let arr = [];
let settings = {method: 'GET', headers: {Accept: 'application/json'}};
file.forEach(itr => {
// nameAndUri[itr.data.name] = itr.data.uri;
console.log(itr.name);
fetch(itr.uri, settings)
.then(res => res.json())
.then((json) => {
arr.push(json);
})
.catch(error => { throw error; });
});
console.log(arr);
console.log(`========================================================`);
console.log(`Finished count...`);
console.log(`========================================================`);
I also tried axios but same result..
FetchError: request to https://arweave.net/xxxxxxxxxxxxxxxxxxxx failed, reason: connect EHOSTUNREACH 99.86.240.11:443 at ClientRequest. (file:///xxxxxxxxxxx/node_modules/node-fetch/src/index.js:108:11) at ClientRequest.emit (events.js:400:28) at TLSSocket.socketErrorListener (_http_client.js:475:9) at TLSSocket.emit (events.js:400:28) at emitErrorNT (internal/streams/destroy.js:106:8) at emitErrorCloseNT (internal/streams/destroy.js:74:3) at processTicksAndRejections (internal/process/task_queues.js:82:21) { type: 'system', errno: 'EHOSTUNREACH', code: 'EHOSTUNREACH', erroredSysCall: 'connect' }
I was looking for some solution, but nothing found..
node fetch version node-fetch@3.2.4
node version v16.15.0
thanks