Skip to content

Commit

Permalink
Change listen address to loopback and remove bootstrap nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
chiro-hiro committed Aug 3, 2023
1 parent 4aca198 commit 94b9ec9
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions zkdb/src/storage-engine/ipfs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { PeerId } from '@libp2p/interface-peer-id';
import { IPNSEntry } from 'ipns';
import fs from 'fs';
import { Binary } from '../utilities/binary.js';
import { multiaddr } from '@multiformats/multiaddr';
import { StorageEngineBase } from './base.js';
import { identifyService } from 'libp2p/identify';

Expand Down Expand Up @@ -106,7 +105,7 @@ export const newLibP2p = async (
},
start: true,
addresses: {
listen: ['/ip4/0.0.0.0/tcp/0'],
listen: ['/ip4/127.0.0.1/tcp/0'],
},
peerRouters: [delegatedPeerRouting(client)],
connectionEncryption: [noise()],
Expand All @@ -132,16 +131,6 @@ export const newLibP2p = async (

// Start libp2p node
const nodeP2p = await createLibp2p(config);
const addresses = [
'/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN',
'/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa',
'/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb',
'/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt',
].map((e) => multiaddr(e));
// Dial to bootstrap nodes
for (let i = 0; i < addresses.length; i += 1) {
await nodeP2p.dial(addresses[i]);
}

await nodeP2p.start();
return nodeP2p;
Expand Down

0 comments on commit 94b9ec9

Please sign in to comment.