Compare commits

...

5 Commits

Author SHA1 Message Date
semantic-release-bot 74f5c83487 chore(release): 0.1.0-develop.4 [skip ci]
# [0.1.0-develop.4](https://git.lumeweb.com/LumeWeb/kernel-swarm/compare/v0.1.0-develop.3...v0.1.0-develop.4) (2023-07-24)

### Bug Fixes

* on swarmInstance init, add every relay as an explicit peer ([873bc3d](873bc3da52))
* patch dht-relay handshake logic to prevent duplicate processing ([12cb3a3](12cb3a3b5e))
* patch protomux to use the buffers arraybuffer byteLength ([dcad699](dcad699ae1))
2023-07-24 17:32:46 +00:00
Derrick Hammer 0ed4449161
Merge remote-tracking branch 'origin/develop' into develop 2023-07-24 13:31:07 -04:00
Derrick Hammer dcad699ae1
fix: patch protomux to use the buffers arraybuffer byteLength 2023-07-24 13:30:55 -04:00
Derrick Hammer 12cb3a3b5e
fix: patch dht-relay handshake logic to prevent duplicate processing 2023-07-24 13:30:14 -04:00
Derrick Hammer 873bc3da52
fix: on swarmInstance init, add every relay as an explicit peer 2023-07-24 13:24:06 -04:00
6 changed files with 40 additions and 6 deletions

View File

@ -1,3 +1,12 @@
# [0.1.0-develop.4](https://git.lumeweb.com/LumeWeb/kernel-swarm/compare/v0.1.0-develop.3...v0.1.0-develop.4) (2023-07-24)
### Bug Fixes
* on swarmInstance init, add every relay as an explicit peer ([873bc3d](https://git.lumeweb.com/LumeWeb/kernel-swarm/commit/873bc3da52d206635d7dea5f8090e1a05ccf6828))
* patch dht-relay handshake logic to prevent duplicate processing ([12cb3a3](https://git.lumeweb.com/LumeWeb/kernel-swarm/commit/12cb3a3b5ee16bbda03458627a0ea67f89d7576b))
* patch protomux to use the buffers arraybuffer byteLength ([dcad699](https://git.lumeweb.com/LumeWeb/kernel-swarm/commit/dcad699ae1f5f14e3ffe3844607028a6cd53130e))
# [0.1.0-develop.3](https://git.lumeweb.com/LumeWeb/kernel-swarm/compare/v0.1.0-develop.2...v0.1.0-develop.3) (2023-07-23)

4
npm-shrinkwrap.json generated
View File

@ -1,12 +1,12 @@
{
"name": "@lumeweb/kernel-swarm",
"version": "0.1.0-develop.3",
"version": "0.1.0-develop.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@lumeweb/kernel-swarm",
"version": "0.1.0-develop.3",
"version": "0.1.0-develop.4",
"hasInstallScript": true,
"dependencies": {
"@lumeweb/hyperswarm-web": "0.0.2-develop.8",

View File

@ -38,7 +38,7 @@
"patch-package": "^7.0.0",
"presetter": "*"
},
"version": "0.1.0-develop.3",
"version": "0.1.0-develop.4",
"readme": "ERROR: No README data found!",
"overrides": {
"buffer": "^6.0.3"

View File

@ -0,0 +1,13 @@
diff --git a/node_modules/@hyperswarm/dht-relay/lib/node.js b/node_modules/@hyperswarm/dht-relay/lib/node.js
index 9ee8ef9..8a37655 100644
--- a/node_modules/@hyperswarm/dht-relay/lib/node.js
+++ b/node_modules/@hyperswarm/dht-relay/lib/node.js
@@ -407,7 +407,7 @@ function onNoiseReceive (message) {
if (message.isInitiator) {
const handshake = this._handshakes.get(message.id)
- if (handshake) {
+ if (handshake && !handshake.complete) {
handshake._onNoiseReceive(message)
}
} else {

View File

@ -1,5 +1,5 @@
diff --git a/node_modules/protomux/index.js b/node_modules/protomux/index.js
index 07bf0ad..c8db59c 100644
index 07bf0ad..ef91c72 100644
--- a/node_modules/protomux/index.js
+++ b/node_modules/protomux/index.js
@@ -195,34 +195,34 @@ class Channel {
@ -9,7 +9,7 @@ index 07bf0ad..c8db59c 100644
- recv (state, session) {
+ async recv (state, session) {
session._track(m.onmessage(encoding.decode(state), session))
},
},
- send (m, session = s) {
+ async send (m, session = s) {
if (session.closed === true) return false
@ -43,3 +43,12 @@ index 07bf0ad..c8db59c 100644
mux.drained = mux.stream.write(state.buffer)
@@ -417,7 +417,7 @@ module.exports = class Protomux {
_ondata (buffer) {
try {
- const state = { buffer, start: 0, end: buffer.byteLength }
+ const state = { buffer, start: 0, end: buffer.buffer.byteLength }
this._decode(c.uint.decode(state), state)
} catch (err) {
this._safeDestroy(err)

View File

@ -16,7 +16,7 @@ import { EventEmitter2 as EventEmitter } from "eventemitter2";
// @ts-ignore
import Protomux from "protomux";
import defer, { DeferredPromise } from "p-defer";
import { concatBytes } from "@lumeweb/libkernel";
import { concatBytes, hexToBytes } from "@lumeweb/libweb";
const MAX_PEER_LISTENERS = 20;
@ -134,6 +134,9 @@ async function createSwarm(): Promise<number> {
swarmInstanceEvents.emit("connection", peer);
});
swarmInstance.relays.forEach((relay) => {
swarmInstance.activeRelay.joinPeer(hexToBytes(relay));
});
});
swarmInstance.onSelf("close", (...args) => {