Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

fix: print peer id in swarm addresses on startup #2775

Merged
merged 1 commit into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions examples/custom-libp2p/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const libp2pBundle = (opts) => {
const bootstrapList = opts.config.Bootstrap

// Build and return our libp2p node
// n.b. for full configuration options, see https://github.com/libp2p/js-libp2p/blob/master/doc/CONFIGURATION.md
return new Libp2p({
peerInfo,
peerBook,
Expand Down Expand Up @@ -91,6 +92,17 @@ const libp2pBundle = (opts) => {
pubsub: {
enabled: true
}
},
metrics: {
enabled: true,
computeThrottleMaxQueueSize: 1000, // How many messages a stat will queue before processing
computeThrottleTimeout: 2000, // Time in milliseconds a stat will wait, after the last item was added, before processing
movingAverageIntervals: [ // The moving averages that will be computed
60 * 1000, // 1 minute
5 * 60 * 1000, // 5 minutes
15 * 60 * 1000 // 15 minutes
],
maxOldPeersRetention: 50 // How many disconnected peers we will retain stats for
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/components/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module.exports = ({

await libp2p.start()

peerInfo.multiaddrs.forEach(ma => print('Swarm listening on', ma.toString()))
peerInfo.multiaddrs.forEach(ma => print(`Swarm listening on ${ma}/p2p/${peerInfo.id.toB58String()}`))

const ipnsRouting = routingConfig({ libp2p, repo, peerInfo, options: constructorOptions })
const ipns = new IPNS(ipnsRouting, repo.datastore, peerInfo, keychain, { pass: initOptions.pass })
Expand Down