Skip to content

Commit

Permalink
Merge pull request #75 from DIG-Network/release/v0.0.1-alpha.81
Browse files Browse the repository at this point in the history
Release/v0.0.1 alpha.81
  • Loading branch information
MichaelTaylor3D authored Sep 25, 2024
2 parents 79d074e + 39720df commit 6523fca
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
17 changes: 7 additions & 10 deletions src/DigNetwork/DigNetwork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,23 +169,20 @@ 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 = [];

// 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
}
Expand Down
4 changes: 2 additions & 2 deletions src/DigNetwork/PropagationServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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);
Expand Down

0 comments on commit 6523fca

Please sign in to comment.