Skip to content

Commit

Permalink
Merge pull request #56 from DIG-Network/release/v0.0.1-alpha.59
Browse files Browse the repository at this point in the history
Release/v0.0.1 alpha.59
  • Loading branch information
MichaelTaylor3D authored Sep 22, 2024
2 parents 55ae388 + d028d7e commit 36f1048
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

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.59](https://github.com/DIG-Network/dig-chia-sdk/compare/v0.0.1-alpha.58...v0.0.1-alpha.59) (2024-09-22)


### Bug Fixes

* missing manifest file ([56c61f1](https://github.com/DIG-Network/dig-chia-sdk/commit/56c61f1837b9f3f2fa0f447a17017588174ae0c9))

### [0.0.1-alpha.58](https://github.com/DIG-Network/dig-chia-sdk/compare/v0.0.1-alpha.57...v0.0.1-alpha.58) (2024-09-22)


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.58",
"version": "0.0.1-alpha.59",
"description": "",
"type": "commonjs",
"main": "./dist/index.js",
Expand Down
13 changes: 13 additions & 0 deletions src/blockchain/DataStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ export class DataStore {
constructor(storeId: string, options?: DataIntegrityTreeOptions) {
this.storeId = storeId;

// This will create the manifest file if it doesn't exist
// might be a hacky way to do this, but it works for now
this.getRootHistory();

let _options: DataIntegrityTreeOptions;

if (options) {
Expand Down Expand Up @@ -484,6 +488,15 @@ export class DataStore {
// Store the root history in the cache
rootHistoryCache.set(this.storeId, rootHistory);

// Need this for the dataintegrity tree to work properly
fs.writeFileSync(
path.join(STORE_PATH, this.storeId, "manifest.dat"),
rootHistory
.filter((root) => root.synced)
.map((root) => root.root_hash)
.join("\n")
);

return rootHistory;
}

Expand Down

0 comments on commit 36f1048

Please sign in to comment.