@zerochain/0chain
Advanced tools
Comparing version 1.3.32 to 1.3.33
19
index.js
@@ -681,10 +681,17 @@ /* | ||
const completeAllocationInfo = await this.allocationInfo(allocation_id); | ||
const blobber = completeAllocationInfo.blobbers[0].url; | ||
return new Promise(async function (resolve, reject) { | ||
const blobber_url = blobber + Endpoints.FILE_STATS_ENDPOINT + allocation_id; | ||
const response = await utils.postReqToBlobber(blobber_url, {}, { path: path }, client_id); | ||
if (response.status === 200) { | ||
resolve(response.data) | ||
let allBlobbersResponse = [] | ||
for(let blobber of completeAllocationInfo.blobbers){ | ||
const blobber_url = blobber.url + Endpoints.FILE_STATS_ENDPOINT + allocation_id; | ||
await utils.postReqToBlobber(blobber_url, {}, { path: path }, client_id) | ||
.then((response) => { | ||
allBlobbersResponse.push({...response.data, url: blobber.url}) | ||
}).catch((err)=>{ | ||
console.log(err) | ||
}) | ||
} | ||
if(allBlobbersResponse.length > 0){ | ||
resolve(allBlobbersResponse); | ||
} else { | ||
reject('Not able to fetch file stats from blobbers') | ||
reject("Not able to fetch file details from blobbers") | ||
} | ||
@@ -691,0 +698,0 @@ }); |
{ | ||
"name": "@zerochain/0chain", | ||
"version": "1.3.32", | ||
"version": "1.3.33", | ||
"description": "js client library to interact with 0chain Blockchain", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
174515
1706