Skip to content

Commit

Permalink
Merge pull request #57 from DIG-Network/release/v0.0.1-alpha.61
Browse files Browse the repository at this point in the history
Release/v0.0.1 alpha.61
  • Loading branch information
MichaelTaylor3D authored Sep 22, 2024
2 parents 36f1048 + 98d96ae commit 0d6d560
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

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


### Bug Fixes

* manifest file handling ([faa6b74](https://github.com/DIG-Network/dig-chia-sdk/commit/faa6b74190db9a671ab9a9c876f6fb5666570e1f))

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

### [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)


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.59",
"version": "0.0.1-alpha.61",
"description": "",
"type": "commonjs",
"main": "./dist/index.js",
Expand Down
13 changes: 7 additions & 6 deletions src/blockchain/DataStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ 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 @@ -488,6 +484,13 @@ export class DataStore {
// Store the root history in the cache
rootHistoryCache.set(this.storeId, rootHistory);

return rootHistory;
}

// Generates a fresh manifest file based on the current root history
// and what is currently on disk
public async generateManifestFile(): Promise<void> {
const rootHistory = await this.getRootHistory();
// Need this for the dataintegrity tree to work properly
fs.writeFileSync(
path.join(STORE_PATH, this.storeId, "manifest.dat"),
Expand All @@ -496,8 +499,6 @@ export class DataStore {
.map((root) => root.root_hash)
.join("\n")
);

return rootHistory;
}

public async getMetaData(): Promise<DataStoreMetadata> {
Expand Down

0 comments on commit 0d6d560

Please sign in to comment.