@dignetwork/dig-sdk 0.0.1-alpha.11 → 0.0.1-alpha.110
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DataIntegrityTree/DataIntegrityTree.d.ts +10 -2
- package/dist/DataIntegrityTree/DataIntegrityTree.d.ts.map +1 -1
- package/dist/DataIntegrityTree/DataIntegrityTree.js +100 -15
- package/dist/DigNetwork/ContentServer.d.ts +10 -5
- package/dist/DigNetwork/ContentServer.d.ts.map +1 -1
- package/dist/DigNetwork/ContentServer.js +90 -24
- package/dist/DigNetwork/DigNetwork.d.ts +3 -9
- package/dist/DigNetwork/DigNetwork.d.ts.map +1 -1
- package/dist/DigNetwork/DigNetwork.js +98 -189
- package/dist/DigNetwork/DigPeer.d.ts +8 -3
- package/dist/DigNetwork/DigPeer.d.ts.map +1 -1
- package/dist/DigNetwork/DigPeer.js +68 -114
- package/dist/DigNetwork/IncentiveServer.d.ts.map +1 -1
- package/dist/DigNetwork/IncentiveServer.js +6 -5
- package/dist/DigNetwork/PropagationServer.d.ts +73 -33
- package/dist/DigNetwork/PropagationServer.d.ts.map +1 -1
- package/dist/DigNetwork/PropagationServer.js +545 -360
- package/dist/blockchain/DataStore.d.ts +18 -7
- package/dist/blockchain/DataStore.d.ts.map +1 -1
- package/dist/blockchain/DataStore.js +98 -134
- package/dist/blockchain/DataStoreSerializer.d.ts +1 -1
- package/dist/blockchain/DataStoreSerializer.d.ts.map +1 -1
- package/dist/blockchain/FullNodePeer.d.ts +2 -1
- package/dist/blockchain/FullNodePeer.d.ts.map +1 -1
- package/dist/blockchain/FullNodePeer.js +39 -14
- package/dist/blockchain/ServerCoin.d.ts +13 -5
- package/dist/blockchain/ServerCoin.d.ts.map +1 -1
- package/dist/blockchain/ServerCoin.js +88 -25
- package/dist/blockchain/StoreInfoCacheUpdater.d.ts +14 -0
- package/dist/blockchain/StoreInfoCacheUpdater.d.ts.map +1 -0
- package/dist/blockchain/StoreInfoCacheUpdater.js +157 -0
- package/dist/blockchain/Wallet.d.ts +2 -2
- package/dist/blockchain/Wallet.d.ts.map +1 -1
- package/dist/blockchain/Wallet.js +51 -18
- package/dist/blockchain/coins.d.ts +1 -1
- package/dist/blockchain/coins.d.ts.map +1 -1
- package/dist/blockchain/coins.js +5 -4
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/ContentScanner.d.ts +63 -0
- package/dist/utils/ContentScanner.d.ts.map +1 -0
- package/dist/utils/ContentScanner.js +175 -0
- package/dist/utils/Environment.d.ts +18 -0
- package/dist/utils/Environment.d.ts.map +1 -0
- package/dist/utils/Environment.js +85 -0
- package/dist/utils/FileTransfer.d.ts +47 -0
- package/dist/utils/FileTransfer.d.ts.map +1 -0
- package/dist/utils/FileTransfer.js +209 -0
- package/dist/utils/NconfManager.js +2 -1
- package/dist/utils/StoreArchiveManager.d.ts +45 -0
- package/dist/utils/StoreArchiveManager.d.ts.map +1 -0
- package/dist/utils/StoreArchiveManager.js +153 -0
- package/dist/utils/config.d.ts +4 -3
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +12 -7
- package/dist/utils/directoryUtils.d.ts +0 -6
- package/dist/utils/directoryUtils.d.ts.map +1 -1
- package/dist/utils/directoryUtils.js +35 -26
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +2 -1
- package/dist/utils/merkle.d.ts +2 -0
- package/dist/utils/merkle.d.ts.map +1 -0
- package/dist/utils/merkle.js +28 -0
- package/dist/utils/network.d.ts +1 -0
- package/dist/utils/network.d.ts.map +1 -1
- package/dist/utils/network.js +38 -11
- package/dist/utils/promiseUtils.d.ts +17 -0
- package/dist/utils/promiseUtils.d.ts.map +1 -0
- package/dist/utils/promiseUtils.js +38 -0
- package/dist/utils/ssl.js +2 -2
- package/package.json +15 -5
- package/dist/utils/deltaUtils.d.ts +0 -2
- package/dist/utils/deltaUtils.d.ts.map +0 -1
- package/dist/utils/deltaUtils.js +0 -83
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataStore as DataStoreDriver, DataStoreMetadata } from "datalayer-driver";
|
|
1
|
+
import { DataStore as DataStoreDriver, DataStoreMetadata } from "@dignetwork/datalayer-driver";
|
|
2
2
|
import { RootHistoryItem } from "../types";
|
|
3
3
|
import { DataIntegrityTree, DataIntegrityTreeOptions } from "../DataIntegrityTree";
|
|
4
4
|
import { CreateStoreUserInputs } from "../types";
|
|
@@ -13,7 +13,7 @@ export declare class DataStore {
|
|
|
13
13
|
serialize(): string;
|
|
14
14
|
static getActiveStore(): Promise<DataStore | undefined>;
|
|
15
15
|
static deserialize(serialized: string): DataStore;
|
|
16
|
-
static from(storeId: string | Buffer): DataStore;
|
|
16
|
+
static from(storeId: string | Buffer, rootHash?: string): DataStore;
|
|
17
17
|
static create(inputs?: CreateStoreUserInputs): Promise<DataStore>;
|
|
18
18
|
private static mint;
|
|
19
19
|
/**
|
|
@@ -38,19 +38,30 @@ export declare class DataStore {
|
|
|
38
38
|
latestHeight: number;
|
|
39
39
|
latestHash: Buffer;
|
|
40
40
|
}>;
|
|
41
|
+
cacheStoreCreationHeight(): Promise<{
|
|
42
|
+
createdAtHeight: number;
|
|
43
|
+
createdAtHash: Buffer;
|
|
44
|
+
}>;
|
|
41
45
|
getCreationHeight(): Promise<{
|
|
42
46
|
createdAtHeight: number;
|
|
43
47
|
createdAtHash: Buffer;
|
|
44
48
|
}>;
|
|
45
49
|
private setCreationHeight;
|
|
46
|
-
getRootHistory(): Promise<RootHistoryItem[]>;
|
|
47
|
-
|
|
48
|
-
validate(): Promise<boolean>;
|
|
50
|
+
getRootHistory(bustCache?: boolean): Promise<RootHistoryItem[]>;
|
|
51
|
+
generateManifestFile(folderPath?: string): Promise<void>;
|
|
49
52
|
getMetaData(): Promise<DataStoreMetadata>;
|
|
50
53
|
isSynced(): Promise<boolean>;
|
|
51
54
|
hasMetaWritePermissions(publicSyntheticKey?: Buffer): Promise<boolean>;
|
|
52
55
|
updateMetadata(metadata: DataStoreMetadata): Promise<DataStoreDriver>;
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Retrieve the file set for a given root hash and validate file integrity.
|
|
58
|
+
*
|
|
59
|
+
* @param {string} rootHash - The root hash to fetch the file set.
|
|
60
|
+
* @returns {Promise<{ fileName: string, file: string }[]>} - An array of unique file objects.
|
|
61
|
+
*/
|
|
62
|
+
getFileSetForRootHash(rootHash: string, skipIntegirtyCheck?: boolean): Promise<{
|
|
63
|
+
name: string;
|
|
64
|
+
path: string;
|
|
65
|
+
}[]>;
|
|
55
66
|
}
|
|
56
67
|
//# sourceMappingURL=DataStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataStore.d.ts","sourceRoot":"","sources":["../../src/blockchain/DataStore.ts"],"names":[],"mappings":"AAEA,OAAO,EAOL,SAAS,IAAI,eAAe,EAE5B,iBAAiB,EAIlB,MAAM,
|
|
1
|
+
{"version":3,"file":"DataStore.d.ts","sourceRoot":"","sources":["../../src/blockchain/DataStore.ts"],"names":[],"mappings":"AAEA,OAAO,EAOL,SAAS,IAAI,eAAe,EAE5B,iBAAiB,EAIlB,MAAM,8BAA8B,CAAC;AAWtC,OAAO,EAAE,eAAe,EAAW,MAAM,UAAU,CAAC;AAGpD,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAcjD,qBAAa,SAAS;IACpB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,IAAI,CAAoB;gBAEpB,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,wBAAwB;IAiB/D,IAAW,OAAO,IAAI,MAAM,CAE3B;IAED,IAAW,IAAI,IAAI,iBAAiB,CAEnC;IAEM,QAAQ,IAAI,MAAM;IAIlB,QAAQ,IAAI,MAAM;IAIlB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eAAe,CAAC;IA+C3B;;;;;OAKG;IACU,qBAAqB,CAChC,QAAQ,EAAE,MAAM,EAChB,kBAAkB,GAAE,OAAe,GAClC,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CA6C7C"}
|
|
@@ -6,18 +6,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.DataStore = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const datalayer_driver_1 = require("datalayer-driver");
|
|
9
|
+
const datalayer_driver_1 = require("@dignetwork/datalayer-driver");
|
|
10
10
|
const util_1 = require("util");
|
|
11
11
|
const FullNodePeer_1 = require("./FullNodePeer");
|
|
12
12
|
const Wallet_1 = require("./Wallet");
|
|
13
13
|
const config_1 = require("../utils/config");
|
|
14
14
|
const coins_1 = require("./coins");
|
|
15
|
-
const
|
|
15
|
+
const colorette_1 = require("colorette");
|
|
16
16
|
const hashUtils_1 = require("../utils/hashUtils");
|
|
17
17
|
const DataIntegrityTree_1 = require("../DataIntegrityTree");
|
|
18
18
|
const prompts_1 = require("../prompts");
|
|
19
19
|
const FileCache_1 = require("../utils/FileCache");
|
|
20
20
|
const DataStoreSerializer_1 = require("./DataStoreSerializer");
|
|
21
|
+
const node_cache_1 = __importDefault(require("node-cache"));
|
|
22
|
+
const config_2 = require("../utils/config");
|
|
23
|
+
const StoreInfoCacheUpdater_1 = require("./StoreInfoCacheUpdater");
|
|
24
|
+
// Initialize the cache with a TTL of 180 seconds (3 minutes)
|
|
25
|
+
const rootHistoryCache = new node_cache_1.default({ stdTTL: 180 });
|
|
21
26
|
const stat = (0, util_1.promisify)(fs_1.default.stat);
|
|
22
27
|
const readdir = (0, util_1.promisify)(fs_1.default.readdir);
|
|
23
28
|
class DataStore {
|
|
@@ -62,12 +67,15 @@ class DataStore {
|
|
|
62
67
|
const parsed = JSON.parse(serialized);
|
|
63
68
|
return new DataStore(parsed.storeId);
|
|
64
69
|
}
|
|
65
|
-
static from(storeId) {
|
|
70
|
+
static from(storeId, rootHash) {
|
|
66
71
|
const existingTreeOptions = {
|
|
67
72
|
storageMode: "local",
|
|
68
73
|
storeDir: config_1.STORE_PATH,
|
|
69
74
|
disableInitialize: true,
|
|
70
75
|
};
|
|
76
|
+
if (rootHash) {
|
|
77
|
+
existingTreeOptions.rootHash = rootHash;
|
|
78
|
+
}
|
|
71
79
|
if (storeId instanceof Buffer) {
|
|
72
80
|
return new DataStore(storeId.toString("hex"), existingTreeOptions);
|
|
73
81
|
}
|
|
@@ -195,47 +203,26 @@ class DataStore {
|
|
|
195
203
|
}
|
|
196
204
|
async fetchCoinInfo() {
|
|
197
205
|
try {
|
|
206
|
+
// Kick off the updater instance in the backgounf if not already running
|
|
207
|
+
StoreInfoCacheUpdater_1.StoreInfoCacheUpdater.initInstance();
|
|
198
208
|
// Initialize the cache for the current storeId's coin info
|
|
199
209
|
const storeCoinCache = new FileCache_1.FileCache(`stores`);
|
|
200
210
|
// Try to get cached store info
|
|
201
211
|
const cachedInfo = storeCoinCache.get(this.storeId);
|
|
202
212
|
if (cachedInfo) {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
const latestHash = await peer.getHeaderHash(latestHeight);
|
|
215
|
-
// Serialize the store data for caching
|
|
216
|
-
const serializedLatestStore = new DataStoreSerializer_1.DataStoreSerializer(latestStore, latestHeight, latestHash).serialize();
|
|
217
|
-
// Cache updated store info
|
|
218
|
-
storeCoinCache.set(this.storeId, {
|
|
219
|
-
latestStore: serializedLatestStore,
|
|
220
|
-
latestHeight,
|
|
221
|
-
latestHash: latestHash.toString("hex"),
|
|
222
|
-
});
|
|
223
|
-
return { latestStore, latestHeight, latestHash };
|
|
224
|
-
}
|
|
225
|
-
catch {
|
|
226
|
-
// Return cached info if sync fails
|
|
227
|
-
const { latestStore, latestHeight, latestHash } = DataStoreSerializer_1.DataStoreSerializer.deserialize({
|
|
228
|
-
latestStore: cachedInfo.latestStore,
|
|
229
|
-
latestHeight: cachedInfo.latestHeight.toString(),
|
|
230
|
-
latestHash: cachedInfo.latestHash,
|
|
231
|
-
});
|
|
232
|
-
return {
|
|
233
|
-
latestStore,
|
|
234
|
-
latestHeight,
|
|
235
|
-
latestHash: latestHash,
|
|
236
|
-
};
|
|
237
|
-
}
|
|
213
|
+
// If we have cached info, return it directly
|
|
214
|
+
const { latestStore, latestHeight } = DataStoreSerializer_1.DataStoreSerializer.deserialize({
|
|
215
|
+
latestStore: cachedInfo.latestStore,
|
|
216
|
+
latestHeight: cachedInfo.latestHeight.toString(),
|
|
217
|
+
latestHash: cachedInfo.latestHash,
|
|
218
|
+
});
|
|
219
|
+
return {
|
|
220
|
+
latestStore,
|
|
221
|
+
latestHeight: cachedInfo.latestHeight,
|
|
222
|
+
latestHash: Buffer.from(cachedInfo.latestHash, "hex"),
|
|
223
|
+
};
|
|
238
224
|
}
|
|
225
|
+
// If no cached info, proceed to fetch and cache it
|
|
239
226
|
// Use getCreationHeight to retrieve height and hash information
|
|
240
227
|
const { createdAtHeight, createdAtHash } = await this.getCreationHeight();
|
|
241
228
|
// Sync store from peer
|
|
@@ -257,22 +244,31 @@ class DataStore {
|
|
|
257
244
|
throw error;
|
|
258
245
|
}
|
|
259
246
|
}
|
|
247
|
+
async cacheStoreCreationHeight() {
|
|
248
|
+
const peer = await FullNodePeer_1.FullNodePeer.connect();
|
|
249
|
+
const createdAtHeight = await peer.getStoreCreationHeight(Buffer.from(this.storeId, "hex"), null, Buffer.from(config_2.MAIN_NET_GENISES_CHALLENGE, "hex"));
|
|
250
|
+
// Get just before created at height so we can find the coin
|
|
251
|
+
const justBeforeCreatedAtHeight = Number(createdAtHeight) - 1;
|
|
252
|
+
const createdAtHash = await peer.getHeaderHash(justBeforeCreatedAtHeight);
|
|
253
|
+
await this.setCreationHeight(justBeforeCreatedAtHeight, createdAtHash);
|
|
254
|
+
return { createdAtHeight: justBeforeCreatedAtHeight, createdAtHash };
|
|
255
|
+
}
|
|
260
256
|
async getCreationHeight() {
|
|
261
|
-
const defaultHeight = config_1.MIN_HEIGHT;
|
|
262
|
-
const defaultHash = Buffer.from(config_1.MIN_HEIGHT_HEADER_HASH, "hex");
|
|
263
257
|
// Initialize the FileCache for the height file
|
|
264
258
|
const fileCache = new FileCache_1.FileCache(`stores/${this.storeId}`);
|
|
265
259
|
// Try to retrieve the cached height information
|
|
266
260
|
const cachedHeightInfo = fileCache.get("height");
|
|
267
261
|
if (!cachedHeightInfo) {
|
|
268
|
-
// If no cache,
|
|
269
|
-
return
|
|
262
|
+
// If no cache, regenerate the cache
|
|
263
|
+
return this.cacheStoreCreationHeight();
|
|
270
264
|
}
|
|
271
265
|
// Parse the cached height and hash values
|
|
272
266
|
const { height, hash } = cachedHeightInfo;
|
|
267
|
+
const defaultHeight = config_1.MIN_HEIGHT;
|
|
268
|
+
const defaultHash = Buffer.from(config_1.MIN_HEIGHT_HEADER_HASH, "hex");
|
|
273
269
|
return {
|
|
274
270
|
createdAtHeight: height || defaultHeight,
|
|
275
|
-
createdAtHash: Buffer.from(hash
|
|
271
|
+
createdAtHash: hash ? Buffer.from(hash, "hex") : defaultHash,
|
|
276
272
|
};
|
|
277
273
|
}
|
|
278
274
|
async setCreationHeight(height, hash) {
|
|
@@ -283,98 +279,53 @@ class DataStore {
|
|
|
283
279
|
hash: hash.toString("hex"),
|
|
284
280
|
});
|
|
285
281
|
}
|
|
286
|
-
async getRootHistory() {
|
|
282
|
+
async getRootHistory(bustCache) {
|
|
283
|
+
if (bustCache) {
|
|
284
|
+
rootHistoryCache.del(this.storeId);
|
|
285
|
+
}
|
|
286
|
+
// Check if the root history is cached for this storeId
|
|
287
|
+
const cachedHistory = rootHistoryCache.get(this.storeId);
|
|
288
|
+
if (cachedHistory) {
|
|
289
|
+
return cachedHistory;
|
|
290
|
+
}
|
|
291
|
+
// Fetch root history from peer if not cached
|
|
287
292
|
const peer = await FullNodePeer_1.FullNodePeer.connect();
|
|
288
293
|
const { createdAtHeight, createdAtHash } = await this.getCreationHeight();
|
|
289
294
|
const { rootHashes, rootHashesTimestamps } = await peer.syncStoreFromLauncherId(Buffer.from(this.storeId, "hex"), createdAtHeight, createdAtHash, true);
|
|
290
295
|
if (!rootHashes) {
|
|
291
296
|
return [];
|
|
292
297
|
}
|
|
293
|
-
|
|
298
|
+
// Build the root history list
|
|
299
|
+
const rootHistory = rootHashes.map((rootHash, index) => ({
|
|
294
300
|
root_hash: rootHash.toString("hex"),
|
|
295
301
|
timestamp: Number(rootHashesTimestamps?.[index].toString()),
|
|
302
|
+
synced: fs_1.default.existsSync(path_1.default.join(config_1.STORE_PATH, this.storeId, `${rootHash.toString("hex")}.dat`)),
|
|
296
303
|
}));
|
|
304
|
+
// Store the root history in the cache
|
|
305
|
+
rootHistoryCache.set(this.storeId, rootHistory);
|
|
306
|
+
return rootHistory;
|
|
297
307
|
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
308
|
+
// Generates a fresh manifest file based on the current root history
|
|
309
|
+
// and what is currently on disk
|
|
310
|
+
async generateManifestFile(folderPath) {
|
|
311
|
+
if (!folderPath) {
|
|
312
|
+
folderPath = path_1.default.join(config_1.STORE_PATH, this.storeId, "data");
|
|
303
313
|
}
|
|
304
|
-
const manifestHashes = fs_1.default
|
|
305
|
-
.readFileSync(manifestFilePath, "utf-8")
|
|
306
|
-
.split("\n")
|
|
307
|
-
.filter(Boolean);
|
|
308
|
-
return manifestHashes.map((rootHash) => ({
|
|
309
|
-
root_hash: rootHash,
|
|
310
|
-
timestamp: 0, // Timestamps are not yet included in the manifest
|
|
311
|
-
}));
|
|
312
|
-
}
|
|
313
|
-
async validate() {
|
|
314
314
|
const rootHistory = await this.getRootHistory();
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
const manifestHashes = fs_1.default
|
|
321
|
-
.readFileSync(manifestFilePath, "utf-8")
|
|
322
|
-
.split("\n")
|
|
323
|
-
.filter(Boolean);
|
|
324
|
-
if (manifestHashes.length > rootHistory.length) {
|
|
325
|
-
console.error("The store is corrupted: Manifest file has more hashes than the root history.");
|
|
326
|
-
return false;
|
|
327
|
-
}
|
|
328
|
-
if (rootHistory.length > manifestHashes.length) {
|
|
329
|
-
console.error("The store is not synced: Root history has more hashes than the manifest file.");
|
|
330
|
-
return false;
|
|
331
|
-
}
|
|
332
|
-
for (let i = 0; i < manifestHashes.length; i++) {
|
|
333
|
-
if (manifestHashes[i] !== rootHistory[i]?.root_hash) {
|
|
334
|
-
console.error(`Root hash mismatch at position ${i}: expected ${manifestHashes[i]} but found ${rootHistory[i]?.root_hash}`);
|
|
335
|
-
return false;
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
let filesIntegrityIntact = true;
|
|
339
|
-
for (const rootHash of manifestHashes) {
|
|
340
|
-
const datFilePath = path_1.default.join(config_1.STORE_PATH, this.storeId, `${rootHash}.dat`);
|
|
341
|
-
if (!fs_1.default.existsSync(datFilePath)) {
|
|
342
|
-
console.error(`Data file for root hash ${rootHash} not found`);
|
|
343
|
-
return false;
|
|
344
|
-
}
|
|
345
|
-
const datFileContent = JSON.parse(fs_1.default.readFileSync(datFilePath, "utf-8"));
|
|
346
|
-
if (datFileContent.root !== rootHash) {
|
|
347
|
-
console.error(`Root hash in data file does not match: ${datFileContent.root} !== ${rootHash}`);
|
|
348
|
-
return false;
|
|
349
|
-
}
|
|
350
|
-
for (const [fileKey, fileData] of Object.entries(datFileContent.files)) {
|
|
351
|
-
const integrityCheck = (0, utils_1.validateFileSha256)(fileData.sha256, path_1.default.join(config_1.STORE_PATH, this.storeId, "data"));
|
|
352
|
-
if (!integrityCheck) {
|
|
353
|
-
filesIntegrityIntact = false;
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
if (!filesIntegrityIntact) {
|
|
358
|
-
console.error("Store Corrupted: Data failed SHA256 validation.");
|
|
359
|
-
return false;
|
|
360
|
-
}
|
|
361
|
-
return true;
|
|
315
|
+
// Need this for the dataintegrity tree to work properly
|
|
316
|
+
fs_1.default.writeFileSync(path_1.default.join(folderPath, "manifest.dat"), rootHistory
|
|
317
|
+
.filter((root) => root.synced)
|
|
318
|
+
.map((root) => root.root_hash)
|
|
319
|
+
.join("\n"));
|
|
362
320
|
}
|
|
363
321
|
async getMetaData() {
|
|
364
322
|
const { latestStore } = await this.fetchCoinInfo();
|
|
365
323
|
return latestStore.metadata;
|
|
366
324
|
}
|
|
367
325
|
async isSynced() {
|
|
368
|
-
const
|
|
369
|
-
const
|
|
370
|
-
|
|
371
|
-
return false;
|
|
372
|
-
}
|
|
373
|
-
const manifestHashes = fs_1.default
|
|
374
|
-
.readFileSync(manifestFilePath, "utf-8")
|
|
375
|
-
.split("\n")
|
|
376
|
-
.filter(Boolean);
|
|
377
|
-
return rootHistory.length === manifestHashes.length;
|
|
326
|
+
const dataStore = await DataStore.from(this.storeId);
|
|
327
|
+
const rootHistory = await dataStore.getRootHistory();
|
|
328
|
+
return !rootHistory.some((root) => !root.synced);
|
|
378
329
|
}
|
|
379
330
|
async hasMetaWritePermissions(publicSyntheticKey) {
|
|
380
331
|
const wallet = await Wallet_1.Wallet.load("default");
|
|
@@ -407,27 +358,40 @@ class DataStore {
|
|
|
407
358
|
}
|
|
408
359
|
return updateStoreResponse.newStore;
|
|
409
360
|
}
|
|
410
|
-
|
|
361
|
+
/**
|
|
362
|
+
* Retrieve the file set for a given root hash and validate file integrity.
|
|
363
|
+
*
|
|
364
|
+
* @param {string} rootHash - The root hash to fetch the file set.
|
|
365
|
+
* @returns {Promise<{ fileName: string, file: string }[]>} - An array of unique file objects.
|
|
366
|
+
*/
|
|
367
|
+
async getFileSetForRootHash(rootHash, skipIntegirtyCheck = false) {
|
|
411
368
|
const datFilePath = path_1.default.join(config_1.STORE_PATH, this.storeId, `${rootHash}.dat`);
|
|
412
369
|
const datFileContent = JSON.parse(fs_1.default.readFileSync(datFilePath, "utf-8"));
|
|
413
|
-
|
|
414
|
-
const
|
|
415
|
-
|
|
416
|
-
filesInvolved.push(manifestFilePath);
|
|
417
|
-
filesInvolved.push(datFilePath);
|
|
418
|
-
filesInvolved.push(heightDatFilePath);
|
|
370
|
+
// Use a Set to ensure uniqueness
|
|
371
|
+
const filesInvolved = new Set();
|
|
372
|
+
// Iterate over each file and perform an integrity check
|
|
419
373
|
for (const [fileKey, fileData] of Object.entries(datFileContent.files)) {
|
|
420
|
-
const
|
|
421
|
-
|
|
422
|
-
|
|
374
|
+
const filePath = (0, hashUtils_1.getFilePathFromSha256)(datFileContent.files[fileKey].sha256, "data");
|
|
375
|
+
// Perform the integrity check
|
|
376
|
+
let integrityCheck;
|
|
377
|
+
if (!skipIntegirtyCheck) {
|
|
378
|
+
integrityCheck =
|
|
379
|
+
await DataIntegrityTree_1.DataIntegrityTree.validateKeyIntegrityWithForeignTree(fileKey, datFileContent.files[fileKey].sha256, datFileContent, rootHash, path_1.default.join(config_1.STORE_PATH, this.storeId, "data"));
|
|
380
|
+
}
|
|
381
|
+
if (integrityCheck || skipIntegirtyCheck) {
|
|
382
|
+
// Add the file to the Set
|
|
383
|
+
filesInvolved.add({
|
|
384
|
+
name: Buffer.from(fileKey, "hex").toString("utf-8"),
|
|
385
|
+
path: filePath,
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
console.error((0, colorette_1.red)(`File ${fileKey} failed the integrity check.`));
|
|
390
|
+
throw new Error(`Integrity check failed for file: ${fileKey}. Aborting.`);
|
|
391
|
+
}
|
|
423
392
|
}
|
|
424
|
-
return
|
|
425
|
-
|
|
426
|
-
getManifestHashes() {
|
|
427
|
-
const manifestFilePath = path_1.default.join(config_1.STORE_PATH, this.storeId, "manifest.dat");
|
|
428
|
-
return fs_1.default.existsSync(manifestFilePath)
|
|
429
|
-
? fs_1.default.readFileSync(manifestFilePath, "utf-8").split("\n").filter(Boolean)
|
|
430
|
-
: [];
|
|
393
|
+
// Convert Set to Array and return
|
|
394
|
+
return Array.from(filesInvolved);
|
|
431
395
|
}
|
|
432
396
|
}
|
|
433
397
|
exports.DataStore = DataStore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataStoreSerializer.d.ts","sourceRoot":"","sources":["../../src/blockchain/DataStoreSerializer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAKV,MAAM,
|
|
1
|
+
{"version":3,"file":"DataStoreSerializer.d.ts","sourceRoot":"","sources":["../../src/blockchain/DataStoreSerializer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAKV,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,SAAS,CAAY;IAC7B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,UAAU,CAAS;gBAEf,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAOnE,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAgDF,WAAW,CACvB,IAAI,EAAE;QACJ,WAAW,EAAE,GAAG,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;KACpB,GACA;QACD,WAAW,EAAE,SAAS,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;KACpB;CAuEF"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Peer } from "datalayer-driver";
|
|
1
|
+
import { Peer } from "@dignetwork/datalayer-driver";
|
|
2
2
|
export declare class FullNodePeer {
|
|
3
3
|
private static cachedPeer;
|
|
4
4
|
private static memoizedFetchNewPeerIPs;
|
|
5
5
|
private peer;
|
|
6
|
+
private static deprioritizedIps;
|
|
6
7
|
private constructor();
|
|
7
8
|
static connect(): Promise<Peer>;
|
|
8
9
|
private static isPortReachable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FullNodePeer.d.ts","sourceRoot":"","sources":["../../src/blockchain/FullNodePeer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"FullNodePeer.d.ts","sourceRoot":"","sources":["../../src/blockchain/FullNodePeer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAO,MAAM,8BAA8B,CAAC;AAoBzD,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAC,UAAU,CAAkD;IAC3E,OAAO,CAAC,MAAM,CAAC,uBAAuB,CAA0B;IAChE,OAAO,CAAC,IAAI,CAAO;IACnB,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAA0B;IAQzD,OAAO;WAIa,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAK5C,OAAO,CAAC,MAAM,CAAC,eAAe;IAiB9B,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAM/B;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,kBAAkB;mBASZ,eAAe;mBA6Df,UAAU;IA2B/B,OAAO,CAAC,MAAM,CAAC,eAAe;mBAyDT,WAAW;IAsGzB,OAAO,IAAI,IAAI;WAIF,mBAAmB,CACrC,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,OAAO,CAAC;CAwBpB"}
|
|
@@ -7,15 +7,16 @@ exports.FullNodePeer = void 0;
|
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const os_1 = __importDefault(require("os"));
|
|
9
9
|
const fs_1 = __importDefault(require("fs"));
|
|
10
|
-
const datalayer_driver_1 = require("datalayer-driver");
|
|
11
|
-
const chia_server_coin_1 = require("chia-server-coin");
|
|
10
|
+
const datalayer_driver_1 = require("@dignetwork/datalayer-driver");
|
|
12
11
|
const promises_1 = require("dns/promises");
|
|
13
12
|
const net_1 = __importDefault(require("net"));
|
|
14
13
|
const lodash_1 = require("lodash");
|
|
15
14
|
const nanospinner_1 = require("nanospinner");
|
|
16
15
|
const config_1 = require("../utils/config");
|
|
16
|
+
const Environment_1 = require("../utils/Environment");
|
|
17
17
|
const FULLNODE_PORT = 8444;
|
|
18
18
|
const LOCALHOST = "127.0.0.1";
|
|
19
|
+
const CHIA_NODES_HOST = "chia-nodes";
|
|
19
20
|
const DNS_HOSTS = [
|
|
20
21
|
"dns-introducer.chia.net",
|
|
21
22
|
"chia.ctrlaltdel.ch",
|
|
@@ -55,7 +56,7 @@ class FullNodePeer {
|
|
|
55
56
|
* @returns {string | null} The valid IP address or null if invalid
|
|
56
57
|
*/
|
|
57
58
|
static getTrustedFullNode() {
|
|
58
|
-
const trustedNodeIp =
|
|
59
|
+
const trustedNodeIp = Environment_1.Environment.TRUSTED_FULLNODE || null;
|
|
59
60
|
if (trustedNodeIp && FullNodePeer.isValidIpAddress(trustedNodeIp)) {
|
|
60
61
|
return trustedNodeIp;
|
|
61
62
|
}
|
|
@@ -64,15 +65,22 @@ class FullNodePeer {
|
|
|
64
65
|
static async fetchNewPeerIPs() {
|
|
65
66
|
const trustedNodeIp = FullNodePeer.getTrustedFullNode();
|
|
66
67
|
const priorityIps = [];
|
|
67
|
-
// Prioritize trustedNodeIp
|
|
68
|
+
// Prioritize trustedNodeIp unless it's deprioritized
|
|
68
69
|
if (trustedNodeIp &&
|
|
70
|
+
!FullNodePeer.deprioritizedIps.has(trustedNodeIp) &&
|
|
69
71
|
(await FullNodePeer.isPortReachable(trustedNodeIp, FULLNODE_PORT))) {
|
|
70
72
|
priorityIps.push(trustedNodeIp);
|
|
71
73
|
}
|
|
72
|
-
// Prioritize LOCALHOST
|
|
73
|
-
if (
|
|
74
|
+
// Prioritize LOCALHOST unless it's deprioritized
|
|
75
|
+
if (!FullNodePeer.deprioritizedIps.has(LOCALHOST) &&
|
|
76
|
+
(await FullNodePeer.isPortReachable(LOCALHOST, FULLNODE_PORT))) {
|
|
74
77
|
priorityIps.push(LOCALHOST);
|
|
75
78
|
}
|
|
79
|
+
// Prioritize CHIA_NODES_HOST unless it's deprioritized
|
|
80
|
+
if (!FullNodePeer.deprioritizedIps.has(CHIA_NODES_HOST) &&
|
|
81
|
+
(await FullNodePeer.isPortReachable(CHIA_NODES_HOST, FULLNODE_PORT))) {
|
|
82
|
+
priorityIps.push(CHIA_NODES_HOST);
|
|
83
|
+
}
|
|
76
84
|
if (priorityIps.length > 0) {
|
|
77
85
|
return priorityIps;
|
|
78
86
|
}
|
|
@@ -114,6 +122,8 @@ class FullNodePeer {
|
|
|
114
122
|
}
|
|
115
123
|
// @ts-ignore
|
|
116
124
|
if (FullNodePeer.memoizedFetchNewPeerIPs?.cache?.clear) {
|
|
125
|
+
// Clear cache and reset deprioritized IPs when cache is cleared
|
|
126
|
+
FullNodePeer.deprioritizedIps.clear();
|
|
117
127
|
// @ts-ignore
|
|
118
128
|
FullNodePeer.memoizedFetchNewPeerIPs.cache.clear();
|
|
119
129
|
}
|
|
@@ -147,10 +157,13 @@ class FullNodePeer {
|
|
|
147
157
|
}
|
|
148
158
|
catch (error) {
|
|
149
159
|
// If the error is WebSocket-related or timeout, reset the peer
|
|
150
|
-
if (error.message.includes("WebSocket") ||
|
|
160
|
+
if (error.message.includes("WebSocket") ||
|
|
161
|
+
error.message.includes("Operation timed out")) {
|
|
151
162
|
FullNodePeer.cachedPeer = null;
|
|
152
163
|
// @ts-ignore
|
|
153
164
|
FullNodePeer.memoizedFetchNewPeerIPs.cache.clear();
|
|
165
|
+
FullNodePeer.deprioritizedIps.clear();
|
|
166
|
+
console.info(`Fullnode Peer error, reconnecting to a new peer...`);
|
|
154
167
|
const newPeer = await FullNodePeer.getBestPeer();
|
|
155
168
|
return newPeer[prop](...args);
|
|
156
169
|
}
|
|
@@ -174,13 +187,21 @@ class FullNodePeer {
|
|
|
174
187
|
if (!fs_1.default.existsSync(sslFolder)) {
|
|
175
188
|
fs_1.default.mkdirSync(sslFolder, { recursive: true });
|
|
176
189
|
}
|
|
177
|
-
new
|
|
190
|
+
const tls = new datalayer_driver_1.Tls(certFile, keyFile);
|
|
178
191
|
const peerIPs = await FullNodePeer.getPeerIPs();
|
|
179
|
-
const trustedNodeIp =
|
|
192
|
+
const trustedNodeIp = Environment_1.Environment.TRUSTED_FULLNODE || null;
|
|
180
193
|
const peers = await Promise.all(peerIPs.map(async (ip) => {
|
|
181
194
|
if (ip) {
|
|
195
|
+
// Allow override of the trusted fullnode port if the override exists
|
|
196
|
+
let port = FULLNODE_PORT;
|
|
197
|
+
if (trustedNodeIp && ip === trustedNodeIp) {
|
|
198
|
+
const trustedFullNodePort = Environment_1.Environment.TRUSTED_FULLNODE_PORT;
|
|
199
|
+
if (trustedFullNodePort) {
|
|
200
|
+
port = trustedFullNodePort;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
182
203
|
try {
|
|
183
|
-
const peer = await datalayer_driver_1.Peer.new(`${ip}:${
|
|
204
|
+
const peer = await datalayer_driver_1.Peer.new(`${ip}:${port}`, false, tls);
|
|
184
205
|
return FullNodePeer.createPeerProxy(peer);
|
|
185
206
|
}
|
|
186
207
|
catch (error) {
|
|
@@ -206,16 +227,19 @@ class FullNodePeer {
|
|
|
206
227
|
throw new Error("No valid peak heights obtained from any peer.");
|
|
207
228
|
}
|
|
208
229
|
const highestPeak = Math.max(...validHeights);
|
|
209
|
-
// Prioritize LOCALHOST and
|
|
230
|
+
// Prioritize LOCALHOST, TRUSTED_NODE_IP, and CHIA_NODES_HOST if they have the highest peak height
|
|
210
231
|
let bestPeerIndex = validHeights.findIndex((height, index) => height === highestPeak &&
|
|
211
|
-
(peerIPs[index]
|
|
212
|
-
|
|
232
|
+
!FullNodePeer.deprioritizedIps.has(peerIPs[index]) && // Exclude deprioritized IPs
|
|
233
|
+
(peerIPs[index] === LOCALHOST ||
|
|
234
|
+
peerIPs[index] === trustedNodeIp ||
|
|
235
|
+
peerIPs[index] === CHIA_NODES_HOST));
|
|
236
|
+
// If LOCALHOST, TRUSTED_NODE_IP, or CHIA_NODES_HOST don't have the highest peak, select any peer with the highest peak
|
|
213
237
|
if (bestPeerIndex === -1) {
|
|
214
238
|
bestPeerIndex = validHeights.findIndex((height) => height === highestPeak);
|
|
215
239
|
}
|
|
216
240
|
const bestPeer = peers[bestPeerIndex];
|
|
217
241
|
FullNodePeer.cachedPeer = { peer: bestPeer, timestamp: now };
|
|
218
|
-
console.log(`Using Peer: ${peerIPs[bestPeerIndex]}`);
|
|
242
|
+
console.log(`Using Fullnode Peer: ${peerIPs[bestPeerIndex]}`);
|
|
219
243
|
return bestPeer;
|
|
220
244
|
}
|
|
221
245
|
getPeer() {
|
|
@@ -242,6 +266,7 @@ class FullNodePeer {
|
|
|
242
266
|
}
|
|
243
267
|
exports.FullNodePeer = FullNodePeer;
|
|
244
268
|
FullNodePeer.cachedPeer = null;
|
|
269
|
+
FullNodePeer.deprioritizedIps = new Set(); // New set for deprioritized IPs
|
|
245
270
|
(() => {
|
|
246
271
|
FullNodePeer.memoizedFetchNewPeerIPs = (0, lodash_1.memoize)(FullNodePeer.fetchNewPeerIPs);
|
|
247
272
|
})();
|
|
@@ -1,21 +1,29 @@
|
|
|
1
|
-
import { ServerCoin as ServerCoinDriver } from "datalayer-driver";
|
|
1
|
+
import { ServerCoin as ServerCoinDriver } from "@dignetwork/datalayer-driver";
|
|
2
2
|
import { NconfManager } from "../utils/NconfManager";
|
|
3
3
|
export declare class ServerCoin {
|
|
4
4
|
private storeId;
|
|
5
5
|
static readonly serverCoinManager: NconfManager;
|
|
6
6
|
constructor(storeId: string);
|
|
7
|
-
createForEpoch(peerIp: string): Promise<ServerCoinDriver>;
|
|
8
|
-
saveServerCoinData(serverCoin: ServerCoinDriver, epoch: number, peerIp: string): Promise<void>;
|
|
7
|
+
createForEpoch(peerIp: string, rootHash: string): Promise<ServerCoinDriver>;
|
|
8
|
+
saveServerCoinData(serverCoin: ServerCoinDriver, epoch: number, peerIp: string, rootHash: string): Promise<void>;
|
|
9
9
|
melt(epoch: number, peerIp: string): Promise<void>;
|
|
10
10
|
private removeServerCoinData;
|
|
11
|
+
getAllEpochPeers(epoch: number, blacklist?: string[]): Promise<string[]>;
|
|
12
|
+
getActiveEpochPeers(blacklist?: string[]): Promise<string[]>;
|
|
11
13
|
sampleCurrentEpoch(sampleSize?: number, blacklist?: string[]): Promise<string[]>;
|
|
12
14
|
sampleServerCoinsByEpoch(epoch: number, sampleSize?: number, blacklist?: string[]): Promise<string[]>;
|
|
13
|
-
static getCurrentEpoch():
|
|
15
|
+
static getCurrentEpoch(): {
|
|
16
|
+
epoch: number;
|
|
17
|
+
round: number;
|
|
18
|
+
};
|
|
14
19
|
ensureServerCoinExists(peerIp: string): Promise<void>;
|
|
15
20
|
meltOutdatedEpochs(peerIp: string): Promise<void>;
|
|
16
21
|
static meltUntrackedStoreCoins(): Promise<void>;
|
|
17
22
|
private getServerCoinsForStore;
|
|
18
23
|
hasEpochCoinBeenCreated(currentEpoch: number, peerIp: string): Promise<boolean>;
|
|
19
|
-
static
|
|
24
|
+
static calculateEpochAndRound(currentTimestampUTC: Date): {
|
|
25
|
+
epoch: number;
|
|
26
|
+
round: number;
|
|
27
|
+
};
|
|
20
28
|
}
|
|
21
29
|
//# sourceMappingURL=ServerCoin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServerCoin.d.ts","sourceRoot":"","sources":["../../src/blockchain/ServerCoin.ts"],"names":[],"mappings":"AACA,OAAO,EAML,UAAU,IAAI,gBAAgB,EAE/B,MAAM,
|
|
1
|
+
{"version":3,"file":"ServerCoin.d.ts","sourceRoot":"","sources":["../../src/blockchain/ServerCoin.ts"],"names":[],"mappings":"AACA,OAAO,EAML,UAAU,IAAI,gBAAgB,EAE/B,MAAM,8BAA8B,CAAC;AAItC,OAAO,EAAE,YAA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