diff --git a/examples/canvas/src/objects/canvas.ts b/examples/canvas/src/objects/canvas.ts index f568a03d..170dfbf3 100644 --- a/examples/canvas/src/objects/canvas.ts +++ b/examples/canvas/src/objects/canvas.ts @@ -76,12 +76,12 @@ export class Canvas implements CRO { if (!op.value) continue; switch (op.type) { case "splash": { - const [nodeId, offset, size, rgb] = op.value; + const [offset, size, rgb] = op.value; this._splash(offset, size, rgb); break; } case "paint": { - const [nodeId, offset, rgb] = op.value; + const [offset, rgb] = op.value; this._paint(offset, rgb); break; } diff --git a/packages/network/src/node.ts b/packages/network/src/node.ts index f131bbd3..59909ed4 100644 --- a/packages/network/src/node.ts +++ b/packages/network/src/node.ts @@ -132,9 +132,13 @@ export class TopologyNetworkNode { this._node.addEventListener("peer:connect", (e) => console.log("::start::peer::connect", e.detail), ); - this._node.addEventListener("peer:discovery", (e) => - console.log("::start::peer::discovery", e.detail), - ); + this._node.addEventListener("peer:discovery", (e) => { + // current bug in v11.0.0 requires manual dial (https://github.com/libp2p/js-libp2p-pubsub-peer-discovery/issues/149) + for (const ma of e.detail.multiaddrs) { + this._node?.dial(ma); + } + console.log("::start::peer::discovery", e.detail); + }); this._node.addEventListener("peer:identify", (e) => console.log("::start::peer::identify", e.detail), );