@gethashd/bytecave-browser 1.0.5 → 1.0.7
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/{chunk-QOLLCX4C.js → chunk-ML5MSIHT.js} +9 -4
- package/dist/index.cjs +9 -4
- package/dist/index.js +1 -1
- package/dist/react/index.cjs +2 -0
- package/dist/react/index.js +1 -1
- package/package.json +2 -1
- package/src/client.ts +8 -4
- package/src/p2p-protocols.ts +1 -1
|
@@ -5793,6 +5793,7 @@ var P2PProtocolClient = class {
|
|
|
5793
5793
|
await stream.close();
|
|
5794
5794
|
return response;
|
|
5795
5795
|
} catch (error) {
|
|
5796
|
+
console.error("[ByteCave P2P] Failed to get health from peer:", peerId.slice(0, 12), error.message || error);
|
|
5796
5797
|
return null;
|
|
5797
5798
|
}
|
|
5798
5799
|
}
|
|
@@ -5953,6 +5954,7 @@ import { floodsub } from "@libp2p/floodsub";
|
|
|
5953
5954
|
import { identify } from "@libp2p/identify";
|
|
5954
5955
|
import { bootstrap } from "@libp2p/bootstrap";
|
|
5955
5956
|
import { circuitRelayTransport } from "@libp2p/circuit-relay-v2";
|
|
5957
|
+
import { dcutr } from "@libp2p/dcutr";
|
|
5956
5958
|
import { multiaddr } from "@multiformats/multiaddr";
|
|
5957
5959
|
import { fromString, toString } from "uint8arrays";
|
|
5958
5960
|
import { ethers as ethers2 } from "ethers";
|
|
@@ -6019,6 +6021,11 @@ var ByteCaveClient = class {
|
|
|
6019
6021
|
],
|
|
6020
6022
|
connectionEncrypters: [noise()],
|
|
6021
6023
|
streamMuxers: [yamux()],
|
|
6024
|
+
services: {
|
|
6025
|
+
identify: identify(),
|
|
6026
|
+
pubsub: floodsub(),
|
|
6027
|
+
dcutr: dcutr()
|
|
6028
|
+
},
|
|
6022
6029
|
connectionGater: {
|
|
6023
6030
|
denyDialMultiaddr: () => false,
|
|
6024
6031
|
denyDialPeer: () => false,
|
|
@@ -6030,10 +6037,6 @@ var ByteCaveClient = class {
|
|
|
6030
6037
|
denyOutboundUpgradedConnection: () => false,
|
|
6031
6038
|
filterMultiaddrForPeer: () => true
|
|
6032
6039
|
},
|
|
6033
|
-
services: {
|
|
6034
|
-
identify: identify(),
|
|
6035
|
-
pubsub: floodsub()
|
|
6036
|
-
},
|
|
6037
6040
|
peerDiscovery: bootstrapPeers.length > 0 ? [
|
|
6038
6041
|
bootstrap({ list: bootstrapPeers })
|
|
6039
6042
|
] : void 0
|
|
@@ -6088,6 +6091,8 @@ var ByteCaveClient = class {
|
|
|
6088
6091
|
nodeId: health.nodeId
|
|
6089
6092
|
});
|
|
6090
6093
|
console.log("[ByteCave] \u2713 Discovered peer via HTTP relay:", health.nodeId || peer.peerId.slice(0, 12));
|
|
6094
|
+
} else {
|
|
6095
|
+
console.warn("[ByteCave] Health query returned null for peer:", peer.peerId.slice(0, 12));
|
|
6091
6096
|
}
|
|
6092
6097
|
}
|
|
6093
6098
|
} catch (err) {
|
package/dist/index.cjs
CHANGED
|
@@ -67,6 +67,7 @@ var import_floodsub = require("@libp2p/floodsub");
|
|
|
67
67
|
var import_identify = require("@libp2p/identify");
|
|
68
68
|
var import_bootstrap = require("@libp2p/bootstrap");
|
|
69
69
|
var import_circuit_relay_v2 = require("@libp2p/circuit-relay-v2");
|
|
70
|
+
var import_dcutr = require("@libp2p/dcutr");
|
|
70
71
|
var import_multiaddr = require("@multiformats/multiaddr");
|
|
71
72
|
var import_uint8arrays = require("uint8arrays");
|
|
72
73
|
var import_ethers2 = require("ethers");
|
|
@@ -5860,6 +5861,7 @@ var P2PProtocolClient = class {
|
|
|
5860
5861
|
await stream.close();
|
|
5861
5862
|
return response;
|
|
5862
5863
|
} catch (error) {
|
|
5864
|
+
console.error("[ByteCave P2P] Failed to get health from peer:", peerId.slice(0, 12), error.message || error);
|
|
5863
5865
|
return null;
|
|
5864
5866
|
}
|
|
5865
5867
|
}
|
|
@@ -6072,6 +6074,11 @@ var ByteCaveClient = class {
|
|
|
6072
6074
|
],
|
|
6073
6075
|
connectionEncrypters: [(0, import_libp2p_noise.noise)()],
|
|
6074
6076
|
streamMuxers: [(0, import_libp2p_yamux.yamux)()],
|
|
6077
|
+
services: {
|
|
6078
|
+
identify: (0, import_identify.identify)(),
|
|
6079
|
+
pubsub: (0, import_floodsub.floodsub)(),
|
|
6080
|
+
dcutr: (0, import_dcutr.dcutr)()
|
|
6081
|
+
},
|
|
6075
6082
|
connectionGater: {
|
|
6076
6083
|
denyDialMultiaddr: () => false,
|
|
6077
6084
|
denyDialPeer: () => false,
|
|
@@ -6083,10 +6090,6 @@ var ByteCaveClient = class {
|
|
|
6083
6090
|
denyOutboundUpgradedConnection: () => false,
|
|
6084
6091
|
filterMultiaddrForPeer: () => true
|
|
6085
6092
|
},
|
|
6086
|
-
services: {
|
|
6087
|
-
identify: (0, import_identify.identify)(),
|
|
6088
|
-
pubsub: (0, import_floodsub.floodsub)()
|
|
6089
|
-
},
|
|
6090
6093
|
peerDiscovery: bootstrapPeers.length > 0 ? [
|
|
6091
6094
|
(0, import_bootstrap.bootstrap)({ list: bootstrapPeers })
|
|
6092
6095
|
] : void 0
|
|
@@ -6141,6 +6144,8 @@ var ByteCaveClient = class {
|
|
|
6141
6144
|
nodeId: health.nodeId
|
|
6142
6145
|
});
|
|
6143
6146
|
console.log("[ByteCave] \u2713 Discovered peer via HTTP relay:", health.nodeId || peer.peerId.slice(0, 12));
|
|
6147
|
+
} else {
|
|
6148
|
+
console.warn("[ByteCave] Health query returned null for peer:", peer.peerId.slice(0, 12));
|
|
6144
6149
|
}
|
|
6145
6150
|
}
|
|
6146
6151
|
} catch (err) {
|
package/dist/index.js
CHANGED
package/dist/react/index.cjs
CHANGED
|
@@ -402,6 +402,7 @@ var import_floodsub = require("@libp2p/floodsub");
|
|
|
402
402
|
var import_identify = require("@libp2p/identify");
|
|
403
403
|
var import_bootstrap = require("@libp2p/bootstrap");
|
|
404
404
|
var import_circuit_relay_v2 = require("@libp2p/circuit-relay-v2");
|
|
405
|
+
var import_dcutr = require("@libp2p/dcutr");
|
|
405
406
|
var import_multiaddr = require("@multiformats/multiaddr");
|
|
406
407
|
var import_uint8arrays = require("uint8arrays");
|
|
407
408
|
var import_ethers2 = require("ethers");
|
|
@@ -6115,6 +6116,7 @@ var P2PProtocolClient = class {
|
|
|
6115
6116
|
await stream.close();
|
|
6116
6117
|
return response;
|
|
6117
6118
|
} catch (error) {
|
|
6119
|
+
console.error("[ByteCave P2P] Failed to get health from peer:", peerId.slice(0, 12), error.message || error);
|
|
6118
6120
|
return null;
|
|
6119
6121
|
}
|
|
6120
6122
|
}
|
package/dist/react/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gethashd/bytecave-browser",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "ByteCave browser client for WebRTC P2P connections to storage nodes",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"@chainsafe/libp2p-yamux": "^8.0.1",
|
|
41
41
|
"@libp2p/bootstrap": "^12.0.10",
|
|
42
42
|
"@libp2p/circuit-relay-v2": "^4.1.2",
|
|
43
|
+
"@libp2p/dcutr": "^3.0.10",
|
|
43
44
|
"@libp2p/floodsub": "^11.0.10",
|
|
44
45
|
"@libp2p/identify": "^4.0.9",
|
|
45
46
|
"@libp2p/webrtc": "^6.0.10",
|
package/src/client.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { floodsub } from '@libp2p/floodsub';
|
|
|
13
13
|
import { identify } from '@libp2p/identify';
|
|
14
14
|
import { bootstrap } from '@libp2p/bootstrap';
|
|
15
15
|
import { circuitRelayTransport } from '@libp2p/circuit-relay-v2';
|
|
16
|
+
import { dcutr } from '@libp2p/dcutr';
|
|
16
17
|
import { multiaddr } from '@multiformats/multiaddr';
|
|
17
18
|
import { peerIdFromString } from '@libp2p/peer-id';
|
|
18
19
|
import { fromString, toString } from 'uint8arrays';
|
|
@@ -102,6 +103,11 @@ export class ByteCaveClient {
|
|
|
102
103
|
],
|
|
103
104
|
connectionEncrypters: [noise()],
|
|
104
105
|
streamMuxers: [yamux()],
|
|
106
|
+
services: {
|
|
107
|
+
identify: identify(),
|
|
108
|
+
pubsub: floodsub(),
|
|
109
|
+
dcutr: dcutr() as any
|
|
110
|
+
},
|
|
105
111
|
connectionGater: {
|
|
106
112
|
denyDialMultiaddr: () => false,
|
|
107
113
|
denyDialPeer: () => false,
|
|
@@ -113,10 +119,6 @@ export class ByteCaveClient {
|
|
|
113
119
|
denyOutboundUpgradedConnection: () => false,
|
|
114
120
|
filterMultiaddrForPeer: () => true
|
|
115
121
|
},
|
|
116
|
-
services: {
|
|
117
|
-
identify: identify(),
|
|
118
|
-
pubsub: floodsub()
|
|
119
|
-
},
|
|
120
122
|
peerDiscovery: bootstrapPeers.length > 0 ? [
|
|
121
123
|
bootstrap({ list: bootstrapPeers })
|
|
122
124
|
] : undefined
|
|
@@ -190,6 +192,8 @@ export class ByteCaveClient {
|
|
|
190
192
|
nodeId: health.nodeId
|
|
191
193
|
});
|
|
192
194
|
console.log('[ByteCave] ✓ Discovered peer via HTTP relay:', health.nodeId || peer.peerId.slice(0, 12));
|
|
195
|
+
} else {
|
|
196
|
+
console.warn('[ByteCave] Health query returned null for peer:', peer.peerId.slice(0, 12));
|
|
193
197
|
}
|
|
194
198
|
}
|
|
195
199
|
} catch (err: any) {
|
package/src/p2p-protocols.ts
CHANGED
|
@@ -244,7 +244,7 @@ export class P2PProtocolClient {
|
|
|
244
244
|
return response;
|
|
245
245
|
|
|
246
246
|
} catch (error: any) {
|
|
247
|
-
|
|
247
|
+
console.error('[ByteCave P2P] Failed to get health from peer:', peerId.slice(0, 12), error.message || error);
|
|
248
248
|
return null;
|
|
249
249
|
}
|
|
250
250
|
}
|