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,85 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* @param {TransportManagerProperties & TransportManagerOptions} options
|
|
19
|
-
*/
|
|
20
|
-
constructor({ libp2p, upgrader, faultTolerance }: TransportManagerProperties & TransportManagerOptions);
|
|
21
|
-
libp2p: import("./");
|
|
22
|
-
upgrader: import("./upgrader");
|
|
23
|
-
/** @type {Map<string, Transport>} */
|
|
24
|
-
_transports: Map<string, import("libp2p-interfaces/src/transport/types").Transport<any, any>>;
|
|
25
|
-
_listeners: Map<any, any>;
|
|
26
|
-
_listenerOptions: Map<any, any>;
|
|
27
|
-
faultTolerance: number;
|
|
1
|
+
import type { Transport, TransportManager, TransportManagerEvents } from '@libp2p/interfaces/transport';
|
|
2
|
+
import type { Multiaddr } from '@multiformats/multiaddr';
|
|
3
|
+
import type { Connection } from '@libp2p/interfaces/connection';
|
|
4
|
+
import type { AbortOptions } from '@libp2p/interfaces';
|
|
5
|
+
import { EventEmitter } from '@libp2p/interfaces/events';
|
|
6
|
+
import type { Startable } from '@libp2p/interfaces/startable';
|
|
7
|
+
import type { Components } from '@libp2p/interfaces/components';
|
|
8
|
+
export interface TransportManagerInit {
|
|
9
|
+
faultTolerance?: FaultTolerance;
|
|
10
|
+
}
|
|
11
|
+
export declare class DefaultTransportManager extends EventEmitter<TransportManagerEvents> implements TransportManager, Startable {
|
|
12
|
+
private readonly components;
|
|
13
|
+
private readonly transports;
|
|
14
|
+
private readonly listeners;
|
|
15
|
+
private readonly faultTolerance;
|
|
16
|
+
private started;
|
|
17
|
+
constructor(components: Components, init?: TransportManagerInit);
|
|
28
18
|
/**
|
|
29
19
|
* Adds a `Transport` to the manager
|
|
30
|
-
*
|
|
31
|
-
* @param {string} key
|
|
32
|
-
* @param {TransportFactory} Transport
|
|
33
|
-
* @param {*} transportOptions - Additional options to pass to the transport
|
|
34
|
-
* @returns {void}
|
|
35
20
|
*/
|
|
36
|
-
add(
|
|
21
|
+
add(transport: Transport): void;
|
|
22
|
+
isStarted(): boolean;
|
|
23
|
+
start(): Promise<void>;
|
|
37
24
|
/**
|
|
38
25
|
* Stops all listeners
|
|
39
|
-
*
|
|
40
|
-
* @async
|
|
41
26
|
*/
|
|
42
|
-
|
|
27
|
+
stop(): Promise<void>;
|
|
43
28
|
/**
|
|
44
29
|
* Dials the given Multiaddr over it's supported transport
|
|
45
|
-
*
|
|
46
|
-
* @param {Multiaddr} ma
|
|
47
|
-
* @param {*} options
|
|
48
|
-
* @returns {Promise<Connection>}
|
|
49
30
|
*/
|
|
50
|
-
dial(ma: Multiaddr, options
|
|
31
|
+
dial(ma: Multiaddr, options?: AbortOptions): Promise<Connection>;
|
|
51
32
|
/**
|
|
52
33
|
* Returns all Multiaddr's the listeners are using
|
|
53
|
-
*
|
|
54
|
-
* @returns {Multiaddr[]}
|
|
55
34
|
*/
|
|
56
35
|
getAddrs(): Multiaddr[];
|
|
57
36
|
/**
|
|
58
|
-
* Returns all the transports instances
|
|
59
|
-
*
|
|
60
|
-
* @returns {IterableIterator<Transport>}
|
|
37
|
+
* Returns all the transports instances
|
|
61
38
|
*/
|
|
62
|
-
getTransports():
|
|
39
|
+
getTransports(): Transport[];
|
|
63
40
|
/**
|
|
64
41
|
* Finds a transport that matches the given Multiaddr
|
|
65
|
-
*
|
|
66
|
-
* @param {Multiaddr} ma
|
|
67
|
-
* @returns {Transport|null}
|
|
68
42
|
*/
|
|
69
|
-
transportForMultiaddr(ma: Multiaddr):
|
|
43
|
+
transportForMultiaddr(ma: Multiaddr): Transport | undefined;
|
|
70
44
|
/**
|
|
71
|
-
* Starts listeners for each listen Multiaddr
|
|
72
|
-
*
|
|
73
|
-
* @async
|
|
74
|
-
* @param {Multiaddr[]} addrs - addresses to attempt to listen on
|
|
45
|
+
* Starts listeners for each listen Multiaddr
|
|
75
46
|
*/
|
|
76
47
|
listen(addrs: Multiaddr[]): Promise<void>;
|
|
77
48
|
/**
|
|
78
49
|
* Removes the given transport from the manager.
|
|
79
50
|
* If a transport has any running listeners, they will be closed.
|
|
80
|
-
*
|
|
81
|
-
* @async
|
|
82
|
-
* @param {string} key
|
|
83
51
|
*/
|
|
84
52
|
remove(key: string): Promise<void>;
|
|
85
53
|
/**
|
|
@@ -90,31 +58,17 @@ declare class TransportManager {
|
|
|
90
58
|
*/
|
|
91
59
|
removeAll(): Promise<void>;
|
|
92
60
|
}
|
|
93
|
-
declare namespace TransportManager {
|
|
94
|
-
export { FAULT_TOLERANCE as FaultTolerance, Multiaddr, Connection, TransportFactory, Transport, TransportManagerProperties, TransportManagerOptions };
|
|
95
|
-
}
|
|
96
|
-
type Multiaddr = import('multiaddr').Multiaddr;
|
|
97
|
-
type Connection = import("libp2p-interfaces/src/connection/connection");
|
|
98
|
-
type TransportManagerProperties = {
|
|
99
|
-
libp2p: import('./');
|
|
100
|
-
upgrader: import('./upgrader');
|
|
101
|
-
};
|
|
102
|
-
type TransportManagerOptions = {
|
|
103
|
-
/**
|
|
104
|
-
* - Address listen error tolerance.
|
|
105
|
-
*/
|
|
106
|
-
faultTolerance?: number | undefined;
|
|
107
|
-
};
|
|
108
61
|
/**
|
|
109
|
-
* Enum Transport Manager Fault Tolerance values
|
|
110
|
-
* FATAL_ALL should be used for failing in any listen circumstance.
|
|
111
|
-
* NO_FATAL should be used for not failing when not listening.
|
|
62
|
+
* Enum Transport Manager Fault Tolerance values
|
|
112
63
|
*/
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
64
|
+
export declare enum FaultTolerance {
|
|
65
|
+
/**
|
|
66
|
+
* should be used for failing in any listen circumstance
|
|
67
|
+
*/
|
|
68
|
+
FATAL_ALL = 0,
|
|
69
|
+
/**
|
|
70
|
+
* should be used for not failing when not listening
|
|
71
|
+
*/
|
|
72
|
+
NO_FATAL = 1
|
|
117
73
|
}
|
|
118
|
-
type TransportFactory = import('libp2p-interfaces/src/transport/types').TransportFactory<any, any>;
|
|
119
|
-
type Transport = import('libp2p-interfaces/src/transport/types').Transport<any, any>;
|
|
120
74
|
//# sourceMappingURL=transport-manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport-manager.d.ts","sourceRoot":"","sources":["../../src/transport-manager.
|
|
1
|
+
{"version":3,"file":"transport-manager.d.ts","sourceRoot":"","sources":["../../src/transport-manager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAY,SAAS,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACjH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAe,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAK/D,MAAM,WAAW,oBAAoB;IACnC,cAAc,CAAC,EAAE,cAAc,CAAA;CAChC;AAED,qBAAa,uBAAwB,SAAQ,YAAY,CAAC,sBAAsB,CAAE,YAAW,gBAAgB,EAAE,SAAS;IACtH,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;IACvC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAwB;IACnD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyB;IACnD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAgB;IAC/C,OAAO,CAAC,OAAO,CAAS;gBAEX,UAAU,EAAE,UAAU,EAAE,IAAI,GAAE,oBAAyB;IAcpE;;OAEG;IACH,GAAG,CAAE,SAAS,EAAE,SAAS;IAoBzB,SAAS;IAIH,KAAK;IASX;;OAEG;IACG,IAAI;IAwBV;;OAEG;IACG,IAAI,CAAE,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC;IAqBvE;;OAEG;IACH,QAAQ,IAAK,SAAS,EAAE;IAUxB;;OAEG;IACH,aAAa;IAIb;;OAEG;IACH,qBAAqB,CAAE,EAAE,EAAE,SAAS;IAUpC;;OAEG;IACG,MAAM,CAAE,KAAK,EAAE,SAAS,EAAE;IAwEhC;;;OAGG;IACG,MAAM,CAAE,GAAG,EAAE,MAAM;IAYzB;;;;;OAKG;IACG,SAAS;CAQhB;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB;;OAEG;IACH,SAAS,IAAI;IAEb;;OAEG;IACH,QAAQ,IAAA;CACT"}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { logger } from '@libp2p/logger';
|
|
2
|
+
import pSettle from 'p-settle';
|
|
3
|
+
import { codes } from './errors.js';
|
|
4
|
+
import errCode from 'err-code';
|
|
5
|
+
import { CustomEvent, EventEmitter } from '@libp2p/interfaces/events';
|
|
6
|
+
import { trackedMap } from '@libp2p/tracked-map';
|
|
7
|
+
const log = logger('libp2p:transports');
|
|
8
|
+
export class DefaultTransportManager extends EventEmitter {
|
|
9
|
+
constructor(components, init = {}) {
|
|
10
|
+
super();
|
|
11
|
+
this.components = components;
|
|
12
|
+
this.started = false;
|
|
13
|
+
this.transports = new Map();
|
|
14
|
+
this.listeners = trackedMap({
|
|
15
|
+
component: 'transport-manager',
|
|
16
|
+
metric: 'listeners',
|
|
17
|
+
metrics: this.components.getMetrics()
|
|
18
|
+
});
|
|
19
|
+
this.faultTolerance = init.faultTolerance ?? FaultTolerance.FATAL_ALL;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Adds a `Transport` to the manager
|
|
23
|
+
*/
|
|
24
|
+
add(transport) {
|
|
25
|
+
const tag = transport[Symbol.toStringTag];
|
|
26
|
+
if (tag == null) {
|
|
27
|
+
throw errCode(new Error('Transport must have a valid tag'), codes.ERR_INVALID_KEY);
|
|
28
|
+
}
|
|
29
|
+
if (this.transports.has(tag)) {
|
|
30
|
+
throw errCode(new Error('There is already a transport with this tag'), codes.ERR_DUPLICATE_TRANSPORT);
|
|
31
|
+
}
|
|
32
|
+
log('adding transport %s', tag);
|
|
33
|
+
this.transports.set(tag, transport);
|
|
34
|
+
if (!this.listeners.has(tag)) {
|
|
35
|
+
this.listeners.set(tag, []);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
isStarted() {
|
|
39
|
+
return this.started;
|
|
40
|
+
}
|
|
41
|
+
async start() {
|
|
42
|
+
// Listen on the provided transports for the provided addresses
|
|
43
|
+
const addrs = this.components.getAddressManager().getListenAddrs();
|
|
44
|
+
await this.listen(addrs);
|
|
45
|
+
this.started = true;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Stops all listeners
|
|
49
|
+
*/
|
|
50
|
+
async stop() {
|
|
51
|
+
const tasks = [];
|
|
52
|
+
for (const [key, listeners] of this.listeners) {
|
|
53
|
+
log('closing listeners for %s', key);
|
|
54
|
+
while (listeners.length > 0) {
|
|
55
|
+
const listener = listeners.pop();
|
|
56
|
+
if (listener == null) {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
tasks.push(listener.close());
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
await Promise.all(tasks);
|
|
63
|
+
log('all listeners closed');
|
|
64
|
+
for (const key of this.listeners.keys()) {
|
|
65
|
+
this.listeners.set(key, []);
|
|
66
|
+
}
|
|
67
|
+
this.started = false;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Dials the given Multiaddr over it's supported transport
|
|
71
|
+
*/
|
|
72
|
+
async dial(ma, options) {
|
|
73
|
+
const transport = this.transportForMultiaddr(ma);
|
|
74
|
+
if (transport == null) {
|
|
75
|
+
throw errCode(new Error(`No transport available for address ${String(ma)}`), codes.ERR_TRANSPORT_UNAVAILABLE);
|
|
76
|
+
}
|
|
77
|
+
try {
|
|
78
|
+
return await transport.dial(ma, {
|
|
79
|
+
...options,
|
|
80
|
+
upgrader: this.components.getUpgrader()
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
catch (err) {
|
|
84
|
+
if (err.code == null) {
|
|
85
|
+
err.code = codes.ERR_TRANSPORT_DIAL_FAILED;
|
|
86
|
+
}
|
|
87
|
+
throw err;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Returns all Multiaddr's the listeners are using
|
|
92
|
+
*/
|
|
93
|
+
getAddrs() {
|
|
94
|
+
let addrs = [];
|
|
95
|
+
for (const listeners of this.listeners.values()) {
|
|
96
|
+
for (const listener of listeners) {
|
|
97
|
+
addrs = [...addrs, ...listener.getAddrs()];
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return addrs;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Returns all the transports instances
|
|
104
|
+
*/
|
|
105
|
+
getTransports() {
|
|
106
|
+
return Array.of(...this.transports.values());
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Finds a transport that matches the given Multiaddr
|
|
110
|
+
*/
|
|
111
|
+
transportForMultiaddr(ma) {
|
|
112
|
+
for (const transport of this.transports.values()) {
|
|
113
|
+
const addrs = transport.filter([ma]);
|
|
114
|
+
if (addrs.length > 0) {
|
|
115
|
+
return transport;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Starts listeners for each listen Multiaddr
|
|
121
|
+
*/
|
|
122
|
+
async listen(addrs) {
|
|
123
|
+
if (addrs == null || addrs.length === 0) {
|
|
124
|
+
log('no addresses were provided for listening, this node is dial only');
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
const couldNotListen = [];
|
|
128
|
+
for (const [key, transport] of this.transports.entries()) {
|
|
129
|
+
const supportedAddrs = transport.filter(addrs);
|
|
130
|
+
const tasks = [];
|
|
131
|
+
// For each supported multiaddr, create a listener
|
|
132
|
+
for (const addr of supportedAddrs) {
|
|
133
|
+
log('creating listener for %s on %s', key, addr);
|
|
134
|
+
const listener = transport.createListener({
|
|
135
|
+
upgrader: this.components.getUpgrader()
|
|
136
|
+
});
|
|
137
|
+
let listeners = this.listeners.get(key);
|
|
138
|
+
if (listeners == null) {
|
|
139
|
+
listeners = [];
|
|
140
|
+
this.listeners.set(key, listeners);
|
|
141
|
+
}
|
|
142
|
+
listeners.push(listener);
|
|
143
|
+
// Track listen/close events
|
|
144
|
+
listener.addEventListener('listening', () => {
|
|
145
|
+
this.dispatchEvent(new CustomEvent('listener:listening', {
|
|
146
|
+
detail: listener
|
|
147
|
+
}));
|
|
148
|
+
});
|
|
149
|
+
listener.addEventListener('close', () => {
|
|
150
|
+
this.dispatchEvent(new CustomEvent('listener:close', {
|
|
151
|
+
detail: listener
|
|
152
|
+
}));
|
|
153
|
+
});
|
|
154
|
+
// We need to attempt to listen on everything
|
|
155
|
+
tasks.push(listener.listen(addr));
|
|
156
|
+
}
|
|
157
|
+
// Keep track of transports we had no addresses for
|
|
158
|
+
if (tasks.length === 0) {
|
|
159
|
+
couldNotListen.push(key);
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
const results = await pSettle(tasks);
|
|
163
|
+
// If we are listening on at least 1 address, succeed.
|
|
164
|
+
// TODO: we should look at adding a retry (`p-retry`) here to better support
|
|
165
|
+
// listening on remote addresses as they may be offline. We could then potentially
|
|
166
|
+
// just wait for any (`p-any`) listener to succeed on each transport before returning
|
|
167
|
+
const isListening = results.find(r => r.isFulfilled);
|
|
168
|
+
if ((isListening == null) && this.faultTolerance !== FaultTolerance.NO_FATAL) {
|
|
169
|
+
throw errCode(new Error(`Transport (${key}) could not listen on any available address`), codes.ERR_NO_VALID_ADDRESSES);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
// If no transports were able to listen, throw an error. This likely
|
|
173
|
+
// means we were given addresses we do not have transports for
|
|
174
|
+
if (couldNotListen.length === this.transports.size) {
|
|
175
|
+
const message = `no valid addresses were provided for transports [${couldNotListen.join(', ')}]`;
|
|
176
|
+
if (this.faultTolerance === FaultTolerance.FATAL_ALL) {
|
|
177
|
+
throw errCode(new Error(message), codes.ERR_NO_VALID_ADDRESSES);
|
|
178
|
+
}
|
|
179
|
+
log(`libp2p in dial mode only: ${message}`);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Removes the given transport from the manager.
|
|
184
|
+
* If a transport has any running listeners, they will be closed.
|
|
185
|
+
*/
|
|
186
|
+
async remove(key) {
|
|
187
|
+
log('removing %s', key);
|
|
188
|
+
// Close any running listeners
|
|
189
|
+
for (const listener of this.listeners.get(key) ?? []) {
|
|
190
|
+
await listener.close();
|
|
191
|
+
}
|
|
192
|
+
this.transports.delete(key);
|
|
193
|
+
this.listeners.delete(key);
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Removes all transports from the manager.
|
|
197
|
+
* If any listeners are running, they will be closed.
|
|
198
|
+
*
|
|
199
|
+
* @async
|
|
200
|
+
*/
|
|
201
|
+
async removeAll() {
|
|
202
|
+
const tasks = [];
|
|
203
|
+
for (const key of this.transports.keys()) {
|
|
204
|
+
tasks.push(this.remove(key));
|
|
205
|
+
}
|
|
206
|
+
await Promise.all(tasks);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Enum Transport Manager Fault Tolerance values
|
|
211
|
+
*/
|
|
212
|
+
export var FaultTolerance;
|
|
213
|
+
(function (FaultTolerance) {
|
|
214
|
+
/**
|
|
215
|
+
* should be used for failing in any listen circumstance
|
|
216
|
+
*/
|
|
217
|
+
FaultTolerance[FaultTolerance["FATAL_ALL"] = 0] = "FATAL_ALL";
|
|
218
|
+
/**
|
|
219
|
+
* should be used for not failing when not listening
|
|
220
|
+
*/
|
|
221
|
+
FaultTolerance[FaultTolerance["NO_FATAL"] = 1] = "NO_FATAL";
|
|
222
|
+
})(FaultTolerance || (FaultTolerance = {}));
|
|
223
|
+
//# sourceMappingURL=transport-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport-manager.js","sourceRoot":"","sources":["../../src/transport-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,OAAO,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,OAAO,MAAM,UAAU,CAAA;AAK9B,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAGrE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAEhD,MAAM,GAAG,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAA;AAMvC,MAAM,OAAO,uBAAwB,SAAQ,YAAoC;IAO/E,YAAa,UAAsB,EAAE,OAA6B,EAAE;QAClE,KAAK,EAAE,CAAA;QAEP,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;QACpB,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,EAAqB,CAAA;QAC9C,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC;YAC1B,SAAS,EAAE,mBAAmB;YAC9B,MAAM,EAAE,WAAW;YACnB,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE;SACtC,CAA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KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;SAC7B;QAED,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IAC1B,CAAC;CACF;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAUX;AAVD,WAAY,cAAc;IACxB;;OAEG;IACH,6DAAa,CAAA;IAEb;;OAEG;IACH,2DAAQ,CAAA;AACV,CAAC,EAVW,cAAc,KAAd,cAAc,QAUzB"}
|
package/dist/src/upgrader.d.ts
CHANGED
|
@@ -1,157 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
cryptos?: Map<string, import("libp2p-interfaces/src/crypto/types").Crypto> | undefined;
|
|
35
|
-
muxers?: Map<string, import("libp2p-interfaces/src/stream-muxer/types").MuxerFactory> | undefined;
|
|
36
|
-
onConnection: (connection: Connection) => void;
|
|
37
|
-
onConnectionEnd: (connection: Connection) => void;
|
|
38
|
-
});
|
|
39
|
-
connectionGater: import("./types").ConnectionGater;
|
|
40
|
-
localPeer: PeerId;
|
|
41
|
-
metrics: import("./metrics") | undefined;
|
|
42
|
-
cryptos: Map<string, import("libp2p-interfaces/src/crypto/types").Crypto>;
|
|
43
|
-
muxers: Map<string, import("libp2p-interfaces/src/stream-muxer/types").MuxerFactory>;
|
|
44
|
-
/** @type {import("./pnet") | null} */
|
|
45
|
-
protector: import("./pnet") | null;
|
|
46
|
-
protocols: Map<any, any>;
|
|
47
|
-
onConnection: (connection: Connection) => void;
|
|
48
|
-
onConnectionEnd: (connection: Connection) => void;
|
|
1
|
+
import { EventEmitter } from '@libp2p/interfaces/events';
|
|
2
|
+
import type { Connection, Stream } from '@libp2p/interfaces/connection';
|
|
3
|
+
import type { ConnectionEncrypter, SecuredConnection } from '@libp2p/interfaces/connection-encrypter';
|
|
4
|
+
import type { StreamMuxerFactory } from '@libp2p/interfaces/stream-muxer';
|
|
5
|
+
import type { PeerId } from '@libp2p/interfaces/peer-id';
|
|
6
|
+
import type { MultiaddrConnection, Upgrader, UpgraderEvents } from '@libp2p/interfaces/transport';
|
|
7
|
+
import type { Duplex } from 'it-stream-types';
|
|
8
|
+
import type { Components } from '@libp2p/interfaces/components';
|
|
9
|
+
interface CreateConectionOptions {
|
|
10
|
+
cryptoProtocol: string;
|
|
11
|
+
direction: 'inbound' | 'outbound';
|
|
12
|
+
maConn: MultiaddrConnection;
|
|
13
|
+
upgradedConn: Duplex<Uint8Array>;
|
|
14
|
+
remotePeer: PeerId;
|
|
15
|
+
muxerFactory?: StreamMuxerFactory;
|
|
16
|
+
}
|
|
17
|
+
interface OnStreamOptions {
|
|
18
|
+
connection: Connection;
|
|
19
|
+
stream: Stream;
|
|
20
|
+
protocol: string;
|
|
21
|
+
}
|
|
22
|
+
export interface CryptoResult extends SecuredConnection {
|
|
23
|
+
protocol: string;
|
|
24
|
+
}
|
|
25
|
+
export interface UpgraderInit {
|
|
26
|
+
connectionEncryption: ConnectionEncrypter[];
|
|
27
|
+
muxers: StreamMuxerFactory[];
|
|
28
|
+
}
|
|
29
|
+
export declare class DefaultUpgrader extends EventEmitter<UpgraderEvents> implements Upgrader {
|
|
30
|
+
private readonly components;
|
|
31
|
+
private readonly connectionEncryption;
|
|
32
|
+
private readonly muxers;
|
|
33
|
+
constructor(components: Components, init: UpgraderInit);
|
|
49
34
|
/**
|
|
50
35
|
* Upgrades an inbound connection
|
|
51
|
-
*
|
|
52
|
-
* @async
|
|
53
|
-
* @param {MultiaddrConnection} maConn
|
|
54
|
-
* @returns {Promise<Connection>}
|
|
55
36
|
*/
|
|
56
37
|
upgradeInbound(maConn: MultiaddrConnection): Promise<Connection>;
|
|
57
38
|
/**
|
|
58
39
|
* Upgrades an outbound connection
|
|
59
|
-
*
|
|
60
|
-
* @async
|
|
61
|
-
* @param {MultiaddrConnection} maConn
|
|
62
|
-
* @returns {Promise<Connection>}
|
|
63
40
|
*/
|
|
64
41
|
upgradeOutbound(maConn: MultiaddrConnection): Promise<Connection>;
|
|
65
42
|
/**
|
|
66
43
|
* A convenience method for generating a new `Connection`
|
|
67
|
-
*
|
|
68
|
-
* @private
|
|
69
|
-
* @param {object} options
|
|
70
|
-
* @param {string} options.cryptoProtocol - The crypto protocol that was negotiated
|
|
71
|
-
* @param {'inbound' | 'outbound'} options.direction - One of ['inbound', 'outbound']
|
|
72
|
-
* @param {MultiaddrConnection} options.maConn - The transport layer connection
|
|
73
|
-
* @param {MuxedStream | MultiaddrConnection} options.upgradedConn - A duplex connection returned from multiplexer and/or crypto selection
|
|
74
|
-
* @param {MuxerFactory} [options.Muxer] - The muxer to be used for muxing
|
|
75
|
-
* @param {PeerId} options.remotePeer - The peer the connection is with
|
|
76
|
-
* @returns {Connection}
|
|
77
44
|
*/
|
|
78
|
-
|
|
45
|
+
_createConnection(opts: CreateConectionOptions): Connection;
|
|
79
46
|
/**
|
|
80
47
|
* Routes incoming streams to the correct handler
|
|
81
|
-
*
|
|
82
|
-
* @private
|
|
83
|
-
* @param {object} options
|
|
84
|
-
* @param {Connection} options.connection - The connection the stream belongs to
|
|
85
|
-
* @param {MuxedStream} options.stream
|
|
86
|
-
* @param {string} options.protocol
|
|
87
48
|
*/
|
|
88
|
-
|
|
49
|
+
_onStream(opts: OnStreamOptions): void;
|
|
89
50
|
/**
|
|
90
|
-
* Attempts to encrypt the incoming `connection` with the provided `cryptos
|
|
91
|
-
*
|
|
92
|
-
* @private
|
|
93
|
-
* @async
|
|
94
|
-
* @param {PeerId} localPeer - The initiators PeerId
|
|
95
|
-
* @param {*} connection
|
|
96
|
-
* @param {Map<string, Crypto>} cryptos
|
|
97
|
-
* @returns {Promise<CryptoResult>} An encrypted connection, remote peer `PeerId` and the protocol of the `Crypto` used
|
|
51
|
+
* Attempts to encrypt the incoming `connection` with the provided `cryptos`
|
|
98
52
|
*/
|
|
99
|
-
|
|
53
|
+
_encryptInbound(connection: Duplex<Uint8Array>): Promise<CryptoResult>;
|
|
100
54
|
/**
|
|
101
|
-
* Attempts to encrypt the given `connection` with the provided
|
|
102
|
-
* The first `
|
|
103
|
-
*
|
|
104
|
-
* @private
|
|
105
|
-
* @async
|
|
106
|
-
* @param {PeerId} localPeer - The initiators PeerId
|
|
107
|
-
* @param {MultiaddrConnection} connection
|
|
108
|
-
* @param {PeerId} remotePeerId
|
|
109
|
-
* @param {Map<string, Crypto>} cryptos
|
|
110
|
-
* @returns {Promise<CryptoResult>} An encrypted connection, remote peer `PeerId` and the protocol of the `Crypto` used
|
|
55
|
+
* Attempts to encrypt the given `connection` with the provided connection encrypters.
|
|
56
|
+
* The first `ConnectionEncrypter` module to succeed will be used
|
|
111
57
|
*/
|
|
112
|
-
|
|
58
|
+
_encryptOutbound(connection: MultiaddrConnection, remotePeerId: PeerId): Promise<CryptoResult>;
|
|
113
59
|
/**
|
|
114
60
|
* Selects one of the given muxers via multistream-select. That
|
|
115
61
|
* muxer will be used for all future streams on the connection.
|
|
116
|
-
*
|
|
117
|
-
* @private
|
|
118
|
-
* @async
|
|
119
|
-
* @param {MultiaddrConnection} connection - A basic duplex connection to multiplex
|
|
120
|
-
* @param {Map<string, MuxerFactory>} muxers - The muxers to attempt multiplexing with
|
|
121
|
-
* @returns {Promise<{ stream: MuxedStream, Muxer?: MuxerFactory}>} A muxed connection
|
|
122
62
|
*/
|
|
123
|
-
|
|
63
|
+
_multiplexOutbound(connection: MultiaddrConnection, muxers: Map<string, StreamMuxerFactory>): Promise<{
|
|
64
|
+
stream: Duplex<Uint8Array>;
|
|
65
|
+
muxerFactory?: StreamMuxerFactory;
|
|
66
|
+
}>;
|
|
124
67
|
/**
|
|
125
68
|
* Registers support for one of the given muxers via multistream-select. The
|
|
126
69
|
* selected muxer will be used for all future streams on the connection.
|
|
127
|
-
*
|
|
128
|
-
* @private
|
|
129
|
-
* @async
|
|
130
|
-
* @param {MultiaddrConnection} connection - A basic duplex connection to multiplex
|
|
131
|
-
* @param {Map<string, MuxerFactory>} muxers - The muxers to attempt multiplexing with
|
|
132
|
-
* @returns {Promise<{ stream: MuxedStream, Muxer?: MuxerFactory}>} A muxed connection
|
|
133
70
|
*/
|
|
134
|
-
|
|
71
|
+
_multiplexInbound(connection: MultiaddrConnection, muxers: Map<string, StreamMuxerFactory>): Promise<{
|
|
72
|
+
stream: Duplex<Uint8Array>;
|
|
73
|
+
muxerFactory?: StreamMuxerFactory;
|
|
74
|
+
}>;
|
|
135
75
|
}
|
|
136
|
-
|
|
137
|
-
export { MultiaddrConnection, MuxerFactory, Muxer, MuxedStream, Crypto, Connection, Multiaddr, ConnectionGater, CryptoResult };
|
|
138
|
-
}
|
|
139
|
-
import PeerId = require("peer-id");
|
|
140
|
-
type MultiaddrConnection = import('libp2p-interfaces/src/transport/types').MultiaddrConnection;
|
|
141
|
-
import { Connection } from "libp2p-interfaces/src/connection";
|
|
142
|
-
type ConnectionGater = import('./types').ConnectionGater;
|
|
143
|
-
type MuxerFactory = import('libp2p-interfaces/src/stream-muxer/types').MuxerFactory;
|
|
144
|
-
type Muxer = import('libp2p-interfaces/src/stream-muxer/types').Muxer;
|
|
145
|
-
type MuxedStream = import('libp2p-interfaces/src/stream-muxer/types').MuxedStream;
|
|
146
|
-
type Crypto = import('libp2p-interfaces/src/crypto/types').Crypto;
|
|
147
|
-
type Connection = import("libp2p-interfaces/src/connection/connection");
|
|
148
|
-
type Multiaddr = import('multiaddr').Multiaddr;
|
|
149
|
-
type CryptoResult = {
|
|
150
|
-
/**
|
|
151
|
-
* A duplex iterable
|
|
152
|
-
*/
|
|
153
|
-
conn: MultiaddrConnection;
|
|
154
|
-
remotePeer: PeerId;
|
|
155
|
-
protocol: string;
|
|
156
|
-
};
|
|
76
|
+
export {};
|
|
157
77
|
//# sourceMappingURL=upgrader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrader.d.ts","sourceRoot":"","sources":["../../src/upgrader.
|
|
1
|
+
{"version":3,"file":"upgrader.d.ts","sourceRoot":"","sources":["../../src/upgrader.ts"],"names":[],"mappings":"AAQA,OAAO,EAAe,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAErE,OAAO,KAAK,EAAE,UAAU,EAAkB,MAAM,EAAE,MAAM,+BAA+B,CAAA;AACvF,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AACrG,OAAO,KAAK,EAAe,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AACtF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AACjG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAI/D,UAAU,sBAAsB;IAC9B,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,SAAS,GAAG,UAAU,CAAA;IACjC,MAAM,EAAE,mBAAmB,CAAA;IAC3B,YAAY,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;IAChC,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,kBAAkB,CAAA;CAClC;AAED,UAAU,eAAe;IACvB,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CA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