diff --git a/CHANGELOG.md b/CHANGELOG.md index ff645b6..3529a11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [0.0.1-alpha.81](https://github.com/DIG-Network/dig-chia-sdk/compare/v0.0.1-alpha.80...v0.0.1-alpha.81) (2024-09-25) + + +### Bug Fixes + +* download store ([788c86b](https://github.com/DIG-Network/dig-chia-sdk/commit/788c86b295a3747150ffc4bf51be9d1af6562968)) +* download store ([ff94f99](https://github.com/DIG-Network/dig-chia-sdk/commit/ff94f99ae4556f26cc8c976e4e803618227f6429)) + ### [0.0.1-alpha.80](https://github.com/DIG-Network/dig-chia-sdk/compare/v0.0.1-alpha.79...v0.0.1-alpha.80) (2024-09-24) diff --git a/package-lock.json b/package-lock.json index b69ee0d..1275d71 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@dignetwork/dig-sdk", - "version": "0.0.1-alpha.80", + "version": "0.0.1-alpha.81", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@dignetwork/dig-sdk", - "version": "0.0.1-alpha.80", + "version": "0.0.1-alpha.81", "license": "ISC", "dependencies": { "@dignetwork/datalayer-driver": "^0.1.25", diff --git a/package.json b/package.json index 2288f27..07a91ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dignetwork/dig-sdk", - "version": "0.0.1-alpha.80", + "version": "0.0.1-alpha.81", "description": "", "type": "commonjs", "main": "./dist/index.js", diff --git a/src/DigNetwork/DigNetwork.ts b/src/DigNetwork/DigNetwork.ts index b8a8eeb..d0caf9e 100644 --- a/src/DigNetwork/DigNetwork.ts +++ b/src/DigNetwork/DigNetwork.ts @@ -169,12 +169,8 @@ export class DigNetwork { continue; } - try { - // Download the store root and associated data - await selectedPeer.downloadStoreRoot(rootInfo.root_hash); - } catch (error) { - break; - } + // Download the store root and associated data + await selectedPeer.downloadStoreRoot(rootInfo.root_hash); // Clear the blacklist upon successful download peerBlackList = []; @@ -182,10 +178,11 @@ export class DigNetwork { // Break after successful download to proceed to next root hash break; } catch (error: any) { - console.error( - `Error downloading from peer ${selectedPeer?.IpAddress}. Retrying with another peer.`, - error - ); + if (error.message) + console.error( + `Error downloading from peer ${selectedPeer?.IpAddress}. Retrying with another peer.`, + error + ); if (selectedPeer) { peerBlackList.push(selectedPeer.IpAddress); // Blacklist and retry } diff --git a/src/DigNetwork/PropagationServer.ts b/src/DigNetwork/PropagationServer.ts index d4f7712..b524789 100644 --- a/src/DigNetwork/PropagationServer.ts +++ b/src/DigNetwork/PropagationServer.ts @@ -687,7 +687,7 @@ export class PropagationServer { // Integrity check for the downloaded files was done during the download // Here we want to make sure we got all the files or we reject the download session - for (const [fileKey, fileData] of Object.entries(root.files)) { + /*for (const [fileKey, fileData] of Object.entries(root.files)) { const dataPath = getFilePathFromSha256( (fileData as any).sha256, "data" @@ -697,7 +697,7 @@ export class PropagationServer { if (!fs.existsSync(path.join(downloadPath, dataPath))) { throw new Error(`Missing file!: ${Buffer.from(fileKey, "utf-8")}, aborting session.`); } - } + }*/ // After all downloads are complete, copy from temp directory to the main directory const destinationDir = path.join(STORE_PATH, storeId);