chore: bump libp2p to 0.40.0

This commit is contained in:
fryorcraken.eth 2022-11-16 15:49:43 +11:00
parent efe5b326a5
commit 9d2df1d620
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
11 changed files with 611 additions and 213 deletions

648
package-lock.json generated
View File

@ -2126,6 +2126,25 @@
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
}
},
"node_modules/@libp2p/bootstrap": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@libp2p/bootstrap/-/bootstrap-5.0.0.tgz",
"integrity": "sha512-3r20rD2coW0k6j7C7EBfRPh3vaUKVKcTmMksesn7ybcNezu8ziEHxZx93BBwnw8sy+ZwSfnUsK/vOtiGWJPAhw==",
"dependencies": {
"@libp2p/interface-peer-discovery": "^1.0.1",
"@libp2p/interface-peer-info": "^1.0.3",
"@libp2p/interface-peer-store": "^1.2.2",
"@libp2p/interfaces": "^3.0.3",
"@libp2p/logger": "^2.0.1",
"@libp2p/peer-id": "^1.1.15",
"@multiformats/mafmt": "^11.0.3",
"@multiformats/multiaddr": "^11.0.0"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/@libp2p/components": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/@libp2p/components/-/components-2.1.1.tgz",
@ -2865,11 +2884,10 @@
}
},
"node_modules/@libp2p/peer-store": {
"version": "3.1.5",
"resolved": "https://registry.npmjs.org/@libp2p/peer-store/-/peer-store-3.1.5.tgz",
"integrity": "sha512-tChz3TqkQj1t0+yugWroeGhHbX+q7e1goVRJQbli4sZ1j5NEAQlxHpPq2yDOOCB5RVvX0oZ8b32999ILOJXbvA==",
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@libp2p/peer-store/-/peer-store-5.0.0.tgz",
"integrity": "sha512-Yz/JykQ9xA0cpv4jIOt9dzYXBAugjoJFPVpA8/LEwU6Y+aUcTIAC3AhOe88QxjYxy4pz+H7C711K2HNCj207jg==",
"dependencies": {
"@libp2p/components": "^2.0.0",
"@libp2p/interface-peer-id": "^1.0.4",
"@libp2p/interface-peer-info": "^1.0.3",
"@libp2p/interface-peer-store": "^1.2.2",
@ -2887,10 +2905,75 @@
"it-map": "^1.0.6",
"it-pipe": "^2.0.3",
"mortice": "^3.0.0",
"multiformats": "^9.6.3",
"protons-runtime": "^3.1.0",
"multiformats": "^10.0.0",
"protons-runtime": "^4.0.1",
"uint8arraylist": "^2.1.1",
"uint8arrays": "^3.1.0"
"uint8arrays": "^4.0.2"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/@libp2p/peer-store/node_modules/long": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/long/-/long-5.2.1.tgz",
"integrity": "sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A=="
},
"node_modules/@libp2p/peer-store/node_modules/multiformats": {
"version": "10.0.2",
"resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz",
"integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==",
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/@libp2p/peer-store/node_modules/protobufjs": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.1.2.tgz",
"integrity": "sha512-4ZPTPkXCdel3+L81yw3dG6+Kq3umdWKh7Dc7GW/CpNk4SX3hK58iPCWeCyhVTDrbkNeKrYNZ7EojM5WDaEWTLQ==",
"hasInstallScript": true,
"dependencies": {
"@protobufjs/aspromise": "^1.1.2",
"@protobufjs/base64": "^1.1.2",
"@protobufjs/codegen": "^2.0.4",
"@protobufjs/eventemitter": "^1.1.0",
"@protobufjs/fetch": "^1.1.0",
"@protobufjs/float": "^1.0.2",
"@protobufjs/inquire": "^1.1.0",
"@protobufjs/path": "^1.1.2",
"@protobufjs/pool": "^1.1.0",
"@protobufjs/utf8": "^1.1.0",
"@types/node": ">=13.7.0",
"long": "^5.0.0"
},
"engines": {
"node": ">=12.0.0"
}
},
"node_modules/@libp2p/peer-store/node_modules/protons-runtime": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/protons-runtime/-/protons-runtime-4.0.1.tgz",
"integrity": "sha512-SPeV+8TzJAp5UJYPV7vJkLRi08CP0DksxpKK60rcNaZSPkMBQwc0jQrmkHqwc5P0cYbZzKsdYrUBwRrDLrzTfQ==",
"dependencies": {
"protobufjs": "^7.0.0",
"uint8arraylist": "^2.3.2"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
},
"peerDependencies": {
"uint8arraylist": "^2.3.2"
}
},
"node_modules/@libp2p/peer-store/node_modules/uint8arrays": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz",
"integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==",
"dependencies": {
"multiformats": "^10.0.0"
},
"engines": {
"node": ">=16.0.0",
@ -10878,11 +10961,24 @@
}
},
"node_modules/it-sort": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/it-sort/-/it-sort-1.0.1.tgz",
"integrity": "sha512-c+C48cP7XMMebB9irLrJs2EmpLILId8NYSojqAqN8etE8ienx0azBgaKvZHYH1DkerqIul0Fl2FqISu2BZgTEQ==",
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/it-sort/-/it-sort-2.0.0.tgz",
"integrity": "sha512-yeAE97b5PEjCrWFUiNyR90eJdGslj8FB3cjT84rsc+mzx9lxPyR2zJkYB9ZOJoWE5MMebxqcQCLRT3OSlzo7Zg==",
"dependencies": {
"it-all": "^1.0.6"
"it-all": "^2.0.0"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/it-sort/node_modules/it-all": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/it-all/-/it-all-2.0.0.tgz",
"integrity": "sha512-I/yi9ogTY59lFxtfsDSlI9w9QZtC/5KJt6g7CPPBJJh2xql2ZS7Ghcp9hoqDDbc4QfwQvtx8Loy0zlKQ8H5gFg==",
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/it-stream-types": {
@ -11502,17 +11598,16 @@
}
},
"node_modules/libp2p": {
"version": "0.39.5",
"resolved": "https://registry.npmjs.org/libp2p/-/libp2p-0.39.5.tgz",
"integrity": "sha512-zF/Tc3IRQ3M+W3wqn6zSICUc6gsdCdXCNjsWMudinfRTia6CnRbj68ZkjrUw0TA1j2bODwD2+CxAFTsn9iS0Nw==",
"version": "0.40.0",
"resolved": "https://registry.npmjs.org/libp2p/-/libp2p-0.40.0.tgz",
"integrity": "sha512-AeLaA+8KIhUhjpXZcs20+Pnf2wIBp+zdSYPD1IgGCF0PlMbTdCvaIqhPzpTSd3+e5k7NZlgpd/BvCOLgQbfm5Q==",
"dependencies": {
"@achingbrain/nat-port-mapper": "^1.0.3",
"@libp2p/components": "^2.1.0",
"@libp2p/connection": "^4.0.2",
"@libp2p/crypto": "^1.0.4",
"@libp2p/interface-address-manager": "^1.0.3",
"@libp2p/interface-address-manager": "^2.0.0",
"@libp2p/interface-connection": "^3.0.2",
"@libp2p/interface-connection-encrypter": "^2.0.1",
"@libp2p/interface-connection-encrypter": "^3.0.1",
"@libp2p/interface-connection-manager": "^1.1.1",
"@libp2p/interface-content-routing": "^1.0.2",
"@libp2p/interface-dht": "^1.0.1",
@ -11522,10 +11617,10 @@
"@libp2p/interface-peer-info": "^1.0.3",
"@libp2p/interface-peer-routing": "^1.0.1",
"@libp2p/interface-peer-store": "^1.2.2",
"@libp2p/interface-pubsub": "^2.1.0",
"@libp2p/interface-pubsub": "^3.0.0",
"@libp2p/interface-registrar": "^2.0.3",
"@libp2p/interface-stream-muxer": "^2.0.2",
"@libp2p/interface-transport": "^1.0.4",
"@libp2p/interface-stream-muxer": "^3.0.0",
"@libp2p/interface-transport": "^2.0.0",
"@libp2p/interfaces": "^3.0.3",
"@libp2p/logger": "^2.0.1",
"@libp2p/multistream-select": "^3.0.0",
@ -11533,7 +11628,7 @@
"@libp2p/peer-id": "^1.1.15",
"@libp2p/peer-id-factory": "^1.0.18",
"@libp2p/peer-record": "^4.0.3",
"@libp2p/peer-store": "^3.1.5",
"@libp2p/peer-store": "^5.0.0",
"@libp2p/tracked-map": "^2.0.1",
"@libp2p/utils": "^3.0.2",
"@multiformats/mafmt": "^11.0.2",
@ -11545,34 +11640,35 @@
"events": "^3.3.0",
"hashlru": "^2.3.0",
"interface-datastore": "^7.0.0",
"it-all": "^1.0.6",
"it-drain": "^1.0.5",
"it-filter": "^1.0.3",
"it-first": "^1.0.6",
"it-foreach": "^0.1.1",
"it-all": "^2.0.0",
"it-drain": "^2.0.0",
"it-filter": "^2.0.0",
"it-first": "^2.0.0",
"it-foreach": "^1.0.0",
"it-handshake": "^4.1.2",
"it-length-prefixed": "^8.0.2",
"it-map": "^1.0.6",
"it-merge": "^1.0.3",
"it-map": "^2.0.0",
"it-merge": "^2.0.0",
"it-pair": "^2.0.2",
"it-pipe": "^2.0.3",
"it-sort": "^1.0.1",
"it-sort": "^2.0.0",
"it-stream-types": "^1.0.4",
"merge-options": "^3.0.4",
"multiformats": "^9.6.3",
"multiformats": "^10.0.0",
"mutable-proxy": "^1.0.0",
"node-forge": "^1.3.1",
"p-fifo": "^1.0.0",
"p-retry": "^5.0.0",
"p-settle": "^5.0.0",
"private-ip": "^2.3.3",
"protons-runtime": "^3.0.1",
"protons-runtime": "^4.0.1",
"rate-limiter-flexible": "^2.3.11",
"retimer": "^3.0.0",
"sanitize-filename": "^1.6.3",
"set-delayed-interval": "^1.0.0",
"timeout-abort-controller": "^3.0.0",
"uint8arraylist": "^2.3.2",
"uint8arrays": "^3.0.0",
"uint8arrays": "^4.0.2",
"wherearewe": "^2.0.0",
"xsalsa20": "^1.1.0"
},
@ -11581,6 +11677,210 @@
"npm": ">=7.0.0"
}
},
"node_modules/libp2p/node_modules/@libp2p/interface-address-manager": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@libp2p/interface-address-manager/-/interface-address-manager-2.0.1.tgz",
"integrity": "sha512-JjlQUJ0cF1h0wsOS22PNRQiiiMLwftd5QttjJK2jDsou5FkZETeQ9eYL05I0ykQKZvEJqwH8G5WLwxWtwsj7Ag==",
"dependencies": {
"@libp2p/interfaces": "^3.0.0",
"@multiformats/multiaddr": "^11.0.0"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/libp2p/node_modules/@libp2p/interface-connection-encrypter": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@libp2p/interface-connection-encrypter/-/interface-connection-encrypter-3.0.2.tgz",
"integrity": "sha512-7b4t1aW3xbPcq3ORBi/nplIia8X7mdHlUg4SRWs92fDNciFwm1NUr63aVVs9WMwXmN3XB9UNbxKrrrXAWHRuHw==",
"dependencies": {
"@libp2p/interface-peer-id": "^1.0.0",
"it-stream-types": "^1.0.4",
"uint8arraylist": "^2.1.2"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/libp2p/node_modules/@libp2p/interface-pubsub": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@libp2p/interface-pubsub/-/interface-pubsub-3.0.1.tgz",
"integrity": "sha512-VLMr6Mn8e2m2moda3dGNbsAkWjPoENBebJIzFV7QDd9NOKwNiAs59vIoNi2n+y5XzUBmgBeKeFB8G03/m0NOdA==",
"dependencies": {
"@libp2p/interface-connection": "^3.0.0",
"@libp2p/interface-peer-id": "^1.0.0",
"@libp2p/interfaces": "^3.0.0",
"it-pushable": "^3.0.0",
"uint8arraylist": "^2.1.2"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/libp2p/node_modules/@libp2p/interface-stream-muxer": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@libp2p/interface-stream-muxer/-/interface-stream-muxer-3.0.1.tgz",
"integrity": "sha512-HlIZFMMSYTKOKn5VBw8UHQ5qya6oWSqpP2ygtSoB/nbBcC/3mv/4cbvozJUAGrOrDz01YY3QOB2LJ6R1b0EWCQ==",
"dependencies": {
"@libp2p/interface-connection": "^3.0.0",
"@libp2p/interfaces": "^3.0.0",
"it-stream-types": "^1.0.4"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/libp2p/node_modules/@libp2p/interface-transport": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@libp2p/interface-transport/-/interface-transport-2.0.1.tgz",
"integrity": "sha512-yrL6YZmPQX4JT/E/60XgNgNSCu9tNPjjq2HuWZs1n1k8cstV0/WvViUE8aoOlJlKZSVjQNcpRAy9LgVxznK7/g==",
"dependencies": {
"@libp2p/interface-connection": "^3.0.0",
"@libp2p/interface-stream-muxer": "^3.0.0",
"@libp2p/interfaces": "^3.0.0",
"@multiformats/multiaddr": "^11.0.0",
"it-stream-types": "^1.0.4"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/libp2p/node_modules/it-all": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/it-all/-/it-all-2.0.0.tgz",
"integrity": "sha512-I/yi9ogTY59lFxtfsDSlI9w9QZtC/5KJt6g7CPPBJJh2xql2ZS7Ghcp9hoqDDbc4QfwQvtx8Loy0zlKQ8H5gFg==",
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/libp2p/node_modules/it-drain": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/it-drain/-/it-drain-2.0.0.tgz",
"integrity": "sha512-oa/5iyBtRs9UW486vPpyDTC0ee3rqx5qlrPI7txIUJcqqtiO5yVozEB6LQrl5ysQYv+P3y/dlKEqwVqlCV0SEA==",
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/libp2p/node_modules/it-filter": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/it-filter/-/it-filter-2.0.0.tgz",
"integrity": "sha512-E68+zzoNNI7MxdH1T4lUTgwpCyEnymlH349Qg2mcvsqLmYRkaZLM4NfZZ0hUuH7/5DkWXubQSDOYH396va8mpg==",
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/libp2p/node_modules/it-first": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/it-first/-/it-first-2.0.0.tgz",
"integrity": "sha512-fzZGzVf01exFyIZXNjkpSMFr1eW2+J1K0v018tYY26Dd4f/O3pWlBTdrOBfSQRZwtI8Pst6c7eKhYczWvFs6tA==",
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/libp2p/node_modules/it-foreach": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/it-foreach/-/it-foreach-1.0.0.tgz",
"integrity": "sha512-2j5HK1P6aMwEvgL6K5nzUwOk+81B/mjt05PxiSspFEKwJnqy1LfJYlLLS6llBoM+NdoUxf6EsBCHidFGmsXvhw==",
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/libp2p/node_modules/it-map": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/it-map/-/it-map-2.0.0.tgz",
"integrity": "sha512-mLgtk/NZaN7NZ06iLrMXCA6jjhtZO0vZT5Ocsp31H+nsGI18RSPVmUbFyA1sWx7q+g92J22Sixya7T2QSSAwfA==",
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/libp2p/node_modules/it-merge": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/it-merge/-/it-merge-2.0.0.tgz",
"integrity": "sha512-mH4bo/ZrMoU+Wlu7ZuYPNNh9oWZ/GvYbeXZ0zll97+Rp6H4jFu98iu6v9qqXDz//RUjdO9zGh8awzMfOElsjpA==",
"dependencies": {
"it-pushable": "^3.1.0"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/libp2p/node_modules/long": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/long/-/long-5.2.1.tgz",
"integrity": "sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A=="
},
"node_modules/libp2p/node_modules/multiformats": {
"version": "10.0.2",
"resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz",
"integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A==",
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/libp2p/node_modules/protobufjs": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.1.2.tgz",
"integrity": "sha512-4ZPTPkXCdel3+L81yw3dG6+Kq3umdWKh7Dc7GW/CpNk4SX3hK58iPCWeCyhVTDrbkNeKrYNZ7EojM5WDaEWTLQ==",
"hasInstallScript": true,
"dependencies": {
"@protobufjs/aspromise": "^1.1.2",
"@protobufjs/base64": "^1.1.2",
"@protobufjs/codegen": "^2.0.4",
"@protobufjs/eventemitter": "^1.1.0",
"@protobufjs/fetch": "^1.1.0",
"@protobufjs/float": "^1.0.2",
"@protobufjs/inquire": "^1.1.0",
"@protobufjs/path": "^1.1.2",
"@protobufjs/pool": "^1.1.0",
"@protobufjs/utf8": "^1.1.0",
"@types/node": ">=13.7.0",
"long": "^5.0.0"
},
"engines": {
"node": ">=12.0.0"
}
},
"node_modules/libp2p/node_modules/protons-runtime": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/protons-runtime/-/protons-runtime-4.0.1.tgz",
"integrity": "sha512-SPeV+8TzJAp5UJYPV7vJkLRi08CP0DksxpKK60rcNaZSPkMBQwc0jQrmkHqwc5P0cYbZzKsdYrUBwRrDLrzTfQ==",
"dependencies": {
"protobufjs": "^7.0.0",
"uint8arraylist": "^2.3.2"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
},
"peerDependencies": {
"uint8arraylist": "^2.3.2"
}
},
"node_modules/libp2p/node_modules/uint8arrays": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz",
"integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==",
"dependencies": {
"multiformats": "^10.0.0"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/lilconfig": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.5.tgz",
@ -21913,7 +22213,7 @@
"it-all": "^1.0.6",
"it-length-prefixed": "^8.0.2",
"it-pipe": "^2.0.4",
"libp2p": "0.39.5",
"libp2p": "0.40.0",
"p-event": "^5.0.1",
"protons-runtime": "^3.1.0",
"uint8arraylist": "^2.3.2",
@ -21997,6 +22297,7 @@
"license": "MIT OR Apache-2.0",
"dependencies": {
"@chainsafe/libp2p-noise": "^8.0.1",
"@libp2p/bootstrap": "^5.0.0",
"@libp2p/interface-peer-discovery": "^1.0.0",
"@libp2p/mplex": "^5.1.1",
"@libp2p/websockets": "^3.0.3",
@ -22160,7 +22461,7 @@
"@libp2p/interface-peer-id": "^1.0.5",
"@libp2p/interface-peer-store": "^1.2.2",
"@multiformats/multiaddr": "^11.0.6",
"libp2p": "0.39.5"
"libp2p": "0.40.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.8.1",
@ -22229,6 +22530,7 @@
"@waku/message-encryption": "*"
},
"devDependencies": {
"@libp2p/bootstrap": "^5.0.0",
"@typescript-eslint/eslint-plugin": "^5.8.1",
"@typescript-eslint/parser": "^5.8.1",
"cspell": "^5.14.0",
@ -24003,6 +24305,21 @@
}
}
},
"@libp2p/bootstrap": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@libp2p/bootstrap/-/bootstrap-5.0.0.tgz",
"integrity": "sha512-3r20rD2coW0k6j7C7EBfRPh3vaUKVKcTmMksesn7ybcNezu8ziEHxZx93BBwnw8sy+ZwSfnUsK/vOtiGWJPAhw==",
"requires": {
"@libp2p/interface-peer-discovery": "^1.0.1",
"@libp2p/interface-peer-info": "^1.0.3",
"@libp2p/interface-peer-store": "^1.2.2",
"@libp2p/interfaces": "^3.0.3",
"@libp2p/logger": "^2.0.1",
"@libp2p/peer-id": "^1.1.15",
"@multiformats/mafmt": "^11.0.3",
"@multiformats/multiaddr": "^11.0.0"
}
},
"@libp2p/components": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/@libp2p/components/-/components-2.1.1.tgz",
@ -24555,11 +24872,10 @@
}
},
"@libp2p/peer-store": {
"version": "3.1.5",
"resolved": "https://registry.npmjs.org/@libp2p/peer-store/-/peer-store-3.1.5.tgz",
"integrity": "sha512-tChz3TqkQj1t0+yugWroeGhHbX+q7e1goVRJQbli4sZ1j5NEAQlxHpPq2yDOOCB5RVvX0oZ8b32999ILOJXbvA==",
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@libp2p/peer-store/-/peer-store-5.0.0.tgz",
"integrity": "sha512-Yz/JykQ9xA0cpv4jIOt9dzYXBAugjoJFPVpA8/LEwU6Y+aUcTIAC3AhOe88QxjYxy4pz+H7C711K2HNCj207jg==",
"requires": {
"@libp2p/components": "^2.0.0",
"@libp2p/interface-peer-id": "^1.0.4",
"@libp2p/interface-peer-info": "^1.0.3",
"@libp2p/interface-peer-store": "^1.2.2",
@ -24577,10 +24893,58 @@
"it-map": "^1.0.6",
"it-pipe": "^2.0.3",
"mortice": "^3.0.0",
"multiformats": "^9.6.3",
"protons-runtime": "^3.1.0",
"multiformats": "^10.0.0",
"protons-runtime": "^4.0.1",
"uint8arraylist": "^2.1.1",
"uint8arrays": "^3.1.0"
"uint8arrays": "^4.0.2"
},
"dependencies": {
"long": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/long/-/long-5.2.1.tgz",
"integrity": "sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A=="
},
"multiformats": {
"version": "10.0.2",
"resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz",
"integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A=="
},
"protobufjs": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.1.2.tgz",
"integrity": "sha512-4ZPTPkXCdel3+L81yw3dG6+Kq3umdWKh7Dc7GW/CpNk4SX3hK58iPCWeCyhVTDrbkNeKrYNZ7EojM5WDaEWTLQ==",
"requires": {
"@protobufjs/aspromise": "^1.1.2",
"@protobufjs/base64": "^1.1.2",
"@protobufjs/codegen": "^2.0.4",
"@protobufjs/eventemitter": "^1.1.0",
"@protobufjs/fetch": "^1.1.0",
"@protobufjs/float": "^1.0.2",
"@protobufjs/inquire": "^1.1.0",
"@protobufjs/path": "^1.1.2",
"@protobufjs/pool": "^1.1.0",
"@protobufjs/utf8": "^1.1.0",
"@types/node": ">=13.7.0",
"long": "^5.0.0"
}
},
"protons-runtime": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/protons-runtime/-/protons-runtime-4.0.1.tgz",
"integrity": "sha512-SPeV+8TzJAp5UJYPV7vJkLRi08CP0DksxpKK60rcNaZSPkMBQwc0jQrmkHqwc5P0cYbZzKsdYrUBwRrDLrzTfQ==",
"requires": {
"protobufjs": "^7.0.0",
"uint8arraylist": "^2.3.2"
}
},
"uint8arrays": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz",
"integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==",
"requires": {
"multiformats": "^10.0.0"
}
}
}
},
"@libp2p/pubsub": {
@ -26299,7 +26663,7 @@
"karma-chrome-launcher": "^3.1.0",
"karma-mocha": "^2.0.1",
"karma-webpack": "^5.0.0",
"libp2p": "0.39.5",
"libp2p": "0.40.0",
"mocha": "^9.1.3",
"npm-run-all": "^4.1.5",
"p-event": "^5.0.1",
@ -26339,6 +26703,7 @@
"version": "file:packages/create",
"requires": {
"@chainsafe/libp2p-noise": "^8.0.1",
"@libp2p/bootstrap": "^5.0.0",
"@libp2p/interface-peer-discovery": "^1.0.0",
"@libp2p/mplex": "^5.1.1",
"@libp2p/websockets": "^3.0.3",
@ -26478,7 +26843,7 @@
"eslint-plugin-functional": "^4.0.2",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-prettier": "^4.0.0",
"libp2p": "0.39.5",
"libp2p": "0.40.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.1.1",
"typescript": "^4.6.3"
@ -26516,6 +26881,7 @@
"@waku/tests": {
"version": "file:packages/tests",
"requires": {
"@libp2p/bootstrap": "*",
"@typescript-eslint/eslint-plugin": "^5.8.1",
"@typescript-eslint/parser": "^5.8.1",
"@waku/byte-utils": "*",
@ -31076,11 +31442,18 @@
}
},
"it-sort": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/it-sort/-/it-sort-1.0.1.tgz",
"integrity": "sha512-c+C48cP7XMMebB9irLrJs2EmpLILId8NYSojqAqN8etE8ienx0azBgaKvZHYH1DkerqIul0Fl2FqISu2BZgTEQ==",
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/it-sort/-/it-sort-2.0.0.tgz",
"integrity": "sha512-yeAE97b5PEjCrWFUiNyR90eJdGslj8FB3cjT84rsc+mzx9lxPyR2zJkYB9ZOJoWE5MMebxqcQCLRT3OSlzo7Zg==",
"requires": {
"it-all": "^1.0.6"
"it-all": "^2.0.0"
},
"dependencies": {
"it-all": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/it-all/-/it-all-2.0.0.tgz",
"integrity": "sha512-I/yi9ogTY59lFxtfsDSlI9w9QZtC/5KJt6g7CPPBJJh2xql2ZS7Ghcp9hoqDDbc4QfwQvtx8Loy0zlKQ8H5gFg=="
}
}
},
"it-stream-types": {
@ -31588,17 +31961,16 @@
}
},
"libp2p": {
"version": "0.39.5",
"resolved": "https://registry.npmjs.org/libp2p/-/libp2p-0.39.5.tgz",
"integrity": "sha512-zF/Tc3IRQ3M+W3wqn6zSICUc6gsdCdXCNjsWMudinfRTia6CnRbj68ZkjrUw0TA1j2bODwD2+CxAFTsn9iS0Nw==",
"version": "0.40.0",
"resolved": "https://registry.npmjs.org/libp2p/-/libp2p-0.40.0.tgz",
"integrity": "sha512-AeLaA+8KIhUhjpXZcs20+Pnf2wIBp+zdSYPD1IgGCF0PlMbTdCvaIqhPzpTSd3+e5k7NZlgpd/BvCOLgQbfm5Q==",
"requires": {
"@achingbrain/nat-port-mapper": "^1.0.3",
"@libp2p/components": "^2.1.0",
"@libp2p/connection": "^4.0.2",
"@libp2p/crypto": "^1.0.4",
"@libp2p/interface-address-manager": "^1.0.3",
"@libp2p/interface-address-manager": "^2.0.0",
"@libp2p/interface-connection": "^3.0.2",
"@libp2p/interface-connection-encrypter": "^2.0.1",
"@libp2p/interface-connection-encrypter": "^3.0.1",
"@libp2p/interface-connection-manager": "^1.1.1",
"@libp2p/interface-content-routing": "^1.0.2",
"@libp2p/interface-dht": "^1.0.1",
@ -31608,10 +31980,10 @@
"@libp2p/interface-peer-info": "^1.0.3",
"@libp2p/interface-peer-routing": "^1.0.1",
"@libp2p/interface-peer-store": "^1.2.2",
"@libp2p/interface-pubsub": "^2.1.0",
"@libp2p/interface-pubsub": "^3.0.0",
"@libp2p/interface-registrar": "^2.0.3",
"@libp2p/interface-stream-muxer": "^2.0.2",
"@libp2p/interface-transport": "^1.0.4",
"@libp2p/interface-stream-muxer": "^3.0.0",
"@libp2p/interface-transport": "^2.0.0",
"@libp2p/interfaces": "^3.0.3",
"@libp2p/logger": "^2.0.1",
"@libp2p/multistream-select": "^3.0.0",
@ -31619,7 +31991,7 @@
"@libp2p/peer-id": "^1.1.15",
"@libp2p/peer-id-factory": "^1.0.18",
"@libp2p/peer-record": "^4.0.3",
"@libp2p/peer-store": "^3.1.5",
"@libp2p/peer-store": "^5.0.0",
"@libp2p/tracked-map": "^2.0.1",
"@libp2p/utils": "^3.0.2",
"@multiformats/mafmt": "^11.0.2",
@ -31631,36 +32003,176 @@
"events": "^3.3.0",
"hashlru": "^2.3.0",
"interface-datastore": "^7.0.0",
"it-all": "^1.0.6",
"it-drain": "^1.0.5",
"it-filter": "^1.0.3",
"it-first": "^1.0.6",
"it-foreach": "^0.1.1",
"it-all": "^2.0.0",
"it-drain": "^2.0.0",
"it-filter": "^2.0.0",
"it-first": "^2.0.0",
"it-foreach": "^1.0.0",
"it-handshake": "^4.1.2",
"it-length-prefixed": "^8.0.2",
"it-map": "^1.0.6",
"it-merge": "^1.0.3",
"it-map": "^2.0.0",
"it-merge": "^2.0.0",
"it-pair": "^2.0.2",
"it-pipe": "^2.0.3",
"it-sort": "^1.0.1",
"it-sort": "^2.0.0",
"it-stream-types": "^1.0.4",
"merge-options": "^3.0.4",
"multiformats": "^9.6.3",
"multiformats": "^10.0.0",
"mutable-proxy": "^1.0.0",
"node-forge": "^1.3.1",
"p-fifo": "^1.0.0",
"p-retry": "^5.0.0",
"p-settle": "^5.0.0",
"private-ip": "^2.3.3",
"protons-runtime": "^3.0.1",
"protons-runtime": "^4.0.1",
"rate-limiter-flexible": "^2.3.11",
"retimer": "^3.0.0",
"sanitize-filename": "^1.6.3",
"set-delayed-interval": "^1.0.0",
"timeout-abort-controller": "^3.0.0",
"uint8arraylist": "^2.3.2",
"uint8arrays": "^3.0.0",
"uint8arrays": "^4.0.2",
"wherearewe": "^2.0.0",
"xsalsa20": "^1.1.0"
},
"dependencies": {
"@libp2p/interface-address-manager": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@libp2p/interface-address-manager/-/interface-address-manager-2.0.1.tgz",
"integrity": "sha512-JjlQUJ0cF1h0wsOS22PNRQiiiMLwftd5QttjJK2jDsou5FkZETeQ9eYL05I0ykQKZvEJqwH8G5WLwxWtwsj7Ag==",
"requires": {
"@libp2p/interfaces": "^3.0.0",
"@multiformats/multiaddr": "^11.0.0"
}
},
"@libp2p/interface-connection-encrypter": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@libp2p/interface-connection-encrypter/-/interface-connection-encrypter-3.0.2.tgz",
"integrity": "sha512-7b4t1aW3xbPcq3ORBi/nplIia8X7mdHlUg4SRWs92fDNciFwm1NUr63aVVs9WMwXmN3XB9UNbxKrrrXAWHRuHw==",
"requires": {
"@libp2p/interface-peer-id": "^1.0.0",
"it-stream-types": "^1.0.4",
"uint8arraylist": "^2.1.2"
}
},
"@libp2p/interface-pubsub": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@libp2p/interface-pubsub/-/interface-pubsub-3.0.1.tgz",
"integrity": "sha512-VLMr6Mn8e2m2moda3dGNbsAkWjPoENBebJIzFV7QDd9NOKwNiAs59vIoNi2n+y5XzUBmgBeKeFB8G03/m0NOdA==",
"requires": {
"@libp2p/interface-connection": "^3.0.0",
"@libp2p/interface-peer-id": "^1.0.0",
"@libp2p/interfaces": "^3.0.0",
"it-pushable": "^3.0.0",
"uint8arraylist": "^2.1.2"
}
},
"@libp2p/interface-stream-muxer": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@libp2p/interface-stream-muxer/-/interface-stream-muxer-3.0.1.tgz",
"integrity": "sha512-HlIZFMMSYTKOKn5VBw8UHQ5qya6oWSqpP2ygtSoB/nbBcC/3mv/4cbvozJUAGrOrDz01YY3QOB2LJ6R1b0EWCQ==",
"requires": {
"@libp2p/interface-connection": "^3.0.0",
"@libp2p/interfaces": "^3.0.0",
"it-stream-types": "^1.0.4"
}
},
"@libp2p/interface-transport": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@libp2p/interface-transport/-/interface-transport-2.0.1.tgz",
"integrity": "sha512-yrL6YZmPQX4JT/E/60XgNgNSCu9tNPjjq2HuWZs1n1k8cstV0/WvViUE8aoOlJlKZSVjQNcpRAy9LgVxznK7/g==",
"requires": {
"@libp2p/interface-connection": "^3.0.0",
"@libp2p/interface-stream-muxer": "^3.0.0",
"@libp2p/interfaces": "^3.0.0",
"@multiformats/multiaddr": "^11.0.0",
"it-stream-types": "^1.0.4"
}
},
"it-all": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/it-all/-/it-all-2.0.0.tgz",
"integrity": "sha512-I/yi9ogTY59lFxtfsDSlI9w9QZtC/5KJt6g7CPPBJJh2xql2ZS7Ghcp9hoqDDbc4QfwQvtx8Loy0zlKQ8H5gFg=="
},
"it-drain": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/it-drain/-/it-drain-2.0.0.tgz",
"integrity": "sha512-oa/5iyBtRs9UW486vPpyDTC0ee3rqx5qlrPI7txIUJcqqtiO5yVozEB6LQrl5ysQYv+P3y/dlKEqwVqlCV0SEA=="
},
"it-filter": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/it-filter/-/it-filter-2.0.0.tgz",
"integrity": "sha512-E68+zzoNNI7MxdH1T4lUTgwpCyEnymlH349Qg2mcvsqLmYRkaZLM4NfZZ0hUuH7/5DkWXubQSDOYH396va8mpg=="
},
"it-first": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/it-first/-/it-first-2.0.0.tgz",
"integrity": "sha512-fzZGzVf01exFyIZXNjkpSMFr1eW2+J1K0v018tYY26Dd4f/O3pWlBTdrOBfSQRZwtI8Pst6c7eKhYczWvFs6tA=="
},
"it-foreach": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/it-foreach/-/it-foreach-1.0.0.tgz",
"integrity": "sha512-2j5HK1P6aMwEvgL6K5nzUwOk+81B/mjt05PxiSspFEKwJnqy1LfJYlLLS6llBoM+NdoUxf6EsBCHidFGmsXvhw=="
},
"it-map": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/it-map/-/it-map-2.0.0.tgz",
"integrity": "sha512-mLgtk/NZaN7NZ06iLrMXCA6jjhtZO0vZT5Ocsp31H+nsGI18RSPVmUbFyA1sWx7q+g92J22Sixya7T2QSSAwfA=="
},
"it-merge": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/it-merge/-/it-merge-2.0.0.tgz",
"integrity": "sha512-mH4bo/ZrMoU+Wlu7ZuYPNNh9oWZ/GvYbeXZ0zll97+Rp6H4jFu98iu6v9qqXDz//RUjdO9zGh8awzMfOElsjpA==",
"requires": {
"it-pushable": "^3.1.0"
}
},
"long": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/long/-/long-5.2.1.tgz",
"integrity": "sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A=="
},
"multiformats": {
"version": "10.0.2",
"resolved": "https://registry.npmjs.org/multiformats/-/multiformats-10.0.2.tgz",
"integrity": "sha512-nJEHLFOYhO4L+aNApHhCnWqa31FyqAHv9Q77AhmwU3KsM2f1j7tuJpCk5ByZ33smzycNCpSG5klNIejIyfFx2A=="
},
"protobufjs": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.1.2.tgz",
"integrity": "sha512-4ZPTPkXCdel3+L81yw3dG6+Kq3umdWKh7Dc7GW/CpNk4SX3hK58iPCWeCyhVTDrbkNeKrYNZ7EojM5WDaEWTLQ==",
"requires": {
"@protobufjs/aspromise": "^1.1.2",
"@protobufjs/base64": "^1.1.2",
"@protobufjs/codegen": "^2.0.4",
"@protobufjs/eventemitter": "^1.1.0",
"@protobufjs/fetch": "^1.1.0",
"@protobufjs/float": "^1.0.2",
"@protobufjs/inquire": "^1.1.0",
"@protobufjs/path": "^1.1.2",
"@protobufjs/pool": "^1.1.0",
"@protobufjs/utf8": "^1.1.0",
"@types/node": ">=13.7.0",
"long": "^5.0.0"
}
},
"protons-runtime": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/protons-runtime/-/protons-runtime-4.0.1.tgz",
"integrity": "sha512-SPeV+8TzJAp5UJYPV7vJkLRi08CP0DksxpKK60rcNaZSPkMBQwc0jQrmkHqwc5P0cYbZzKsdYrUBwRrDLrzTfQ==",
"requires": {
"protobufjs": "^7.0.0",
"uint8arraylist": "^2.3.2"
}
},
"uint8arrays": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.2.tgz",
"integrity": "sha512-8CWXXZdOvVrIL4SeY/Gnp+idxxiGK4XFkP4FY26Sx/fpTz/b6vv4BVWELMDzQweSyyhdcuAcU14H6izzB6k1Cw==",
"requires": {
"multiformats": "^10.0.0"
}
}
}
},
"lilconfig": {

View File

@ -11,6 +11,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Waku Message `ephemeral` field to mark messages as do-not-store.
### Changed
- Bumped `libp2p` to 0.40.0.
### Removed
- `PeerDiscoveryStaticPeer` has been removed, use `@libp2p/bootstrap` instead.
## @waku/core [0.0.5](https://github.com/waku-org/js-waku/compare/@waku/core@0.0.4...@waku/core@0.0.5) (2022-11-11)
### Changed

View File

@ -9,10 +9,6 @@
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
},
"./lib/peer_discovery_static_list": {
"types": "./dist/lib/peer_discovery_static_list.d.ts",
"import": "./dist/lib/peer_discovery_static_list.js"
},
"./lib/predefined_bootstrap_nodes": {
"types": "./dist/lib/predefined_bootstrap_nodes.d.ts",
"import": "./dist/lib/predefined_bootstrap_nodes.js"
@ -102,7 +98,7 @@
"it-all": "^1.0.6",
"it-length-prefixed": "^8.0.2",
"it-pipe": "^2.0.4",
"libp2p": "0.39.5",
"libp2p": "0.40.0",
"p-event": "^5.0.1",
"protons-runtime": "^3.1.0",
"uint8arraylist": "^2.3.2",

View File

@ -5,7 +5,6 @@ import json from "@rollup/plugin-json";
export default {
input: {
index: "dist/index.js",
"lib/peer_discovery_static_list": "dist/lib/peer_discovery_static_list.js",
"lib/predefined_bootstrap_nodes": "dist/lib/predefined_bootstrap_nodes.js",
"lib/wait_for_remote_peer": "dist/lib/wait_for_remote_peer.js",
"lib/waku_message/version_0": "dist/lib/waku_message/version_0.js",

View File

@ -1,118 +0,0 @@
import type {
PeerDiscovery,
PeerDiscoveryEvents,
} from "@libp2p/interface-peer-discovery";
import { symbol } from "@libp2p/interface-peer-discovery";
import type { PeerInfo } from "@libp2p/interface-peer-info";
import { CustomEvent, EventEmitter } from "@libp2p/interfaces/events";
import type { Multiaddr } from "@multiformats/multiaddr";
import { multiaddr } from "@multiformats/multiaddr";
import debug from "debug";
import { multiaddrsToPeerInfo } from "./multiaddr_to_peer_info";
import { getPseudoRandomSubset } from "./random_subset";
const log = debug("waku:peer-discovery-static-list");
export interface Options {
/**
* The maximum of peers to connect to as part of the bootstrap process.
*
* @default The length of the passed `peers` array.
*/
maxPeers?: number;
/**
* The interval between emitting addresses in milliseconds.
*
* @default {@link PeerDiscoveryStaticPeers.DefaultInterval}
*/
interval?: number;
}
/**
* Pass a list of multiaddr that will be used to bootstrap a node.
*/
export class PeerDiscoveryStaticPeers
extends EventEmitter<PeerDiscoveryEvents>
implements PeerDiscovery
{
static DefaultInterval = 200;
private readonly peers: PeerInfo[];
private timer?: ReturnType<typeof setInterval>;
private readonly interval: number;
/**
* @param peers Multiaddrs of peers to connect to.
* @param opts
*/
constructor(peers: string[] | Multiaddr[], opts?: Options) {
super();
this.interval = opts?.interval ?? PeerDiscoveryStaticPeers.DefaultInterval;
const maxPeers = opts?.maxPeers ?? peers?.length;
const peerMas = peers.map((peer: string | Multiaddr) => {
if (typeof peer === "string") {
return multiaddr(peer);
} else {
return peer;
}
});
this.peers = multiaddrsToPeerInfo(getPseudoRandomSubset(peerMas, maxPeers));
log(
"Use provided list of peers (reduced to maxPeers)",
this.peers.map((ma) => ma.toString())
);
}
/**
* Start emitting static peers.
*/
start(): void {
this._startTimer();
}
private _startTimer(): void {
if (this.peers) {
log("Starting to emit static peers.");
if (this.timer != null) {
return;
}
this.timer = setInterval(() => this._returnPeers(), this.interval);
this._returnPeers();
}
}
_returnPeers(): void {
if (this.timer == null) {
return;
}
this.peers.forEach((peerData) => {
this.dispatchEvent(
new CustomEvent<PeerInfo>("peer", { detail: peerData })
);
});
}
/**
* Stop emitting peers.
*/
stop(): void {
if (this.timer != null) {
clearInterval(this.timer);
}
this.timer = undefined;
}
get [symbol](): true {
return true;
}
get [Symbol.toStringTag](): string {
return "@waku/peer-discovery-static-list";
}
}

View File

@ -1,6 +1,3 @@
import type { Multiaddr } from "@multiformats/multiaddr";
import { multiaddr } from "@multiformats/multiaddr";
import { getPseudoRandomSubset } from "./random_subset";
export const DefaultWantedNumber = 1;
@ -23,7 +20,7 @@ export enum Fleet {
export function getPredefinedBootstrapNodes(
fleet: Fleet = Fleet.Prod,
wantedNumber: number = DefaultWantedNumber
): Multiaddr[] {
): string[] {
if (wantedNumber <= 0) {
return [];
}
@ -42,7 +39,6 @@ export function getPredefinedBootstrapNodes(
nodes = Object.values(nodes) as string[];
nodes = nodes.map((node: string) => multiaddr(node));
return getPseudoRandomSubset(nodes, wantedNumber);
}

View File

@ -50,12 +50,13 @@
"node": ">=16"
},
"dependencies": {
"@waku/core": "*",
"@waku/interfaces": "*",
"@chainsafe/libp2p-noise": "^8.0.1",
"@libp2p/bootstrap": "^5.0.0",
"@libp2p/interface-peer-discovery": "^1.0.0",
"@libp2p/mplex": "^5.1.1",
"@libp2p/websockets": "^3.0.3"
"@libp2p/websockets": "^3.0.3",
"@waku/core": "*",
"@waku/interfaces": "*"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^22.0.0",

View File

@ -1,4 +1,6 @@
import { Noise } from "@chainsafe/libp2p-noise";
import { bootstrap } from "@libp2p/bootstrap";
import type { BootstrapComponents } from "@libp2p/bootstrap";
import type { PeerDiscovery } from "@libp2p/interface-peer-discovery";
import { Mplex } from "@libp2p/mplex";
import { WebSockets } from "@libp2p/websockets";
@ -12,7 +14,6 @@ import {
WakuRelay,
WakuStore,
} from "@waku/core";
import { PeerDiscoveryStaticPeers } from "@waku/core/lib/peer_discovery_static_list";
import { getPredefinedBootstrapNodes } from "@waku/core/lib/predefined_bootstrap_nodes";
import type { WakuFull, WakuLight, WakuPrivacy } from "@waku/interfaces";
import type { Libp2p } from "libp2p";
@ -143,8 +144,10 @@ export async function createFullNode(
) as WakuFull;
}
export function defaultPeerDiscovery(): PeerDiscovery {
return new PeerDiscoveryStaticPeers(getPredefinedBootstrapNodes());
export function defaultPeerDiscovery(): (
components: BootstrapComponents
) => PeerDiscovery {
return bootstrap({ list: getPredefinedBootstrapNodes() });
}
export async function defaultLibp2p(

View File

@ -53,7 +53,7 @@
"@libp2p/interface-peer-id": "^1.0.5",
"@libp2p/interface-peer-store": "^1.2.2",
"@multiformats/multiaddr": "^11.0.6",
"libp2p": "0.39.5"
"libp2p": "0.40.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.8.1",

View File

@ -55,14 +55,15 @@
"node": ">=16"
},
"dependencies": {
"@waku/core": "*",
"@waku/enr": "*",
"@waku/create": "*",
"@waku/interfaces": "*",
"@waku/byte-utils": "*",
"@waku/core": "*",
"@waku/create": "*",
"@waku/enr": "*",
"@waku/interfaces": "*",
"@waku/message-encryption": "*"
},
"devDependencies": {
"@libp2p/bootstrap": "^5.0.0",
"@typescript-eslint/eslint-plugin": "^5.8.1",
"@typescript-eslint/parser": "^5.8.1",
"cspell": "^5.14.0",

View File

@ -1,6 +1,6 @@
import { bootstrap } from "@libp2p/bootstrap";
import type { PeerId } from "@libp2p/interface-peer-id";
import { bytesToUtf8, utf8ToBytes } from "@waku/byte-utils";
import { PeerDiscoveryStaticPeers } from "@waku/core/lib/peer_discovery_static_list";
import { waitForRemotePeer } from "@waku/core/lib/wait_for_remote_peer";
import { createLightNode, createPrivacyNode } from "@waku/create";
import type {
@ -71,7 +71,7 @@ describe("Waku Dial [node only]", function () {
waku = await createLightNode({
staticNoiseKey: NOISE_KEY_1,
libp2p: {
peerDiscovery: [new PeerDiscoveryStaticPeers([multiAddrWithId])],
peerDiscovery: [bootstrap({ list: [multiAddrWithId.toString()] })],
},
});
await waku.start();
@ -94,12 +94,12 @@ describe("Waku Dial [node only]", function () {
nwaku = new Nwaku(makeLogFileName(this));
await nwaku.start();
const nwakuMa = await nwaku.getMultiaddrWithId();
waku = await createLightNode({
staticNoiseKey: NOISE_KEY_1,
libp2p: {
peerDiscovery: [
new PeerDiscoveryStaticPeers([await nwaku.getMultiaddrWithId()]),
],
peerDiscovery: [bootstrap({ list: [nwakuMa.toString()] })],
},
});
await waku.start();