diff --git a/scripts/hostIPFS.sh b/scripts/hostIPFS.sh index 324e7ab..adb5937 100644 --- a/scripts/hostIPFS.sh +++ b/scripts/hostIPFS.sh @@ -5,7 +5,7 @@ if [ "$EUID" -ne 0 ]; exit 1; fi; -this_repo_ipfs_cid="bafybeig4t3ntvqc2skn3qhgr7dhnpzikxxyya6zptonorbcjdsv5emvj7q"; +this_repo_ipfs_cid="bafybeiepown476yzjs2zcymrn3t7d4oseuaw6a2rjnkdbu73jrp3evfdxm"; user_home_dir=$(eval echo ~$USER); tornado_folder="$user_home_dir/tornado-ipfs"; script_log_file="/tmp/tornado-ipfs-installation.log"; diff --git a/src/downloader.ts b/src/downloader.ts index 4f7bdcf..ab14e98 100644 --- a/src/downloader.ts +++ b/src/downloader.ts @@ -41,11 +41,11 @@ export async function getV1Cids(domains: Domains): Promise { } export async function downloadGitRepoFromIpfs(reposFolder: string, repoName: string, repoHash: string, retryAttempt: number = 0) { - if (retryAttempt > knownIpfsResources.length) return console.error(`Cannot download ${repoName}, all known IPFS gateaways checked.`); + if (retryAttempt >= knownIpfsResources.length) return console.error(`Cannot download ${repoName}, all known IPFS gateways checked.`); try { await git.clone(knownIpfsResources[retryAttempt] + repoHash, path.join(reposFolder, repoName)); } catch (e) { - console.error(`Cannot download ${repoName} from ${knownIpfsResources[retryAttempt]}, retry with other gateaway...`); - downloadGitRepoFromIpfs(reposFolder, repoName, repoHash, retryAttempt++); + console.error(`Cannot download ${repoName} from ${knownIpfsResources[retryAttempt]}, retry with other gateway...`); + await downloadGitRepoFromIpfs(reposFolder, repoName, repoHash, ++retryAttempt); } }