libp2p 0.36.2 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +3 -21
- package/README.md +13 -10
- package/dist/src/address-manager/index.d.ts +34 -52
- package/dist/src/address-manager/index.d.ts.map +1 -1
- package/dist/src/address-manager/index.js +81 -0
- package/dist/src/address-manager/index.js.map +1 -0
- package/dist/src/circuit/auto-relay.d.ts +24 -85
- package/dist/src/circuit/auto-relay.d.ts.map +1 -1
- package/dist/src/circuit/auto-relay.js +216 -0
- package/dist/src/circuit/auto-relay.js.map +1 -0
- package/dist/src/circuit/circuit/hop.d.ts +26 -53
- package/dist/src/circuit/circuit/hop.d.ts.map +1 -1
- package/dist/src/circuit/circuit/hop.js +138 -0
- package/dist/src/circuit/circuit/hop.js.map +1 -0
- package/dist/src/circuit/circuit/stop.d.ts +18 -10
- package/dist/src/circuit/circuit/stop.d.ts.map +1 -1
- package/dist/src/circuit/circuit/stop.js +49 -0
- package/dist/src/circuit/circuit/stop.js.map +1 -0
- package/dist/src/circuit/circuit/stream-handler.d.ts +19 -38
- package/dist/src/circuit/circuit/stream-handler.d.ts.map +1 -1
- package/dist/src/circuit/circuit/stream-handler.js +59 -0
- package/dist/src/circuit/circuit/stream-handler.js.map +1 -0
- package/dist/src/circuit/circuit/utils.d.ts +3 -6
- package/dist/src/circuit/circuit/utils.d.ts.map +1 -1
- package/dist/src/circuit/circuit/utils.js +43 -0
- package/dist/src/circuit/circuit/utils.js.map +1 -0
- package/dist/src/circuit/constants.d.ts +24 -6
- package/dist/src/circuit/constants.d.ts.map +1 -1
- package/dist/src/circuit/constants.js +26 -0
- package/dist/src/circuit/constants.js.map +1 -0
- package/dist/src/circuit/index.d.ts +41 -74
- package/dist/src/circuit/index.d.ts.map +1 -1
- package/dist/src/circuit/index.js +69 -0
- package/dist/src/circuit/index.js.map +1 -0
- package/dist/src/circuit/listener.d.ts +8 -3
- package/dist/src/circuit/listener.d.ts.map +1 -1
- package/dist/src/circuit/listener.js +62 -0
- package/dist/src/circuit/listener.js.map +1 -0
- package/dist/src/circuit/multicodec.d.ts +1 -1
- package/dist/src/circuit/multicodec.d.ts.map +1 -1
- package/dist/src/circuit/multicodec.js +2 -0
- package/dist/src/circuit/multicodec.js.map +1 -0
- package/dist/src/circuit/pb/index.d.ts +52 -0
- package/dist/src/circuit/pb/index.d.ts.map +1 -0
- package/dist/src/circuit/pb/index.js +98 -0
- package/dist/src/circuit/pb/index.js.map +1 -0
- package/dist/src/circuit/transport.d.ts +18 -78
- package/dist/src/circuit/transport.d.ts.map +1 -1
- package/dist/src/circuit/transport.js +192 -0
- package/dist/src/circuit/transport.js.map +1 -0
- package/dist/src/circuit/utils.d.ts +5 -2
- package/dist/src/circuit/utils.d.ts.map +1 -1
- package/dist/src/circuit/utils.js +11 -0
- package/dist/src/circuit/utils.js.map +1 -0
- package/dist/src/config.d.ts +3 -85
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +91 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/connection-manager/auto-dialler.d.ts +24 -41
- package/dist/src/connection-manager/auto-dialler.d.ts.map +1 -1
- package/dist/src/connection-manager/auto-dialler.js +105 -0
- package/dist/src/connection-manager/auto-dialler.js.map +1 -0
- package/dist/src/connection-manager/dialer/auto-dialer.d.ts +16 -0
- package/dist/src/connection-manager/dialer/auto-dialer.d.ts.map +1 -0
- package/dist/src/connection-manager/dialer/auto-dialer.js +37 -0
- package/dist/src/connection-manager/dialer/auto-dialer.js.map +1 -0
- package/dist/src/connection-manager/dialer/dial-request.d.ts +27 -0
- package/dist/src/connection-manager/dialer/dial-request.d.ts.map +1 -0
- package/dist/src/connection-manager/dialer/dial-request.js +83 -0
- package/dist/src/connection-manager/dialer/dial-request.js.map +1 -0
- package/dist/src/connection-manager/dialer/index.d.ts +104 -0
- package/dist/src/connection-manager/dialer/index.d.ts.map +1 -0
- package/dist/src/connection-manager/dialer/index.js +267 -0
- package/dist/src/connection-manager/dialer/index.js.map +1 -0
- package/dist/src/connection-manager/index.d.ts +102 -136
- package/dist/src/connection-manager/index.d.ts.map +1 -1
- package/dist/src/connection-manager/index.js +333 -0
- package/dist/src/connection-manager/index.js.map +1 -0
- package/dist/src/connection-manager/latency-monitor.d.ts +72 -97
- package/dist/src/connection-manager/latency-monitor.d.ts.map +1 -1
- package/dist/src/connection-manager/latency-monitor.js +220 -0
- package/dist/src/connection-manager/latency-monitor.js.map +1 -0
- package/dist/src/connection-manager/visibility-change-emitter.d.ts +15 -16
- package/dist/src/connection-manager/visibility-change-emitter.d.ts.map +1 -1
- package/dist/src/connection-manager/visibility-change-emitter.js +118 -0
- package/dist/src/connection-manager/visibility-change-emitter.js.map +1 -0
- package/dist/src/constants.d.ts +22 -10
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +27 -0
- package/dist/src/constants.js.map +1 -0
- package/dist/src/content-routing/index.d.ts +27 -81
- package/dist/src/content-routing/index.d.ts.map +1 -1
- package/dist/src/content-routing/index.js +99 -0
- package/dist/src/content-routing/index.js.map +1 -0
- package/dist/src/content-routing/utils.d.ts +6 -49
- package/dist/src/content-routing/utils.d.ts.map +1 -1
- package/dist/src/content-routing/utils.js +42 -0
- package/dist/src/content-routing/utils.js.map +1 -0
- package/dist/src/dht/dht-content-routing.d.ts +10 -24
- package/dist/src/dht/dht-content-routing.d.ts.map +1 -1
- package/dist/src/dht/dht-content-routing.js +32 -0
- package/dist/src/dht/dht-content-routing.js.map +1 -0
- package/dist/src/dht/dht-peer-routing.d.ts +9 -24
- package/dist/src/dht/dht-peer-routing.d.ts.map +1 -1
- package/dist/src/dht/dht-peer-routing.js +26 -0
- package/dist/src/dht/dht-peer-routing.js.map +1 -0
- package/dist/src/dht/dummy-dht.d.ts +20 -0
- package/dist/src/dht/dummy-dht.d.ts.map +1 -0
- package/dist/src/dht/dummy-dht.js +46 -0
- package/dist/src/dht/dummy-dht.js.map +1 -0
- package/dist/src/errors.d.ts +70 -63
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +75 -0
- package/dist/src/errors.js.map +1 -0
- package/dist/src/fetch/constants.d.ts +1 -1
- package/dist/src/fetch/constants.d.ts.map +1 -1
- package/dist/src/fetch/constants.js +3 -0
- package/dist/src/fetch/constants.js.map +1 -0
- package/dist/src/fetch/index.d.ts +30 -49
- package/dist/src/fetch/index.d.ts.map +1 -1
- package/dist/src/fetch/index.js +129 -0
- package/dist/src/fetch/index.js.map +1 -0
- package/dist/src/fetch/pb/proto.d.ts +27 -0
- package/dist/src/fetch/pb/proto.d.ts.map +1 -0
- package/dist/src/fetch/pb/proto.js +50 -0
- package/dist/src/fetch/pb/proto.js.map +1 -0
- package/dist/src/get-peer.d.ts +4 -11
- package/dist/src/get-peer.d.ts.map +1 -1
- package/dist/src/get-peer.js +43 -0
- package/dist/src/get-peer.js.map +1 -0
- package/dist/src/identify/consts.d.ts +9 -9
- package/dist/src/identify/consts.d.ts.map +1 -1
- package/dist/src/identify/consts.js +11 -0
- package/dist/src/identify/consts.js.map +1 -0
- package/dist/src/identify/index.d.ts +42 -96
- package/dist/src/identify/index.d.ts.map +1 -1
- package/dist/src/identify/index.js +322 -0
- package/dist/src/identify/index.js.map +1 -0
- package/dist/src/identify/pb/message.d.ts +16 -0
- package/dist/src/identify/pb/message.d.ts.map +1 -0
- package/dist/src/identify/pb/message.js +24 -0
- package/dist/src/identify/pb/message.js.map +1 -0
- package/dist/src/index.d.ts +150 -496
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +9 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/insecure/index.d.ts +9 -0
- package/dist/src/insecure/index.d.ts.map +1 -0
- package/dist/src/insecure/index.js +81 -0
- package/dist/src/insecure/index.js.map +1 -0
- package/dist/src/insecure/pb/proto.d.ts +29 -0
- package/dist/src/insecure/pb/proto.d.ts.map +1 -0
- package/dist/src/insecure/pb/proto.js +53 -0
- package/dist/src/insecure/pb/proto.js.map +1 -0
- package/dist/src/keychain/cms.d.ts +6 -14
- package/dist/src/keychain/cms.d.ts.map +1 -1
- package/dist/src/keychain/cms.js +129 -0
- package/dist/src/keychain/cms.js.map +1 -0
- package/dist/src/keychain/index.d.ts +60 -81
- package/dist/src/keychain/index.d.ts.map +1 -1
- package/dist/src/keychain/index.js +492 -0
- package/dist/src/keychain/index.js.map +1 -0
- package/dist/src/keychain/util.d.ts +3 -6
- package/dist/src/keychain/util.d.ts.map +1 -1
- package/dist/src/keychain/util.js +79 -0
- package/dist/src/keychain/util.js.map +1 -0
- package/dist/src/libp2p.d.ts +80 -0
- package/dist/src/libp2p.d.ts.map +1 -0
- package/dist/src/libp2p.js +397 -0
- package/dist/src/libp2p.js.map +1 -0
- package/dist/src/metrics/index.d.ts +47 -104
- package/dist/src/metrics/index.d.ts.map +1 -1
- package/dist/src/metrics/index.js +231 -0
- package/dist/src/metrics/index.js.map +1 -0
- package/dist/src/metrics/moving-average.d.ts +14 -0
- package/dist/src/metrics/moving-average.d.ts.map +1 -0
- package/dist/src/metrics/moving-average.js +40 -0
- package/dist/src/metrics/moving-average.js.map +1 -0
- package/dist/src/metrics/stats.d.ts +41 -93
- package/dist/src/metrics/stats.d.ts.map +1 -1
- package/dist/src/metrics/stats.js +183 -0
- package/dist/src/metrics/stats.js.map +1 -0
- package/dist/src/nat-manager.d.ts +42 -99
- package/dist/src/nat-manager.d.ts.map +1 -1
- package/dist/src/nat-manager.js +114 -0
- package/dist/src/nat-manager.js.map +1 -0
- package/dist/src/peer-record-updater.d.ts +15 -0
- package/dist/src/peer-record-updater.d.ts.map +1 -0
- package/dist/src/peer-record-updater.js +44 -0
- package/dist/src/peer-record-updater.js.map +1 -0
- package/dist/src/peer-routing.d.ts +40 -84
- package/dist/src/peer-routing.d.ts.map +1 -1
- package/dist/src/peer-routing.js +108 -0
- package/dist/src/peer-routing.js.map +1 -0
- package/dist/src/ping/constants.d.ts +4 -4
- package/dist/src/ping/constants.d.ts.map +1 -1
- package/dist/src/ping/constants.js +5 -0
- package/dist/src/ping/constants.js.map +1 -0
- package/dist/src/ping/index.d.ts +17 -31
- package/dist/src/ping/index.d.ts.map +1 -1
- package/dist/src/ping/index.js +57 -0
- package/dist/src/ping/index.js.map +1 -0
- package/dist/src/pnet/crypto.d.ts +15 -5
- package/dist/src/pnet/crypto.d.ts.map +1 -1
- package/dist/src/pnet/crypto.js +60 -0
- package/dist/src/pnet/crypto.js.map +1 -0
- package/dist/src/pnet/errors.d.ts +5 -5
- package/dist/src/pnet/errors.d.ts.map +1 -1
- package/dist/src/pnet/errors.js +6 -0
- package/dist/src/pnet/errors.js.map +1 -0
- package/dist/src/pnet/index.d.ts +12 -20
- package/dist/src/pnet/index.d.ts.map +1 -1
- package/dist/src/pnet/index.js +67 -0
- package/dist/src/pnet/index.js.map +1 -0
- package/dist/src/pnet/key-generator.d.ts +3 -7
- package/dist/src/pnet/key-generator.d.ts.map +1 -1
- package/dist/src/pnet/key-generator.js +25 -0
- package/dist/src/pnet/key-generator.js.map +1 -0
- package/dist/src/pubsub/dummy-pubsub.d.ts +17 -0
- package/dist/src/pubsub/dummy-pubsub.d.ts.map +1 -0
- package/dist/src/pubsub/dummy-pubsub.js +37 -0
- package/dist/src/pubsub/dummy-pubsub.js.map +1 -0
- package/dist/src/registrar.d.ts +26 -65
- package/dist/src/registrar.d.ts.map +1 -1
- package/dist/src/registrar.js +144 -0
- package/dist/src/registrar.js.map +1 -0
- package/dist/src/transport-manager.d.ts +36 -82
- package/dist/src/transport-manager.d.ts.map +1 -1
- package/dist/src/transport-manager.js +223 -0
- package/dist/src/transport-manager.js.map +1 -0
- package/dist/src/upgrader.d.ts +49 -129
- package/dist/src/upgrader.d.ts.map +1 -1
- package/dist/src/upgrader.js +402 -0
- package/dist/src/upgrader.js.map +1 -0
- package/dist/src/version.d.ts +3 -0
- package/dist/src/version.d.ts.map +1 -0
- package/dist/src/version.js +3 -0
- package/dist/src/version.js.map +1 -0
- package/package.json +144 -201
- package/src/address-manager/index.ts +130 -0
- package/src/circuit/README.md +16 -11
- package/src/circuit/auto-relay.ts +286 -0
- package/src/circuit/circuit/hop.ts +211 -0
- package/src/circuit/circuit/stop.ts +78 -0
- package/src/circuit/circuit/stream-handler.ts +86 -0
- package/src/circuit/circuit/{utils.js → utils.ts} +9 -25
- package/src/circuit/constants.ts +31 -0
- package/src/circuit/index.ts +120 -0
- package/src/circuit/listener.ts +82 -0
- package/src/circuit/multicodec.ts +2 -0
- package/src/circuit/{protocol → pb}/index.proto +1 -1
- package/src/circuit/pb/index.ts +117 -0
- package/src/circuit/transport.ts +219 -0
- package/src/circuit/utils.ts +12 -0
- package/src/config.ts +99 -0
- package/src/connection-manager/auto-dialler.ts +154 -0
- package/src/connection-manager/dialer/auto-dialer.ts +59 -0
- package/src/{dialer/dial-request.js → connection-manager/dialer/dial-request.ts} +60 -51
- package/src/connection-manager/dialer/index.ts +382 -0
- package/src/connection-manager/index.ts +508 -0
- package/src/connection-manager/latency-monitor.ts +319 -0
- package/src/connection-manager/{visibility-change-emitter.js → visibility-change-emitter.ts} +48 -38
- package/src/constants.ts +31 -0
- package/src/content-routing/index.ts +144 -0
- package/src/content-routing/utils.ts +54 -0
- package/src/dht/dht-content-routing.ts +43 -0
- package/src/dht/dht-peer-routing.ts +35 -0
- package/src/dht/dummy-dht.ts +60 -0
- package/src/errors.ts +73 -0
- package/src/fetch/README.md +1 -1
- package/src/fetch/constants.ts +3 -0
- package/src/fetch/index.ts +167 -0
- package/src/fetch/{proto.proto → pb/proto.proto} +0 -0
- package/src/fetch/pb/proto.ts +65 -0
- package/src/get-peer.ts +57 -0
- package/src/identify/consts.ts +13 -0
- package/src/identify/index.ts +445 -0
- package/src/identify/{message.proto → pb/message.proto} +0 -0
- package/src/identify/pb/message.ts +37 -0
- package/src/index.ts +220 -0
- package/src/insecure/index.ts +101 -0
- package/src/insecure/{proto.proto → pb/proto.proto} +0 -0
- package/src/insecure/pb/proto.ts +68 -0
- package/src/keychain/{cms.js → cms.ts} +62 -58
- package/src/keychain/index.ts +587 -0
- package/src/keychain/{util.js → util.ts} +7 -17
- package/src/libp2p.ts +538 -0
- package/src/metrics/index.ts +310 -0
- package/src/metrics/moving-average.ts +53 -0
- package/src/metrics/stats.ts +238 -0
- package/src/nat-manager.ts +194 -0
- package/src/peer-record-updater.ts +55 -0
- package/src/peer-routing.ts +186 -0
- package/src/ping/README.md +1 -1
- package/src/ping/constants.ts +5 -0
- package/src/ping/index.ts +84 -0
- package/src/pnet/README.md +2 -2
- package/src/pnet/crypto.ts +67 -0
- package/src/pnet/errors.ts +5 -0
- package/src/pnet/index.ts +97 -0
- package/src/pnet/key-generator.ts +28 -0
- package/src/pubsub/dummy-pubsub.ts +51 -0
- package/src/registrar.ts +189 -0
- package/src/transport-manager.ts +281 -0
- package/src/upgrader.ts +499 -0
- package/src/version.ts +3 -0
- package/dist/index.min.js +0 -55
- package/dist/src/circuit/protocol/index.d.ts +0 -173
- package/dist/src/dialer/dial-request.d.ts +0 -55
- package/dist/src/dialer/dial-request.d.ts.map +0 -1
- package/dist/src/dialer/index.d.ts +0 -182
- package/dist/src/dialer/index.d.ts.map +0 -1
- package/dist/src/fetch/proto.d.ts +0 -134
- package/dist/src/identify/message.d.ts +0 -95
- package/dist/src/insecure/plaintext.d.ts +0 -12
- package/dist/src/insecure/plaintext.d.ts.map +0 -1
- package/dist/src/insecure/proto.d.ts +0 -128
- package/dist/src/metrics/old-peers.d.ts +0 -3
- package/dist/src/metrics/old-peers.d.ts.map +0 -1
- package/dist/src/metrics/tracked-map.d.ts +0 -8
- package/dist/src/metrics/tracked-map.d.ts.map +0 -1
- package/dist/src/peer-store/address-book.d.ts +0 -67
- package/dist/src/peer-store/address-book.d.ts.map +0 -1
- package/dist/src/peer-store/index.d.ts +0 -58
- package/dist/src/peer-store/index.d.ts.map +0 -1
- package/dist/src/peer-store/key-book.d.ts +0 -40
- package/dist/src/peer-store/key-book.d.ts.map +0 -1
- package/dist/src/peer-store/metadata-book.d.ts +0 -58
- package/dist/src/peer-store/metadata-book.d.ts.map +0 -1
- package/dist/src/peer-store/pb/peer.d.ts +0 -222
- package/dist/src/peer-store/proto-book.d.ts +0 -43
- package/dist/src/peer-store/proto-book.d.ts.map +0 -1
- package/dist/src/peer-store/store.d.ts +0 -73
- package/dist/src/peer-store/store.d.ts.map +0 -1
- package/dist/src/peer-store/types.d.ts +0 -202
- package/dist/src/peer-store/types.d.ts.map +0 -1
- package/dist/src/ping/util.d.ts +0 -5
- package/dist/src/ping/util.d.ts.map +0 -1
- package/dist/src/pubsub-adapter.d.ts +0 -22
- package/dist/src/pubsub-adapter.d.ts.map +0 -1
- package/dist/src/record/envelope/envelope.d.ts +0 -77
- package/dist/src/record/envelope/index.d.ts +0 -80
- package/dist/src/record/envelope/index.d.ts.map +0 -1
- package/dist/src/record/peer-record/consts.d.ts +0 -4
- package/dist/src/record/peer-record/consts.d.ts.map +0 -1
- package/dist/src/record/peer-record/index.d.ts +0 -60
- package/dist/src/record/peer-record/index.d.ts.map +0 -1
- package/dist/src/record/peer-record/peer-record.d.ts +0 -133
- package/dist/src/record/utils.d.ts +0 -12
- package/dist/src/record/utils.d.ts.map +0 -1
- package/dist/src/types.d.ts +0 -90
- package/dist/src/types.d.ts.map +0 -1
- package/src/address-manager/index.js +0 -96
- package/src/circuit/auto-relay.js +0 -302
- package/src/circuit/circuit/hop.js +0 -205
- package/src/circuit/circuit/stop.js +0 -81
- package/src/circuit/circuit/stream-handler.js +0 -94
- package/src/circuit/constants.js +0 -12
- package/src/circuit/index.js +0 -102
- package/src/circuit/listener.js +0 -75
- package/src/circuit/multicodec.js +0 -5
- package/src/circuit/protocol/index.d.ts +0 -173
- package/src/circuit/protocol/index.js +0 -530
- package/src/circuit/transport.js +0 -229
- package/src/circuit/utils.js +0 -17
- package/src/config.js +0 -114
- package/src/connection-manager/auto-dialler.js +0 -132
- package/src/connection-manager/index.js +0 -374
- package/src/connection-manager/latency-monitor.js +0 -264
- package/src/constants.js +0 -18
- package/src/content-routing/index.js +0 -163
- package/src/content-routing/utils.js +0 -89
- package/src/dht/dht-content-routing.js +0 -44
- package/src/dht/dht-peer-routing.js +0 -51
- package/src/dialer/index.js +0 -376
- package/src/errors.js +0 -66
- package/src/fetch/constants.js +0 -6
- package/src/fetch/index.js +0 -159
- package/src/fetch/proto.d.ts +0 -134
- package/src/fetch/proto.js +0 -333
- package/src/get-peer.js +0 -49
- package/src/identify/consts.js +0 -15
- package/src/identify/index.js +0 -384
- package/src/identify/message.d.ts +0 -95
- package/src/identify/message.js +0 -328
- package/src/index.js +0 -813
- package/src/insecure/plaintext.js +0 -95
- package/src/insecure/proto.d.ts +0 -128
- package/src/insecure/proto.js +0 -371
- package/src/keychain/index.js +0 -561
- package/src/metrics/index.js +0 -290
- package/src/metrics/old-peers.js +0 -16
- package/src/metrics/stats.js +0 -270
- package/src/metrics/tracked-map.js +0 -94
- package/src/nat-manager.js +0 -197
- package/src/peer-routing.js +0 -176
- package/src/peer-store/README.md +0 -145
- package/src/peer-store/address-book.js +0 -382
- package/src/peer-store/index.js +0 -121
- package/src/peer-store/key-book.js +0 -141
- package/src/peer-store/metadata-book.js +0 -250
- package/src/peer-store/pb/peer.d.ts +0 -222
- package/src/peer-store/pb/peer.js +0 -643
- package/src/peer-store/pb/peer.proto +0 -31
- package/src/peer-store/proto-book.js +0 -237
- package/src/peer-store/store.js +0 -263
- package/src/peer-store/types.ts +0 -245
- package/src/ping/constants.js +0 -8
- package/src/ping/index.js +0 -84
- package/src/ping/util.js +0 -18
- package/src/pnet/crypto.js +0 -84
- package/src/pnet/errors.js +0 -7
- package/src/pnet/index.js +0 -86
- package/src/pnet/key-generator.js +0 -33
- package/src/pubsub-adapter.js +0 -61
- package/src/record/README.md +0 -130
- package/src/record/envelope/envelope.d.ts +0 -77
- package/src/record/envelope/envelope.js +0 -243
- package/src/record/envelope/envelope.proto +0 -19
- package/src/record/envelope/index.js +0 -183
- package/src/record/peer-record/consts.js +0 -14
- package/src/record/peer-record/index.js +0 -113
- package/src/record/peer-record/peer-record.d.ts +0 -133
- package/src/record/peer-record/peer-record.js +0 -367
- package/src/record/peer-record/peer-record.proto +0 -18
- package/src/record/utils.js +0 -25
- package/src/registrar.js +0 -127
- package/src/transport-manager.js +0 -269
- package/src/types.ts +0 -98
- package/src/upgrader.js +0 -492
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import * as $protobuf from "protobufjs";
|
|
2
|
-
/** Properties of a CircuitRelay. */
|
|
3
|
-
export interface ICircuitRelay {
|
|
4
|
-
|
|
5
|
-
/** CircuitRelay type */
|
|
6
|
-
type?: (CircuitRelay.Type|null);
|
|
7
|
-
|
|
8
|
-
/** CircuitRelay srcPeer */
|
|
9
|
-
srcPeer?: (CircuitRelay.IPeer|null);
|
|
10
|
-
|
|
11
|
-
/** CircuitRelay dstPeer */
|
|
12
|
-
dstPeer?: (CircuitRelay.IPeer|null);
|
|
13
|
-
|
|
14
|
-
/** CircuitRelay code */
|
|
15
|
-
code?: (CircuitRelay.Status|null);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/** Represents a CircuitRelay. */
|
|
19
|
-
export class CircuitRelay implements ICircuitRelay {
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Constructs a new CircuitRelay.
|
|
23
|
-
* @param [p] Properties to set
|
|
24
|
-
*/
|
|
25
|
-
constructor(p?: ICircuitRelay);
|
|
26
|
-
|
|
27
|
-
/** CircuitRelay type. */
|
|
28
|
-
public type: CircuitRelay.Type;
|
|
29
|
-
|
|
30
|
-
/** CircuitRelay srcPeer. */
|
|
31
|
-
public srcPeer?: (CircuitRelay.IPeer|null);
|
|
32
|
-
|
|
33
|
-
/** CircuitRelay dstPeer. */
|
|
34
|
-
public dstPeer?: (CircuitRelay.IPeer|null);
|
|
35
|
-
|
|
36
|
-
/** CircuitRelay code. */
|
|
37
|
-
public code: CircuitRelay.Status;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Encodes the specified CircuitRelay message. Does not implicitly {@link CircuitRelay.verify|verify} messages.
|
|
41
|
-
* @param m CircuitRelay message or plain object to encode
|
|
42
|
-
* @param [w] Writer to encode to
|
|
43
|
-
* @returns Writer
|
|
44
|
-
*/
|
|
45
|
-
public static encode(m: ICircuitRelay, w?: $protobuf.Writer): $protobuf.Writer;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Decodes a CircuitRelay message from the specified reader or buffer.
|
|
49
|
-
* @param r Reader or buffer to decode from
|
|
50
|
-
* @param [l] Message length if known beforehand
|
|
51
|
-
* @returns CircuitRelay
|
|
52
|
-
* @throws {Error} If the payload is not a reader or valid buffer
|
|
53
|
-
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
54
|
-
*/
|
|
55
|
-
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): CircuitRelay;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Creates a CircuitRelay message from a plain object. Also converts values to their respective internal types.
|
|
59
|
-
* @param d Plain object
|
|
60
|
-
* @returns CircuitRelay
|
|
61
|
-
*/
|
|
62
|
-
public static fromObject(d: { [k: string]: any }): CircuitRelay;
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Creates a plain object from a CircuitRelay message. Also converts values to other types if specified.
|
|
66
|
-
* @param m CircuitRelay
|
|
67
|
-
* @param [o] Conversion options
|
|
68
|
-
* @returns Plain object
|
|
69
|
-
*/
|
|
70
|
-
public static toObject(m: CircuitRelay, o?: $protobuf.IConversionOptions): { [k: string]: any };
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Converts this CircuitRelay to JSON.
|
|
74
|
-
* @returns JSON object
|
|
75
|
-
*/
|
|
76
|
-
public toJSON(): { [k: string]: any };
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export namespace CircuitRelay {
|
|
80
|
-
|
|
81
|
-
/** Status enum. */
|
|
82
|
-
enum Status {
|
|
83
|
-
SUCCESS = 100,
|
|
84
|
-
HOP_SRC_ADDR_TOO_LONG = 220,
|
|
85
|
-
HOP_DST_ADDR_TOO_LONG = 221,
|
|
86
|
-
HOP_SRC_MULTIADDR_INVALID = 250,
|
|
87
|
-
HOP_DST_MULTIADDR_INVALID = 251,
|
|
88
|
-
HOP_NO_CONN_TO_DST = 260,
|
|
89
|
-
HOP_CANT_DIAL_DST = 261,
|
|
90
|
-
HOP_CANT_OPEN_DST_STREAM = 262,
|
|
91
|
-
HOP_CANT_SPEAK_RELAY = 270,
|
|
92
|
-
HOP_CANT_RELAY_TO_SELF = 280,
|
|
93
|
-
STOP_SRC_ADDR_TOO_LONG = 320,
|
|
94
|
-
STOP_DST_ADDR_TOO_LONG = 321,
|
|
95
|
-
STOP_SRC_MULTIADDR_INVALID = 350,
|
|
96
|
-
STOP_DST_MULTIADDR_INVALID = 351,
|
|
97
|
-
STOP_RELAY_REFUSED = 390,
|
|
98
|
-
MALFORMED_MESSAGE = 400
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/** Type enum. */
|
|
102
|
-
enum Type {
|
|
103
|
-
HOP = 1,
|
|
104
|
-
STOP = 2,
|
|
105
|
-
STATUS = 3,
|
|
106
|
-
CAN_HOP = 4
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/** Properties of a Peer. */
|
|
110
|
-
interface IPeer {
|
|
111
|
-
|
|
112
|
-
/** Peer id */
|
|
113
|
-
id: Uint8Array;
|
|
114
|
-
|
|
115
|
-
/** Peer addrs */
|
|
116
|
-
addrs?: (Uint8Array[]|null);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/** Represents a Peer. */
|
|
120
|
-
class Peer implements IPeer {
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Constructs a new Peer.
|
|
124
|
-
* @param [p] Properties to set
|
|
125
|
-
*/
|
|
126
|
-
constructor(p?: CircuitRelay.IPeer);
|
|
127
|
-
|
|
128
|
-
/** Peer id. */
|
|
129
|
-
public id: Uint8Array;
|
|
130
|
-
|
|
131
|
-
/** Peer addrs. */
|
|
132
|
-
public addrs: Uint8Array[];
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Encodes the specified Peer message. Does not implicitly {@link CircuitRelay.Peer.verify|verify} messages.
|
|
136
|
-
* @param m Peer message or plain object to encode
|
|
137
|
-
* @param [w] Writer to encode to
|
|
138
|
-
* @returns Writer
|
|
139
|
-
*/
|
|
140
|
-
public static encode(m: CircuitRelay.IPeer, w?: $protobuf.Writer): $protobuf.Writer;
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Decodes a Peer message from the specified reader or buffer.
|
|
144
|
-
* @param r Reader or buffer to decode from
|
|
145
|
-
* @param [l] Message length if known beforehand
|
|
146
|
-
* @returns Peer
|
|
147
|
-
* @throws {Error} If the payload is not a reader or valid buffer
|
|
148
|
-
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
149
|
-
*/
|
|
150
|
-
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): CircuitRelay.Peer;
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Creates a Peer message from a plain object. Also converts values to their respective internal types.
|
|
154
|
-
* @param d Plain object
|
|
155
|
-
* @returns Peer
|
|
156
|
-
*/
|
|
157
|
-
public static fromObject(d: { [k: string]: any }): CircuitRelay.Peer;
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Creates a plain object from a Peer message. Also converts values to other types if specified.
|
|
161
|
-
* @param m Peer
|
|
162
|
-
* @param [o] Conversion options
|
|
163
|
-
* @returns Plain object
|
|
164
|
-
*/
|
|
165
|
-
public static toObject(m: CircuitRelay.Peer, o?: $protobuf.IConversionOptions): { [k: string]: any };
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Converts this Peer to JSON.
|
|
169
|
-
* @returns JSON object
|
|
170
|
-
*/
|
|
171
|
-
public toJSON(): { [k: string]: any };
|
|
172
|
-
}
|
|
173
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
export = DialRequest;
|
|
2
|
-
/**
|
|
3
|
-
* @typedef {import('libp2p-interfaces/src/connection').Connection} Connection
|
|
4
|
-
* @typedef {import('./')} Dialer
|
|
5
|
-
* @typedef {import('multiaddr').Multiaddr} Multiaddr
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* @typedef {Object} DialOptions
|
|
9
|
-
* @property {AbortSignal} signal
|
|
10
|
-
*
|
|
11
|
-
* @typedef {Object} DialRequestOptions
|
|
12
|
-
* @property {Multiaddr[]} addrs
|
|
13
|
-
* @property {(m: Multiaddr, options: DialOptions) => Promise<Connection>} dialAction
|
|
14
|
-
* @property {Dialer} dialer
|
|
15
|
-
*/
|
|
16
|
-
declare class DialRequest {
|
|
17
|
-
/**
|
|
18
|
-
* Manages running the `dialAction` on multiple provided `addrs` in parallel
|
|
19
|
-
* up to a maximum determined by the number of tokens returned
|
|
20
|
-
* from `dialer.getTokens`. Once a DialRequest is created, it can be
|
|
21
|
-
* started using `DialRequest.run(options)`. Once a single dial has succeeded,
|
|
22
|
-
* all other dials in the request will be cancelled.
|
|
23
|
-
*
|
|
24
|
-
* @class
|
|
25
|
-
* @param {DialRequestOptions} options
|
|
26
|
-
*/
|
|
27
|
-
constructor({ addrs, dialAction, dialer }: DialRequestOptions);
|
|
28
|
-
addrs: import("multiaddr").Multiaddr[];
|
|
29
|
-
dialer: import("./");
|
|
30
|
-
dialAction: (m: Multiaddr, options: DialOptions) => Promise<Connection>;
|
|
31
|
-
/**
|
|
32
|
-
* @async
|
|
33
|
-
* @param {object} [options]
|
|
34
|
-
* @param {AbortSignal} [options.signal] - An AbortController signal
|
|
35
|
-
* @returns {Promise<Connection>}
|
|
36
|
-
*/
|
|
37
|
-
run(options?: {
|
|
38
|
-
signal?: AbortSignal | undefined;
|
|
39
|
-
} | undefined): Promise<Connection>;
|
|
40
|
-
}
|
|
41
|
-
declare namespace DialRequest {
|
|
42
|
-
export { Connection, Dialer, Multiaddr, DialOptions, DialRequestOptions };
|
|
43
|
-
}
|
|
44
|
-
type Connection = import("libp2p-interfaces/src/connection/connection");
|
|
45
|
-
type DialRequestOptions = {
|
|
46
|
-
addrs: Multiaddr[];
|
|
47
|
-
dialAction: (m: Multiaddr, options: DialOptions) => Promise<Connection>;
|
|
48
|
-
dialer: Dialer;
|
|
49
|
-
};
|
|
50
|
-
type Dialer = import('./');
|
|
51
|
-
type Multiaddr = import('multiaddr').Multiaddr;
|
|
52
|
-
type DialOptions = {
|
|
53
|
-
signal: AbortSignal;
|
|
54
|
-
};
|
|
55
|
-
//# sourceMappingURL=dial-request.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dial-request.d.ts","sourceRoot":"","sources":["../../../src/dialer/dial-request.js"],"names":[],"mappings":";AAWA;;;;GAIG;AAEH;;;;;;;;GAQG;AAEH;IACE;;;;;;;;;OASG;IACH,2CAFW,kBAAkB,EAU5B;IAHC,uCAAkB;IAClB,qBAAoB;IACpB,gBAtBc,SAAS,WAAW,WAAW,KAAK,QAAQ,UAAU,CAAC,CAsBzC;IAG9B;;;;;OAKG;IACH;;oBAFa,QAAQ,UAAU,CAAC,CA+C/B;CACF;;;;;;WA9Ea,SAAS,EAAE;oBACP,SAAS,WAAW,WAAW,KAAK,QAAQ,UAAU,CAAC;YAC3D,MAAM;;cAXP,OAAO,IAAI,CAAC;iBACZ,OAAO,WAAW,EAAE,SAAS;;YAK5B,WAAW"}
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
export = Dialer;
|
|
2
|
-
/**
|
|
3
|
-
* @typedef {import('libp2p-interfaces/src/connection').Connection} Connection
|
|
4
|
-
* @typedef {import('peer-id')} PeerId
|
|
5
|
-
* @typedef {import('../peer-store/types').PeerStore} PeerStore
|
|
6
|
-
* @typedef {import('../peer-store/types').Address} Address
|
|
7
|
-
* @typedef {import('../transport-manager')} TransportManager
|
|
8
|
-
* @typedef {import('../types').ConnectionGater} ConnectionGater
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* @typedef {Object} DialerProperties
|
|
12
|
-
* @property {PeerStore} peerStore
|
|
13
|
-
* @property {TransportManager} transportManager
|
|
14
|
-
* @property {ConnectionGater} connectionGater
|
|
15
|
-
*
|
|
16
|
-
* @typedef {(addr:Multiaddr) => Promise<string[]>} Resolver
|
|
17
|
-
*
|
|
18
|
-
* @typedef {Object} DialerOptions
|
|
19
|
-
* @property {(addresses: Address[]) => Address[]} [options.addressSorter = publicAddressesFirst] - Sort the known addresses of a peer before trying to dial.
|
|
20
|
-
* @property {number} [maxParallelDials = MAX_PARALLEL_DIALS] - Number of max concurrent dials.
|
|
21
|
-
* @property {number} [maxAddrsToDial = MAX_ADDRS_TO_DIAL] - Number of max addresses to dial for a given peer.
|
|
22
|
-
* @property {number} [maxDialsPerPeer = MAX_PER_PEER_DIALS] - Number of max concurrent dials per peer.
|
|
23
|
-
* @property {number} [dialTimeout = DIAL_TIMEOUT] - How long a dial attempt is allowed to take.
|
|
24
|
-
* @property {Record<string, Resolver>} [resolvers = {}] - multiaddr resolvers to use when dialing
|
|
25
|
-
* @property {import('../metrics')} [metrics]
|
|
26
|
-
*
|
|
27
|
-
* @typedef DialTarget
|
|
28
|
-
* @property {string} id
|
|
29
|
-
* @property {Multiaddr[]} addrs
|
|
30
|
-
*
|
|
31
|
-
* @typedef PendingDial
|
|
32
|
-
* @property {import('./dial-request')} dialRequest
|
|
33
|
-
* @property {import('timeout-abort-controller').TimeoutController} controller
|
|
34
|
-
* @property {Promise<Connection>} promise
|
|
35
|
-
* @property {function():void} destroy
|
|
36
|
-
*/
|
|
37
|
-
declare class Dialer {
|
|
38
|
-
/**
|
|
39
|
-
* @class
|
|
40
|
-
* @param {DialerProperties & DialerOptions} options
|
|
41
|
-
*/
|
|
42
|
-
constructor({ transportManager, peerStore, connectionGater, addressSorter, maxParallelDials, maxAddrsToDial, dialTimeout, maxDialsPerPeer, resolvers, metrics }: DialerProperties & DialerOptions);
|
|
43
|
-
connectionGater: import("../types").ConnectionGater;
|
|
44
|
-
transportManager: import("../transport-manager");
|
|
45
|
-
peerStore: import("../peer-store/types").PeerStore;
|
|
46
|
-
addressSorter: (addresses: Address[]) => Address[];
|
|
47
|
-
maxParallelDials: number;
|
|
48
|
-
maxAddrsToDial: number;
|
|
49
|
-
timeout: number;
|
|
50
|
-
maxDialsPerPeer: number;
|
|
51
|
-
tokens: number[];
|
|
52
|
-
/** @type {Map<string, PendingDial>} */
|
|
53
|
-
_pendingDials: Map<string, PendingDial>;
|
|
54
|
-
/** @type {Map<string, { resolve: (value: any) => void, reject: (err: Error) => void}>} */
|
|
55
|
-
_pendingDialTargets: Map<string, {
|
|
56
|
-
resolve: (value: any) => void;
|
|
57
|
-
reject: (err: Error) => void;
|
|
58
|
-
}>;
|
|
59
|
-
/**
|
|
60
|
-
* Clears any pending dials
|
|
61
|
-
*/
|
|
62
|
-
destroy(): void;
|
|
63
|
-
/**
|
|
64
|
-
* Connects to a given `peer` by dialing all of its known addresses.
|
|
65
|
-
* The dial to the first address that is successfully able to upgrade a connection
|
|
66
|
-
* will be used.
|
|
67
|
-
*
|
|
68
|
-
* @param {PeerId|Multiaddr|string} peer - The peer to dial
|
|
69
|
-
* @param {object} [options]
|
|
70
|
-
* @param {AbortSignal} [options.signal] - An AbortController signal
|
|
71
|
-
* @returns {Promise<Connection>}
|
|
72
|
-
*/
|
|
73
|
-
connectToPeer(peer: PeerId | Multiaddr | string, options?: {
|
|
74
|
-
signal?: AbortSignal | undefined;
|
|
75
|
-
} | undefined): Promise<Connection>;
|
|
76
|
-
/**
|
|
77
|
-
* Connects to a given `peer` by dialing all of its known addresses.
|
|
78
|
-
* The dial to the first address that is successfully able to upgrade a connection
|
|
79
|
-
* will be used.
|
|
80
|
-
*
|
|
81
|
-
* @param {PeerId|Multiaddr|string} peer - The peer to dial
|
|
82
|
-
* @returns {Promise<DialTarget>}
|
|
83
|
-
*/
|
|
84
|
-
_createCancellableDialTarget(peer: PeerId | Multiaddr | string): Promise<DialTarget>;
|
|
85
|
-
/**
|
|
86
|
-
* Creates a DialTarget. The DialTarget is used to create and track
|
|
87
|
-
* the DialRequest to a given peer.
|
|
88
|
-
* If a multiaddr is received it should be the first address attempted.
|
|
89
|
-
* Multiaddrs not supported by the available transports will be filtered out.
|
|
90
|
-
*
|
|
91
|
-
* @private
|
|
92
|
-
* @param {PeerId|Multiaddr|string} peer - A PeerId or Multiaddr
|
|
93
|
-
* @returns {Promise<DialTarget>}
|
|
94
|
-
*/
|
|
95
|
-
private _createDialTarget;
|
|
96
|
-
/**
|
|
97
|
-
* Creates a PendingDial that wraps the underlying DialRequest
|
|
98
|
-
*
|
|
99
|
-
* @private
|
|
100
|
-
* @param {DialTarget} dialTarget
|
|
101
|
-
* @param {object} [options]
|
|
102
|
-
* @param {AbortSignal} [options.signal] - An AbortController signal
|
|
103
|
-
* @returns {PendingDial}
|
|
104
|
-
*/
|
|
105
|
-
private _createPendingDial;
|
|
106
|
-
/**
|
|
107
|
-
* @param {number} num
|
|
108
|
-
*/
|
|
109
|
-
getTokens(num: number): number[];
|
|
110
|
-
/**
|
|
111
|
-
* @param {number} token
|
|
112
|
-
*/
|
|
113
|
-
releaseToken(token: number): void;
|
|
114
|
-
/**
|
|
115
|
-
* Resolve multiaddr recursively.
|
|
116
|
-
*
|
|
117
|
-
* @param {Multiaddr} ma
|
|
118
|
-
* @returns {Promise<Multiaddr[]>}
|
|
119
|
-
*/
|
|
120
|
-
_resolve(ma: Multiaddr): Promise<Multiaddr[]>;
|
|
121
|
-
/**
|
|
122
|
-
* Resolve a given multiaddr. If this fails, an empty array will be returned
|
|
123
|
-
*
|
|
124
|
-
* @param {Multiaddr} ma
|
|
125
|
-
* @returns {Promise<Multiaddr[]>}
|
|
126
|
-
*/
|
|
127
|
-
_resolveRecord(ma: Multiaddr): Promise<Multiaddr[]>;
|
|
128
|
-
}
|
|
129
|
-
declare namespace Dialer {
|
|
130
|
-
export { Connection, PeerId, PeerStore, Address, TransportManager, ConnectionGater, DialerProperties, Resolver, DialerOptions, DialTarget, PendingDial };
|
|
131
|
-
}
|
|
132
|
-
type PendingDial = {
|
|
133
|
-
dialRequest: import('./dial-request');
|
|
134
|
-
controller: import('timeout-abort-controller').TimeoutController;
|
|
135
|
-
promise: Promise<Connection>;
|
|
136
|
-
destroy: () => void;
|
|
137
|
-
};
|
|
138
|
-
type PeerId = import('peer-id');
|
|
139
|
-
import { Multiaddr } from "multiaddr";
|
|
140
|
-
type Connection = import("libp2p-interfaces/src/connection/connection");
|
|
141
|
-
type DialTarget = {
|
|
142
|
-
id: string;
|
|
143
|
-
addrs: Multiaddr[];
|
|
144
|
-
};
|
|
145
|
-
type DialerProperties = {
|
|
146
|
-
peerStore: PeerStore;
|
|
147
|
-
transportManager: TransportManager;
|
|
148
|
-
connectionGater: ConnectionGater;
|
|
149
|
-
};
|
|
150
|
-
type DialerOptions = {
|
|
151
|
-
/**
|
|
152
|
-
* - Sort the known addresses of a peer before trying to dial.
|
|
153
|
-
*/
|
|
154
|
-
addressSorter?: ((addresses: Address[]) => Address[]) | undefined;
|
|
155
|
-
/**
|
|
156
|
-
* - Number of max concurrent dials.
|
|
157
|
-
*/
|
|
158
|
-
maxParallelDials?: number | undefined;
|
|
159
|
-
/**
|
|
160
|
-
* - Number of max addresses to dial for a given peer.
|
|
161
|
-
*/
|
|
162
|
-
maxAddrsToDial?: number | undefined;
|
|
163
|
-
/**
|
|
164
|
-
* - Number of max concurrent dials per peer.
|
|
165
|
-
*/
|
|
166
|
-
maxDialsPerPeer?: number | undefined;
|
|
167
|
-
/**
|
|
168
|
-
* - How long a dial attempt is allowed to take.
|
|
169
|
-
*/
|
|
170
|
-
dialTimeout?: number | undefined;
|
|
171
|
-
/**
|
|
172
|
-
* - multiaddr resolvers to use when dialing
|
|
173
|
-
*/
|
|
174
|
-
resolvers?: Record<string, Resolver> | undefined;
|
|
175
|
-
metrics?: import("../metrics") | undefined;
|
|
176
|
-
};
|
|
177
|
-
type PeerStore = import('../peer-store/types').PeerStore;
|
|
178
|
-
type Address = import('../peer-store/types').Address;
|
|
179
|
-
type TransportManager = import('../transport-manager');
|
|
180
|
-
type ConnectionGater = import('../types').ConnectionGater;
|
|
181
|
-
type Resolver = (addr: Multiaddr) => Promise<string[]>;
|
|
182
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dialer/index.js"],"names":[],"mappings":";AAgCA;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;IACE;;;OAGG;IACH,iKAFW,gBAAgB,GAAG,aAAa,EAyC1C;IA3BC,oDAAsC;IACtC,iDAAwC;IACxC,mDAA0B;IAC1B,2BAvCsB,OAAO,EAAE,KAAK,OAAO,EAAE,CAuCX;IAClC,yBAAwC;IACxC,uBAAoC;IACpC,gBAA0B;IAC1B,wBAAsC;IACtC,iBAAuE;IAEvE,uCAAuC;IACvC,eADW,IAAI,MAAM,EAAE,WAAW,CAAC,CAKjC;IAEF,0FAA0F;IAC1F;yBAD0C,GAAG,KAAK,IAAI;sBAAgB,KAAK,KAAK,IAAI;OAKlF;IAOJ;;OAEG;IACH,gBAcC;IAED;;;;;;;;;OASG;IACH,oBALW,MAAM,GAAC,SAAS,GAAC,MAAM;;oBAGrB,QAAQ,UAAU,CAAC,CA8B/B;IAED;;;;;;;OAOG;IACH,mCAHW,MAAM,GAAC,SAAS,GAAC,MAAM,GACrB,QAAQ,UAAU,CAAC,CAmB/B;IAED;;;;;;;;;OASG;IACH,0BAyCC;IAED;;;;;;;;OAQG;IACH,2BA0CC;IAED;;OAEG;IACH,eAFW,MAAM,YAOhB;IAED;;OAEG;IACH,oBAFW,MAAM,QAOhB;IAED;;;;;OAKG;IACH,aAHW,SAAS,GACP,QAAQ,SAAS,EAAE,CAAC,CAwBhC;IAED;;;;;OAKG;IACH,mBAHW,SAAS,GACP,QAAQ,SAAS,EAAE,CAAC,CAWhC;CACF;;;;;iBAtTa,OAAO,gBAAgB,CAAC;gBACxB,OAAO,0BAA0B,EAAE,iBAAiB;aACpD,QAAQ,UAAU,CAAC;mBACR,IAAI;;cAhChB,OAAO,SAAS,CAAC;;;;QAyBhB,MAAM;WACN,SAAS,EAAE;;;eAjBX,SAAS;sBACT,gBAAgB;qBAChB,eAAe;;;;;;iCAKH,OAAO,EAAE,KAAK,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;iBAfpC,OAAO,qBAAqB,EAAE,SAAS;eACvC,OAAO,qBAAqB,EAAE,OAAO;wBACrC,OAAO,sBAAsB,CAAC;uBAC9B,OAAO,UAAU,EAAE,eAAe;uBAS5B,SAAS,KAAK,QAAQ,MAAM,EAAE,CAAC"}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import * as $protobuf from "protobufjs";
|
|
2
|
-
/** Properties of a FetchRequest. */
|
|
3
|
-
export interface IFetchRequest {
|
|
4
|
-
|
|
5
|
-
/** FetchRequest identifier */
|
|
6
|
-
identifier?: (string|null);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/** Represents a FetchRequest. */
|
|
10
|
-
export class FetchRequest implements IFetchRequest {
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Constructs a new FetchRequest.
|
|
14
|
-
* @param [p] Properties to set
|
|
15
|
-
*/
|
|
16
|
-
constructor(p?: IFetchRequest);
|
|
17
|
-
|
|
18
|
-
/** FetchRequest identifier. */
|
|
19
|
-
public identifier: string;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Encodes the specified FetchRequest message. Does not implicitly {@link FetchRequest.verify|verify} messages.
|
|
23
|
-
* @param m FetchRequest message or plain object to encode
|
|
24
|
-
* @param [w] Writer to encode to
|
|
25
|
-
* @returns Writer
|
|
26
|
-
*/
|
|
27
|
-
public static encode(m: IFetchRequest, w?: $protobuf.Writer): $protobuf.Writer;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Decodes a FetchRequest message from the specified reader or buffer.
|
|
31
|
-
* @param r Reader or buffer to decode from
|
|
32
|
-
* @param [l] Message length if known beforehand
|
|
33
|
-
* @returns FetchRequest
|
|
34
|
-
* @throws {Error} If the payload is not a reader or valid buffer
|
|
35
|
-
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
36
|
-
*/
|
|
37
|
-
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): FetchRequest;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Creates a FetchRequest message from a plain object. Also converts values to their respective internal types.
|
|
41
|
-
* @param d Plain object
|
|
42
|
-
* @returns FetchRequest
|
|
43
|
-
*/
|
|
44
|
-
public static fromObject(d: { [k: string]: any }): FetchRequest;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Creates a plain object from a FetchRequest message. Also converts values to other types if specified.
|
|
48
|
-
* @param m FetchRequest
|
|
49
|
-
* @param [o] Conversion options
|
|
50
|
-
* @returns Plain object
|
|
51
|
-
*/
|
|
52
|
-
public static toObject(m: FetchRequest, o?: $protobuf.IConversionOptions): { [k: string]: any };
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Converts this FetchRequest to JSON.
|
|
56
|
-
* @returns JSON object
|
|
57
|
-
*/
|
|
58
|
-
public toJSON(): { [k: string]: any };
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/** Properties of a FetchResponse. */
|
|
62
|
-
export interface IFetchResponse {
|
|
63
|
-
|
|
64
|
-
/** FetchResponse status */
|
|
65
|
-
status?: (FetchResponse.StatusCode|null);
|
|
66
|
-
|
|
67
|
-
/** FetchResponse data */
|
|
68
|
-
data?: (Uint8Array|null);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/** Represents a FetchResponse. */
|
|
72
|
-
export class FetchResponse implements IFetchResponse {
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Constructs a new FetchResponse.
|
|
76
|
-
* @param [p] Properties to set
|
|
77
|
-
*/
|
|
78
|
-
constructor(p?: IFetchResponse);
|
|
79
|
-
|
|
80
|
-
/** FetchResponse status. */
|
|
81
|
-
public status: FetchResponse.StatusCode;
|
|
82
|
-
|
|
83
|
-
/** FetchResponse data. */
|
|
84
|
-
public data: Uint8Array;
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Encodes the specified FetchResponse message. Does not implicitly {@link FetchResponse.verify|verify} messages.
|
|
88
|
-
* @param m FetchResponse message or plain object to encode
|
|
89
|
-
* @param [w] Writer to encode to
|
|
90
|
-
* @returns Writer
|
|
91
|
-
*/
|
|
92
|
-
public static encode(m: IFetchResponse, w?: $protobuf.Writer): $protobuf.Writer;
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Decodes a FetchResponse message from the specified reader or buffer.
|
|
96
|
-
* @param r Reader or buffer to decode from
|
|
97
|
-
* @param [l] Message length if known beforehand
|
|
98
|
-
* @returns FetchResponse
|
|
99
|
-
* @throws {Error} If the payload is not a reader or valid buffer
|
|
100
|
-
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
101
|
-
*/
|
|
102
|
-
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): FetchResponse;
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Creates a FetchResponse message from a plain object. Also converts values to their respective internal types.
|
|
106
|
-
* @param d Plain object
|
|
107
|
-
* @returns FetchResponse
|
|
108
|
-
*/
|
|
109
|
-
public static fromObject(d: { [k: string]: any }): FetchResponse;
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Creates a plain object from a FetchResponse message. Also converts values to other types if specified.
|
|
113
|
-
* @param m FetchResponse
|
|
114
|
-
* @param [o] Conversion options
|
|
115
|
-
* @returns Plain object
|
|
116
|
-
*/
|
|
117
|
-
public static toObject(m: FetchResponse, o?: $protobuf.IConversionOptions): { [k: string]: any };
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Converts this FetchResponse to JSON.
|
|
121
|
-
* @returns JSON object
|
|
122
|
-
*/
|
|
123
|
-
public toJSON(): { [k: string]: any };
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export namespace FetchResponse {
|
|
127
|
-
|
|
128
|
-
/** StatusCode enum. */
|
|
129
|
-
enum StatusCode {
|
|
130
|
-
OK = 0,
|
|
131
|
-
NOT_FOUND = 1,
|
|
132
|
-
ERROR = 2
|
|
133
|
-
}
|
|
134
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import * as $protobuf from "protobufjs";
|
|
2
|
-
/** Properties of an Identify. */
|
|
3
|
-
export interface IIdentify {
|
|
4
|
-
|
|
5
|
-
/** Identify protocolVersion */
|
|
6
|
-
protocolVersion?: (string|null);
|
|
7
|
-
|
|
8
|
-
/** Identify agentVersion */
|
|
9
|
-
agentVersion?: (string|null);
|
|
10
|
-
|
|
11
|
-
/** Identify publicKey */
|
|
12
|
-
publicKey?: (Uint8Array|null);
|
|
13
|
-
|
|
14
|
-
/** Identify listenAddrs */
|
|
15
|
-
listenAddrs?: (Uint8Array[]|null);
|
|
16
|
-
|
|
17
|
-
/** Identify observedAddr */
|
|
18
|
-
observedAddr?: (Uint8Array|null);
|
|
19
|
-
|
|
20
|
-
/** Identify protocols */
|
|
21
|
-
protocols?: (string[]|null);
|
|
22
|
-
|
|
23
|
-
/** Identify signedPeerRecord */
|
|
24
|
-
signedPeerRecord?: (Uint8Array|null);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/** Represents an Identify. */
|
|
28
|
-
export class Identify implements IIdentify {
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Constructs a new Identify.
|
|
32
|
-
* @param [p] Properties to set
|
|
33
|
-
*/
|
|
34
|
-
constructor(p?: IIdentify);
|
|
35
|
-
|
|
36
|
-
/** Identify protocolVersion. */
|
|
37
|
-
public protocolVersion: string;
|
|
38
|
-
|
|
39
|
-
/** Identify agentVersion. */
|
|
40
|
-
public agentVersion: string;
|
|
41
|
-
|
|
42
|
-
/** Identify publicKey. */
|
|
43
|
-
public publicKey: Uint8Array;
|
|
44
|
-
|
|
45
|
-
/** Identify listenAddrs. */
|
|
46
|
-
public listenAddrs: Uint8Array[];
|
|
47
|
-
|
|
48
|
-
/** Identify observedAddr. */
|
|
49
|
-
public observedAddr: Uint8Array;
|
|
50
|
-
|
|
51
|
-
/** Identify protocols. */
|
|
52
|
-
public protocols: string[];
|
|
53
|
-
|
|
54
|
-
/** Identify signedPeerRecord. */
|
|
55
|
-
public signedPeerRecord: Uint8Array;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Encodes the specified Identify message. Does not implicitly {@link Identify.verify|verify} messages.
|
|
59
|
-
* @param m Identify message or plain object to encode
|
|
60
|
-
* @param [w] Writer to encode to
|
|
61
|
-
* @returns Writer
|
|
62
|
-
*/
|
|
63
|
-
public static encode(m: IIdentify, w?: $protobuf.Writer): $protobuf.Writer;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Decodes an Identify message from the specified reader or buffer.
|
|
67
|
-
* @param r Reader or buffer to decode from
|
|
68
|
-
* @param [l] Message length if known beforehand
|
|
69
|
-
* @returns Identify
|
|
70
|
-
* @throws {Error} If the payload is not a reader or valid buffer
|
|
71
|
-
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
72
|
-
*/
|
|
73
|
-
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): Identify;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Creates an Identify message from a plain object. Also converts values to their respective internal types.
|
|
77
|
-
* @param d Plain object
|
|
78
|
-
* @returns Identify
|
|
79
|
-
*/
|
|
80
|
-
public static fromObject(d: { [k: string]: any }): Identify;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Creates a plain object from an Identify message. Also converts values to other types if specified.
|
|
84
|
-
* @param m Identify
|
|
85
|
-
* @param [o] Conversion options
|
|
86
|
-
* @returns Plain object
|
|
87
|
-
*/
|
|
88
|
-
public static toObject(m: Identify, o?: $protobuf.IConversionOptions): { [k: string]: any };
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Converts this Identify to JSON.
|
|
92
|
-
* @returns JSON object
|
|
93
|
-
*/
|
|
94
|
-
public toJSON(): { [k: string]: any };
|
|
95
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export type Connection = import("libp2p-interfaces/src/connection/connection");
|
|
2
|
-
export const protocol: "/plaintext/2.0.0";
|
|
3
|
-
import PeerId = require("peer-id");
|
|
4
|
-
export declare function secureInbound(localId: PeerId, conn: import("libp2p-interfaces/src/connection/connection"), remoteId: PeerId | undefined): Promise<{
|
|
5
|
-
conn: any;
|
|
6
|
-
remotePeer: PeerId;
|
|
7
|
-
}>;
|
|
8
|
-
export declare function secureOutbound(localId: PeerId, conn: import("libp2p-interfaces/src/connection/connection"), remoteId: PeerId | undefined): Promise<{
|
|
9
|
-
conn: any;
|
|
10
|
-
remotePeer: PeerId;
|
|
11
|
-
}>;
|
|
12
|
-
//# sourceMappingURL=plaintext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plaintext.d.ts","sourceRoot":"","sources":["../../../src/insecure/plaintext.js"],"names":[],"mappings":";AAaA,0CAAmC;;AAsEjB;;;GAEd;AAMe;;;GAEf"}
|