diff --git a/assets/search.js b/assets/search.js index 6ebdec65..d2d3032d 100644 --- a/assets/search.js +++ b/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA71b32/bOBL+X5xX1xv+lJO3vQIH9IBrF7fF3YMRFKqtNNq1JZ+ldK8X5H9fUqKoGZkjU3bWT47j+fgN55sZUpT0MjuUf1Sz+9XL7Pe82Mzu+XxWpLtsdj8zX7P/zeaz58PWfNuVm+dtVv3U/HfxVO+25qf1Nq2qzMBns9d5N4KWfojHQ7n7WG6ynzebQ1ZVfrDH52Jd52XRDTewCww/n+3TQ1bU3q8gX159tH9QNO3PF4z+z+dtnafGyREKb3M2z+4ki7d4x6axcKU9zS+Hsi7X5daz5EWdHR7TtVe5s5jGwW55P5e1UTWS4MbZjrB4AEVX5f+PpnO2l9AVMNtO0DnbS+hMbZTb7+nXbTQpQlxCvU/rp1hSZzuRDqamr6FPX3/L1jVNPDC8IFEf012+/TGN6caDxuY6nAzhwFNZTZzojYO8AXl9SItqXx6megBxb+DGGR5cRA5zLrROHblw9iI1KdeGLHF5BidAEKdT53fTIy6kHpf2iDdC1jApv71LmOLHreRDsX/uPah/7I/zqjE5f0H9V9NsswM9zc5iIsdgSp+f92AFgDNpfrls8F/rQ158oynA7+dH6uevRt5P+2ZLQ0cLWl1QbVX+rUhHdjlHNDceMZZ+aA49teCD5To79FP8nh5yuxh31N7i/FAeb0npvnlBEL/+qLMRqTDFTWcd1ZXJNalscy2aFQCmEmulRB/TL19sxk/mXbS4d+I21oOFd5mMwT9+/fRxgifO/Mrzt6zd7LmeMPvGXXLuJzvEkSM94soR6PpHF4TlhCAcNxG8ctq9cnwQvPlVI9Cy+unHV4Bzd2zu781CP3H+HeT6MWiYuziw+FoAbo/Fwh5gTIxFB7l+LBpmH4v4kgBuU73B7j8mNIbO/LpdoWH1qwKPbwmtu9R+pt+BxUdgALpqHCC37xAyOhrIdSImWbFO99XzNq3j3cKYq0YEUHcBiY8H9JsIxyab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COFNVK0RgprpBqNgnWksEaK1kgNtghWCBmsI4U1UrRGCmukmk4XrCOFNVK0RgprpO7ItVBhjTStkcYaaSuEDNamxhppWiONNdJWCClCfmqskZa0JdZINxoFa1MPdnJWCBmsOI010o1G4V0f1kgvyRVOY420FUIG60hjjRIrhAxWR4I1ShqNgjmfYI0STqyvCVYosTKoYMYnWKHEyqCCeZxghZJmpx3MpKRVqLk4sacM2eZDe5FiLjO6k6+X2Rd35WJyzF0evczMynz/8jqfmdW0/ZTuU7vPZfspnZ10dtLZSWcnnZ1ydsrZKWennJ1ydtrZ6cbutb9Sst/s1FL7YFjZPYgCnOe981xS4O7UsMcxMGm2JHDuiSvApgAbhWqfuO9BusdoEgLOIXqkyUEPNZlHYt3lcQ80CdQDqaj4E0JAKICvwklyAl+XR2GSIEx6ZM4tPN8XGfYCRiw5Ba/c2SPAS4BXBB7dme2xAnBLihtgh2ILkFdmISfw7UnbwZ/KAd8BXlN4dJMdcIOwS2re3T0mQHnbwxQF6x6WBhUEKo+58mZUxOy7SPYmQagSwTAE+ltWt68/gLmC0lBiBJdlh3yDkEuApBjblwCAk6AwGEXX2gIUCOwthanA6R9wErRkEtkeKoHuBJoTCaqf8uIPew8iIIUEI2gqNEF/QcW5Ds+T9jOhXPHjPLoTYjAakCihIufxefsMOhALwPlJeOnehgF4mJJUGIbBB5zUwuDPVUGjBimSUEpThQNaFevWU6plDOuHAWJGxah9XwCAQINhypU8ydgepG7w0iBAbAXVLfb+JToQKVC1J2B4KQQ5nYwirRX2FUDF6DQxDIRWUIzwHbIeCpoaxefvk4NyATFVVExDiw0DfJxKdHA3CrQaUPDc5Z6m8r578h/AQX/jVIjaVwl7EFgZqUm2e4G6fc8C0IEAcarKABbLCXsbBa7L36qyQJygIQgqtnUZ2tICVQRNeLzv4aAhcCp/wMtlIBHAHBm13zsOK0h0TrX5QECB+DIYGXPhss/32TYvjNHq4fX1T6HUFAFRPQAA"; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4s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Syh4DaKfSFniBKuSEwgzcP4AgAUnWszzWgtkJTE6sU/4cRj/cbSmBQgMWdrWmmyDjhQVfpoJclv+ak+08VndUoDWAyHD9b/zD8usMAAvkhuQGvnGPq+/EgD9MSS63uoMPNLlpo7nZAT0FtWe41YErHDBViHqy5laJbv0IkJuCG6PySxrgBCZHYaqS5ya56ipni5cGBXQVhzZpPi8FSxoYqBNueCkEMA1HpvCMyje0IFbgqtiBrV5pgzIETBVXiPDrytYVeHLD2rzwAUkExlRzY0otNgLoSS7RwX046CMoeFnlnuFaqL+JAe5gfpMczvIj29YJTArcMlPuBfLyCyQgB0BKboCAL84COBdzJZrHX7M4QpogXMUVWB5TW1owlShuTKl9jwQTguTyB3x2CRIB4BRcph8PK8g7ySU6MaBgnVIkfHsCSMIk2IWRNbq7f339H1EJATxrMAAA"; \ No newline at end of file diff --git a/classes/index.MultiaddrFilter.html b/classes/index.MultiaddrFilter.html index 97f19ce5..636b3e1b 100644 --- a/classes/index.MultiaddrFilter.html +++ b/classes/index.MultiaddrFilter.html @@ -1,4 +1,4 @@ -
import { multiaddr } from '@multiformats/multiaddr'
const mh1 = multiaddr('/ip4/8.8.8.8/tcp/1080')
// Multiaddr(/ip4/8.8.8.8/tcp/1080)
const mh2 = multiaddr('/ip4/127.0.0.1/tcp/4001')
// Multiaddr(/ip4/127.0.0.1/tcp/4001)
const mh3 = mh1.encapsulate(mh2)
// Multiaddr(/ip4/8.8.8.8/tcp/1080/ip4/127.0.0.1/tcp/4001)
mh3.decapsulate(mh2).toString()
// '/ip4/8.8.8.8/tcp/1080'
-A more reliable version of decapsulate
if you are targeting a
specific code, such as 421 (the p2p
protocol code). The last index of the code
@@ -106,18 +101,13 @@
import { multiaddr } from '@multiformats/multiaddr'
const addr = multiaddr('/ip4/0.0.0.0/tcp/8080/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC')
// Multiaddr(/ip4/0.0.0.0/tcp/8080/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC)
addr.decapsulateCode(421).toString()
// '/ip4/0.0.0.0/tcp/8080'
multiaddr('/ip4/127.0.0.1/tcp/8080').decapsulateCode(421).toString()
// '/ip4/127.0.0.1/tcp/8080'
-Encapsulates a Multiaddr in another Multiaddr
import { multiaddr } from '@multiformats/multiaddr'
const mh1 = multiaddr('/ip4/8.8.8.8/tcp/1080')
// Multiaddr(/ip4/8.8.8.8/tcp/1080)
const mh2 = multiaddr('/ip4/127.0.0.1/tcp/4001')
// Multiaddr(/ip4/127.0.0.1/tcp/4001)
const mh3 = mh1.encapsulate(mh2)
// Multiaddr(/ip4/8.8.8.8/tcp/1080/ip4/127.0.0.1/tcp/4001)
mh3.toString()
// '/ip4/8.8.8.8/tcp/1080/ip4/127.0.0.1/tcp/4001'
-Checks if two Multiaddrs are the same
import { multiaddr } from '@multiformats/multiaddr'
const mh1 = multiaddr('/ip4/8.8.8.8/tcp/1080')
// Multiaddr(/ip4/8.8.8.8/tcp/1080)
const mh2 = multiaddr('/ip4/127.0.0.1/tcp/4001')
// Multiaddr(/ip4/127.0.0.1/tcp/4001)
mh1.equals(mh1)
// true
mh1.equals(mh2)
// false
-Extract the path if the multiaddr contains one
import { multiaddr } from '@multiformats/multiaddr'
const mh1 = multiaddr('/ip4/8.8.8.8/tcp/1080/unix/tmp/p2p.sock')
// Multiaddr(/ip4/8.8.8.8/tcp/1080/unix/tmp/p2p.sock)
// should return utf8 string or null if the id is missing or invalid
const path = mh1.getPath()
-Extract the peerId if the multiaddr contains one
import { multiaddr } from '@multiformats/multiaddr'
const mh1 = multiaddr('/ip4/8.8.8.8/tcp/1080/ipfs/QmValidBase58string')
// Multiaddr(/ip4/8.8.8.8/tcp/1080/ipfs/QmValidBase58string)
// should return QmValidBase58string or null if the id is missing or invalid
const peerId = mh1.getPeerId()
-Returns if a Multiaddr is a Thin Waist address or not.
Thin Waist is if a Multiaddr adheres to the standard combination of:
@@ -224,18 +194,13 @@import { multiaddr } from '@multiformats/multiaddr'
const mh1 = multiaddr('/ip4/127.0.0.1/tcp/4001')
// Multiaddr(/ip4/127.0.0.1/tcp/4001)
const mh2 = multiaddr('/ip4/192.168.2.1/tcp/5001')
// Multiaddr(/ip4/192.168.2.1/tcp/5001)
const mh3 = mh1.encapsulate(mh2)
// Multiaddr(/ip4/127.0.0.1/tcp/4001/ip4/192.168.2.1/tcp/5001)
const mh4 = multiaddr('/ip4/127.0.0.1/tcp/2000/wss/p2p-webrtc-star/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSooo2a')
// Multiaddr(/ip4/127.0.0.1/tcp/2000/wss/p2p-webrtc-star/p2p/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSooo2a)
mh1.isThinWaistAddress()
// true
mh2.isThinWaistAddress()
// true
mh3.isThinWaistAddress()
// false
mh4.isThinWaistAddress()
// false
-Gets a Multiaddrs node-friendly address object. Note that protocol information is left out: in Node (and most network systems) the protocol is unknowable @@ -246,18 +211,13 @@
import { multiaddr } from '@multiformats/multiaddr'
multiaddr('/ip4/127.0.0.1/tcp/4001').nodeAddress()
// {family: 4, address: '127.0.0.1', port: 4001}
-Returns the codes of the protocols in left-to-right order. See list of protocols
@@ -266,18 +226,13 @@import { multiaddr } from '@multiformats/multiaddr'
multiaddr('/ip4/127.0.0.1/tcp/4001').protoCodes()
// [ 4, 6 ]
-Returns the names of the protocols in left-to-right order. See list of protocols
@@ -286,18 +241,13 @@import { multiaddr } from '@multiformats/multiaddr'
multiaddr('/ip4/127.0.0.1/tcp/4001').protoNames()
// [ 'ip4', 'tcp' ]
-Returns the protocols the Multiaddr is defined with, as an array of objects, in left-to-right order. Each object contains the protocol code, protocol name, @@ -308,18 +258,13 @@
import { multiaddr } from '@multiformats/multiaddr'
multiaddr('/ip4/127.0.0.1/tcp/4001').protos()
// [ { code: 4, size: 32, name: 'ip4' },
// { code: 6, size: 16, name: 'tcp' } ]
-Resolve multiaddr if containing resolvable hostname.
import { multiaddr, resolvers } from '@multiformats/multiaddr'
resolvers.set('dnsaddr', resolverFunction)
const mh1 = multiaddr('/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb')
const resolvedMultiaddrs = await mh1.resolve()
// [
// Multiaddr(/ip4/147.75.83.83/tcp/4001/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb),
// Multiaddr(/ip4/147.75.83.83/tcp/443/wss/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb),
// Multiaddr(/ip4/147.75.83.83/udp/4001/quic/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb)
// ]
-Returns a tuple of string/number parts
Returns Multiaddr as a convinient options object to be used with net.createConnection
import { multiaddr } from '@multiformats/multiaddr'
multiaddr('/ip4/127.0.0.1/tcp/4001').toOptions()
// { family: 4, host: '127.0.0.1', transport: 'tcp', port: 4001 }
-Returns a tuple of parts
import { multiaddr } from '@multiformats/multiaddr'
multiaddr('/ip4/127.0.0.1/tcp/4001').tuples()
// [ [ 4, <Buffer 7f 00 00 01> ], [ 6, <Buffer 0f a1> ] ]
-
Decapsulates a Multiaddr from another Multiaddr