From fd7586ff88eb58bc5e197383ec479474d98736c7 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Wed, 3 Oct 2018 18:39:01 +0200 Subject: [PATCH] fix: use random preloader as a fallback --- scripts/fetch-webui-from-gateway.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/fetch-webui-from-gateway.js b/scripts/fetch-webui-from-gateway.js index ee4908463..4fc54be99 100755 --- a/scripts/fetch-webui-from-gateway.js +++ b/scripts/fetch-webui-from-gateway.js @@ -8,7 +8,9 @@ const progress = require('request-progress') const cid = process.argv[2] const destination = process.argv[3] -const url = 'https://venus.i.ipfs.io/api/v0/get?arg=' + cid + '&archive=true&compress=true' +// pick random preloader +const no = Math.round(Math.random()) // 0 or 1 +const url = 'https://node' + no + '.preload.ipfs.io/api/v0/get?arg=' + cid + '&archive=true&compress=true' console.log('Fallback to HTTP GET from: ' + url)