@leofcoin/chain 1.5.13 → 1.5.14
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/exports/node.js +5 -3
- package/package.json +1 -1
package/exports/node.js
CHANGED
|
@@ -18,10 +18,12 @@ class Node {
|
|
|
18
18
|
}, password) {
|
|
19
19
|
this.#node = globalThis.Peernet ? await new globalThis.Peernet(config, password) : await new Peernet(config, password);
|
|
20
20
|
await nodeConfig(config);
|
|
21
|
-
globalThis.pubsub.subscribe('chain:ready', () => {
|
|
21
|
+
globalThis.pubsub.subscribe('chain:ready', async () => {
|
|
22
22
|
// when autostart is false the node will only be started after the chain is ready (this is here so we can just use node for communication)
|
|
23
|
-
if (!this.#node.autoStart)
|
|
24
|
-
this.#node.start();
|
|
23
|
+
if (!this.#node.autoStart) {
|
|
24
|
+
await this.#node.start();
|
|
25
|
+
pubsub.publish('node:ready', true);
|
|
26
|
+
}
|
|
25
27
|
});
|
|
26
28
|
return this;
|
|
27
29
|
// this.config = await config()
|