Skip to content

Commit c280221

Browse files
Merge pull request #154 from DIG-Network/release/v0.0.1-alpha.170
Release/v0.0.1 alpha.170
2 parents b93a928 + d9f2bbe commit c280221

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
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.
44

5+
### [0.0.1-alpha.170](https://github.com/DIG-Network/dig-chia-sdk/compare/v0.0.1-alpha.169...v0.0.1-alpha.170) (2024-10-10)
6+
7+
8+
### Features
9+
10+
* add options to sync store ([6fc808e](https://github.com/DIG-Network/dig-chia-sdk/commit/6fc808ecc7a316ecb56913e0b161f2fe14b9dd68))
11+
512
### [0.0.1-alpha.169](https://github.com/DIG-Network/dig-chia-sdk/compare/v0.0.1-alpha.168...v0.0.1-alpha.169) (2024-10-10)
613

714

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dignetwork/dig-sdk",
3-
"version": "0.0.1-alpha.169",
3+
"version": "0.0.1-alpha.170",
44
"description": "",
55
"type": "commonjs",
66
"main": "./dist/index.js",

src/DigNetwork/DigPeer.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,18 @@ export class DigPeer {
164164
return transformedBuffer;
165165
}
166166

167-
public async syncStore(): Promise<void> {
167+
public async syncStore(order: "asc" | "desc" = "desc"): Promise<void> {
168+
console.log('!');
168169
const dataStore = DataStore.from(this.storeId);
169170
const rootHistory = await dataStore.getRootHistory();
170-
const localRootHistory = rootHistory
171+
let localRootHistory = rootHistory
171172
.filter((root) => Boolean(root.synced))
172173
.reverse();
173174

175+
if (order === "asc") {
176+
localRootHistory = localRootHistory.reverse();
177+
}
178+
174179
console.log(`Syncing store ${this.storeId} with ${this.IpAddress}`);
175180

176181
for (const item of localRootHistory) {

0 commit comments

Comments
 (0)