Compare commits
5 Commits
v0.1.0-dev
...
v0.1.0-dev
Author | SHA1 | Date |
---|---|---|
semantic-release-bot | 74f5c83487 | |
Derrick Hammer | 0ed4449161 | |
Derrick Hammer | dcad699ae1 | |
Derrick Hammer | 12cb3a3b5e | |
Derrick Hammer | 873bc3da52 |
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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 {
|
|
@ -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)
|
||||
|
|
|
@ -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) => {
|
||||
|
|
Loading…
Reference in New Issue