@dignetwork/dig-sdk 0.0.1-alpha.68 → 0.0.1-alpha.70
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DigPeer.d.ts","sourceRoot":"","sources":["../../src/DigNetwork/DigPeer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAKpD,OAAO,EAKL,MAAM,EACP,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"DigPeer.d.ts","sourceRoot":"","sources":["../../src/DigNetwork/DigPeer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAKpD,OAAO,EAKL,MAAM,EACP,MAAM,8BAA8B,CAAC;AAKtC,qBAAa,OAAO;IAClB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,cAAc,CAAgB;IACtC,OAAO,CAAC,kBAAkB,CAAoB;IAC9C,OAAO,CAAC,gBAAgB,CAAkB;gBAE9B,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAS9C,IAAW,aAAa,IAAI,aAAa,CAExC;IAGD,IAAW,iBAAiB,IAAI,iBAAiB,CAEhD;IAGD,IAAW,eAAe,IAAI,eAAe,CAE5C;IAED,IAAW,SAAS,IAAI,MAAM,CAE7B;WAEa,qBAAqB,CACjC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EAAE,EACnB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EAAE,GACd,OAAO,CAAC,IAAI,CAAC;WAuBI,gBAAgB,CAClC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,IAAI,CAAC;IAwCH,WAAW,CACtB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,KAAK,GAAE,MAAM,EAAO,GACnB,OAAO,CAAC,IAAI,CAAC;WAYF,iBAAiB,CAAC,OAAO,EAAE,MAAM;IAqBlC,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAc1B,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/D,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKlD,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG3D"}
|
|
@@ -9,14 +9,10 @@ const ContentServer_1 = require("./ContentServer");
|
|
|
9
9
|
const PropagationServer_1 = require("./PropagationServer");
|
|
10
10
|
const IncentiveServer_1 = require("./IncentiveServer");
|
|
11
11
|
const blockchain_1 = require("../blockchain");
|
|
12
|
-
const fs_1 = __importDefault(require("fs"));
|
|
13
12
|
const datalayer_driver_1 = require("@dignetwork/datalayer-driver");
|
|
14
13
|
const blockchain_2 = require("../blockchain");
|
|
15
14
|
const blockchain_3 = require("../blockchain");
|
|
16
15
|
const coins_1 = require("../blockchain/coins");
|
|
17
|
-
const util_1 = require("util");
|
|
18
|
-
const rename = (0, util_1.promisify)(fs_1.default.rename);
|
|
19
|
-
const unlink = (0, util_1.promisify)(fs_1.default.unlink);
|
|
20
16
|
class DigPeer {
|
|
21
17
|
constructor(ipAddress, storeId) {
|
|
22
18
|
this.ipAddress = ipAddress;
|
|
@@ -11,7 +11,7 @@ export declare class PropagationServer {
|
|
|
11
11
|
password: string | undefined;
|
|
12
12
|
private static readonly port;
|
|
13
13
|
private static multiBar;
|
|
14
|
-
constructor(
|
|
14
|
+
constructor(ipAddress: string, storeId: string);
|
|
15
15
|
/**
|
|
16
16
|
* Initialize the Wallet instance.
|
|
17
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropagationServer.d.ts","sourceRoot":"","sources":["../../src/DigNetwork/PropagationServer.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,OAAO,CAAC;AAiB1B,qBAAa,iBAAiB;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,GAAG,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAE7B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAQ;IAIpC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAqCrB;gBAEU,
|
|
1
|
+
{"version":3,"file":"PropagationServer.d.ts","sourceRoot":"","sources":["../../src/DigNetwork/PropagationServer.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,OAAO,CAAC;AAiB1B,qBAAa,iBAAiB;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,GAAG,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAE7B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAQ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28
|
}
|
|
29
29
|
class PropagationServer {
|
|
30
|
-
constructor(
|
|
30
|
+
constructor(ipAddress, storeId) {
|
|
31
31
|
this.storeId = storeId;
|
|
32
32
|
this.sessionId = ""; // Session ID will be set after starting the upload session
|
|
33
33
|
this.publicKey = ""; // Public key will be set after initializing the wallet
|
|
@@ -248,7 +248,7 @@ class PropagationServer {
|
|
|
248
248
|
* @param {string} ipAddress - The IP address of the server.
|
|
249
249
|
*/
|
|
250
250
|
static async uploadStore(storeId, rootHash, ipAddress) {
|
|
251
|
-
const propagationServer = new PropagationServer(
|
|
251
|
+
const propagationServer = new PropagationServer(ipAddress, storeId);
|
|
252
252
|
// Initialize wallet
|
|
253
253
|
await propagationServer.initializeWallet();
|
|
254
254
|
// Check if the store exists
|
|
@@ -407,7 +407,7 @@ class PropagationServer {
|
|
|
407
407
|
* @param {string} ipAddress - The IP address of the server.
|
|
408
408
|
*/
|
|
409
409
|
static async downloadStore(storeId, rootHash, ipAddress) {
|
|
410
|
-
const propagationServer = new PropagationServer(
|
|
410
|
+
const propagationServer = new PropagationServer(ipAddress, storeId);
|
|
411
411
|
// Initialize wallet
|
|
412
412
|
await propagationServer.initializeWallet();
|
|
413
413
|
// Check if the store exists
|