@leofcoin/peernet 0.11.6 → 0.11.9

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/test.js CHANGED
@@ -8,6 +8,7 @@ pubsub.subscribe('peer:connected', async peer => {
8
8
  request:'lastBlock'
9
9
  })
10
10
  const to = peer.id
11
+ await peernet.data.put('hello', 'hi')
11
12
  console.log(request);
12
13
  const node = await peernet.prepareMessage(to, request.encoded)
13
14
  console.log({node});
@@ -25,4 +26,10 @@ pubsub.subscribe('peer:connected', async peer => {
25
26
 
26
27
  const block = new TextDecoder().decode(response.decoded.response)
27
28
  console.log(block);
29
+ const task = () => setTimeout(() => {
30
+ console.log(peernet.connections[0]?.connected);
31
+ console.log(pubsub.subscribers);
32
+ task()
33
+ }, 5000);
34
+ task()
28
35
  })
package/test4.js ADDED
@@ -0,0 +1,7 @@
1
+ const Client = require('./dist/commonjs/peernet.js')
2
+
3
+ const client = new Client({root: '.peernet/test4'})
4
+
5
+ pubsub.subscribe('peer:connected', async peer => {
6
+ await peernet.get("ba5xcadcnub27naa7zrcvtmyruviahaiwvupatfgjkvdgcehuif7clissf")
7
+ })
package/webpack.config.js CHANGED
@@ -17,7 +17,7 @@ module.exports = [{
17
17
  })
18
18
  ],
19
19
  optimization: {
20
- minimize: true
20
+ minimize: false
21
21
  },
22
22
  resolve: {
23
23
  extensions: [ '.ts', '.js' ],
@@ -1,40 +0,0 @@
1
- /*!
2
- * Determine if an object is a Buffer
3
- *
4
- * @author Feross Aboukhadijeh <https://feross.org>
5
- * @license MIT
6
- */
7
-
8
- /*!
9
- * The buffer module from node.js, for the browser.
10
- *
11
- * @author Feross Aboukhadijeh <https://feross.org>
12
- * @license MIT
13
- */
14
-
15
- /*!
16
- * assert.js - assertions for javascript
17
- * Copyright (c) 2018, Christopher Jeffrey (MIT License).
18
- * https://github.com/chjj/bsert
19
- */
20
-
21
- /*!
22
- * base32.js - base32 for bcrypto
23
- * Copyright (c) 2014-2019, Christopher Jeffrey (MIT License).
24
- * https://github.com/bcoin-org/bcrypto
25
- *
26
- * Parts of this software are based on bitcoin/bitcoin:
27
- * Copyright (c) 2009-2019, The Bitcoin Core Developers (MIT License).
28
- * Copyright (c) 2009-2019, The Bitcoin Developers (MIT License).
29
- * https://github.com/bitcoin/bitcoin
30
- *
31
- * Resources:
32
- * https://tools.ietf.org/html/rfc4648
33
- * https://github.com/bitcoin/bitcoin/blob/11d486d/src/utilstrencodings.cpp#L230
34
- */
35
-
36
- /*! For license information please see browser.js.LICENSE.txt */
37
-
38
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
39
-
40
- /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */