From 27fc808de439ed1d90f0403614a385e5cbb3af38 Mon Sep 17 00:00:00 2001 From: Drew Ewing Date: Fri, 23 Sep 2022 14:21:28 -0700 Subject: [PATCH 1/2] fix(connectivity): debugging and fixing connectivity issues --- config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.ts b/config.ts index 5ba8d30574..9c9a115e32 100644 --- a/config.ts +++ b/config.ts @@ -3,7 +3,7 @@ import { Commitment } from '@solana/web3.js' import type { IridiumConfig } from '@satellite-im/iridium' const nodes = process.env.NUXT_ENV_IRIDIUM_SYNC_NODES?.split(',') || [ - '/ip4/localhost/tcp/443/wss/p2p/12D3KooWRgdhiJam4naWGYtgLXtc17ty89MMPvig41p9BhKG7FRW', + '/dns4/sync-ny.satellite.im/tcp/443/wss/p2p/12D3KooWRnsCHcpEWE6vPcrFc8sjGusu9xhy6s2PCevMMB24bsQm', ] const gateways = process.env.NUXT_ENV_IRIDIUM_GATEWAYS?.split(',') || [ 'https://satellite.infura-ipfs.io', From 533f4cccc1501b400e5fc15313a0365cc0634947 Mon Sep 17 00:00:00 2001 From: Drew Ewing Date: Fri, 23 Sep 2022 15:25:38 -0700 Subject: [PATCH 2/2] fix(connectivity): debugging and fixing connectivity issues --- libraries/Iridium/friends/FriendsManager.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/libraries/Iridium/friends/FriendsManager.ts b/libraries/Iridium/friends/FriendsManager.ts index be4221236c..feaf0d7395 100644 --- a/libraries/Iridium/friends/FriendsManager.ts +++ b/libraries/Iridium/friends/FriendsManager.ts @@ -58,6 +58,19 @@ export default class FriendsManager extends Emitter { await this.fetch() logger.log(this.loggerTag, 'friends state loaded', this.state) + if (iridium.connector.p2p.hasNode) { + await this.startP2P() + } + + iridium.connector.p2p.on('nodeReady', async () => { + await this.startP2P() + }) + + logger.info(this.loggerTag, 'initialized', this) + this.emit('ready', {}) + } + + async startP2P() { // connect to all friends await Promise.all( [ @@ -126,9 +139,6 @@ export default class FriendsManager extends Emitter { }, ].map((fn) => fn()), ) - - logger.info(this.loggerTag, 'initialized', this) - this.emit('ready', {}) } async stop() {