Changelog
9.0.0 (2021-04-08)
// before
const multiaddr = require('multiaddr')
multiaddr.resolvers
multiaddr.protocols
// after
const {multiaddr , Multiaddr, protocols, resolvers} = = require('multiaddr')
Multiaddr.resolvers
Multiaddr.protocols
toOptions
output changed to match node// before
multiaddr('/ip4/127.0.0.1/tcp/4001').toOptions()
{ family: 'ipv4', host: '127.0.0.1', transport: 'tcp', port: 4001 }
// after
new Multiaddr('/ip4/127.0.0.1/tcp/4001').toOptions()
{ family: 4, host: '127.0.0.1', transport: 'tcp', port: 4001 }
fromNodeAddress
and nodeAddress
inputs/outputs now match// before the family type was not the same between them
multiaddr('/ip4/127.0.0.1/tcp/4001').nodeAddress()
{family: 4, address: '127.0.0.1', port: '4001'}
multiaddr.fromNodeAddress({family: 'IPv4', address: '127.0.0.1', port: '4001'}, 'tcp')
<Multiaddr 047f000001060fa1 - /ip4/127.0.0.1/tcp/4001>
// after
new Multiaddr('/ip4/127.0.0.1/tcp/4001').nodeAddress()
{family: 4, address: '127.0.0.1', port: 4001}
Multiaddr.fromNodeAddress({family: 4, address: '127.0.0.1', port: '4001'}, 'tcp')
<Multiaddr 047f000001060fa1 - /ip4/127.0.0.1/tcp/4001>