Skip to content

Commit 9ab2b5c

Browse files
committed
fix: increased connection limit on browser + UI updates (#35)
1 parent 4cd337a commit 9ab2b5c

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

packages/frontend/src/lib/libp2p.ts

+3-7
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { gossipsub } from '@chainsafe/libp2p-gossipsub'
1313
import { webSockets } from '@libp2p/websockets'
1414
import { webTransport } from '@libp2p/webtransport'
1515
import { webRTC, webRTCDirect } from '@libp2p/webrtc'
16-
import { CHAT_TOPIC, CIRCUIT_RELAY_CODE } from './constants'
16+
import { BOOTSTRAP_NODE, CHAT_TOPIC, CIRCUIT_RELAY_CODE } from './constants'
1717
import * as filters from "@libp2p/websockets/filters"
1818

1919
// @ts-ignore
@@ -45,18 +45,14 @@ export async function startLibp2p() {
4545
}),],
4646
connectionEncryption: [noise()],
4747
connectionManager: {
48-
maxConnections: 10,
48+
maxConnections: 100,
4949
minConnections: 1,
5050
},
5151
streamMuxers: [yamux()],
5252
peerDiscovery: [
5353
bootstrap({
54-
// #TODO: change to remote address
55-
// list: [
56-
// '/ip4/18.195.246.16/udp/9090/webrtc-direct/certhash/uEiBy_U1UNQ0IDvot_PKlQM_QeU3yx-zCAVaMxxVm2JxWBg/p2p/12D3KooWGTDZj1zAjMCJ8XXx9Z88zAAd6vn3krQYLwZ67S4vMUxz',
57-
// ],
5854
list: [
59-
'/ip4/127.0.0.1/udp/9090/webrtc-direct/certhash/uEiA2twAWww-g6fXsJe6JPlROwCHbRj6fNgr_WHxiQGEK3g/p2p/12D3KooWLTB1SrjyF8R5Z1MKErcV8abs26eo4LpadQKWsxMUcDBJ'
55+
BOOTSTRAP_NODE,
6056
],
6157
}),
6258
],

packages/frontend/src/pages/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export default function Home() {
102102
<>
103103
<h3 className="text-xl">
104104
{' '}
105-
Connected peers ({peerStats.peerIds.length}) 👇
105+
Connected peers ({getUniqueConnections(peerStats.connections).length}) 👇
106106
</h3>
107107
<pre className="px-2">
108108
{getUniqueConnections(peerStats.connections)

0 commit comments

Comments
 (0)