This backwards compatible change allows users to seed the multiaddr set with known multiaddrs on PeerInfo creation. This prevents the need to do .add for known addresses.
const peerInfo = new PeerInfo(id)
knownAddrs.forEach((addr) => peerInfo.multiaddrs.add(addr))
and you can instead just do:
const peerInfo = new PeerInfo(id, knownAddrs)
Since the multiaddrs are verified as multiaddrs on creation you can also use an array of strings or buffers.
new PeerInfo(id, [
'/ip4/0.0.0.0/tcp/0',
'/ip4/0.0.0.0/tcp/0/ws'
])
Other things
Moved over to Travis CI. (I also disabled appveyor to avoid false ci failure checks from there)
Updated the badges in the readme to match style updates happening elsewhere in js-libp2p
This backwards compatible change allows users to seed the multiaddr set with known multiaddrs on PeerInfo creation. This prevents the need to do
.add
for known addresses.and you can instead just do:
Since the multiaddrs are verified as multiaddrs on creation you can also use an array of strings or buffers.
Other things