From 22b77e0b2f02f4dad8b1152a74a0840c34c20ed1 Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Tue, 5 Oct 2021 11:55:25 -0400 Subject: [PATCH] An initial read forces gun to connect to peers --- utils/GunSmith/gun.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/utils/GunSmith/gun.js b/utils/GunSmith/gun.js index 843ba596..df3f22dc 100644 --- a/utils/GunSmith/gun.js +++ b/utils/GunSmith/gun.js @@ -85,6 +85,12 @@ const handleMsg = async msg => { if (msg.type === 'init') { gun = /** @type {any} */ (new Gun(msg.opts)) + // Force gun to connect to peers + gun + .get('foo') + .get('baz') + .once() + let currentPeers = '' setInterval(() => { const newPeers = JSON.stringify(