Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/v0.0.1 alpha.86 #79

Merged
merged 3 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.86](https://github.com/DIG-Network/dig-propagation-server/compare/v0.0.1-alpha.85...v0.0.1-alpha.86) (2024-10-01)


### Features

* lighter integrity check ([1359bab](https://github.com/DIG-Network/dig-propagation-server/commit/1359bab1fcd914e236653d8cdfc16ea14d475dd1))
* lighter integrity check ([354cfcf](https://github.com/DIG-Network/dig-propagation-server/commit/354cfcff06cf94c8b91faf9537e7b564a1b18e12))

### [0.0.1-alpha.85](https://github.com/DIG-Network/dig-propagation-server/compare/v0.0.1-alpha.84...v0.0.1-alpha.85) (2024-10-01)


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": "dig-propagation-server",
"version": "0.0.1-alpha.85",
"version": "0.0.1-alpha.86",
"description": "",
"type": "commonjs",
"main": "./dist/index.js",
Expand Down
8 changes: 6 additions & 2 deletions src/controllers/merkleTreeController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
Wallet,
DataIntegrityTree,
getFilePathFromSha256,
Environment,
} from "@dignetwork/dig-sdk";
import { promisify } from "util";
import { getStorageLocation } from "../utils/storage";
Expand Down Expand Up @@ -95,7 +96,6 @@ async function merkleIntegrityCheck(

// Extract expected sha256 from dataPath
const expectedSha256 = dataPath.replace("data", "").replace(/\//g, "");
console.log("expectedSha256", expectedSha256);

// Find the hexKey in the tree based on matching sha256
const hexKey = Object.keys(tree.files).find((key) => {
Expand Down Expand Up @@ -123,7 +123,10 @@ async function merkleIntegrityCheck(
true
);

console.log("Integrity check result:", integrity);
if (Environment.DEBUG) {
console.log("Integrity check result:", integrity);
}

return integrity;
}

Expand Down Expand Up @@ -591,6 +594,7 @@ export const uploadFile = async (

bb.on("finish", () => {
// All files have been processed
console.log(`${filename} uploaded to session ${sessionId}.`);
res.status(200).json({
message: `Files uploaded to DataStore ${storeId} under session ${sessionId}.`,
files: uploadResults,
Expand Down
Loading