Merge pull request #2 from vacp2p/update/upstream

feat: update from upstream
This commit is contained in:
Álex 2024-08-22 15:00:11 +02:00 committed by GitHub
commit 2748dde76a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
72 changed files with 93441 additions and 34401 deletions

13
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: npm
# this should point to the latest js-libp2p major in order to automate
# updating deps automatically after a release
directory: "/transport-interop/impl/js/v1.x"
schedule:
interval: daily
time: "10:00"
open-pull-requests-limit: 20
commit-message:
prefix: "deps"
prefix-development: "deps(dev)"

View File

@ -16,15 +16,57 @@ permissions:
actions: write actions: write
jobs: jobs:
go: add:
name: Add new ${{ matrix.repository_name }} version to ${{ matrix.test_name }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- repository_name: go-libp2p
implementation_name: go-libp2p
test_name: perf
implementation_update_script: |
sed -i "1s/$LOCAL_MAJOR_MINOR_VERSION/$REMOTE_MAJOR_MINOR_VERSION/g" go.mod
go mod tidy -go=$GO_MAJOR_MINOR_VERSION
go mod tidy
go get github.com/libp2p/go-libp2p@$REMOTE_VERSION
- repository_name: go-libp2p
implementation_name: go
test_name: transport-interop
implementation_update_script: |
sed -i "s/image_name := go-${LOCAL_MAJOR_MINOR_VERSION}/image_name := go-${REMOTE_MAJOR_MINOR_VERSION}/g" Makefile
sed -i "s/version := ${LOCAL_MAJOR_MINOR_VERSION#v}\..*/version := ${REMOTE_VERSION#v}/g" Makefile
make version.lock
- repository_name: rust-libp2p
implementation_name: rust-libp2p
test_name: perf
implementation_update_script: |
sed -i "s/commitSha := .*/commitSha := ${REMOTE_SHA}/g" Makefile
- repository_name: rust-libp2p
implementation_name: rust
test_name: transport-interop
implementation_update_script: |
sed -i "s/image_name := rust-${LOCAL_MAJOR_MINOR_VERSION}/image_name := rust-${REMOTE_MAJOR_MINOR_VERSION}/g" Makefile
sed -i "s/commitSha := .*/commitSha := ${REMOTE_SHA}/g" Makefile
- repository_name: js-libp2p
implementation_name: js-libp2p
test_name: perf
implementation_update_script: |
suffix="$(echo "${REMOTE_MAJOR_MINOR_VERSION#v}" | sed 's/\./-/g')"
sed -i "s/perf-js-libp2p-[^\"]*/perf-js-libp2p-$suffix/g" package.json
npm install libp2p@$REMOTE_VERSION
- repository_name: js-libp2p
implementation_name: js
test_name: transport-interop
implementation_update_script: |
sed -i "s/image_name := js-${LOCAL_MAJOR_MINOR_VERSION}\..*/image_name := js-${REMOTE_VERSION}/g" Makefile
npm install libp2p@$REMOTE_VERSION
env: env:
DIR: perf/impl/go-libp2p BRANCH: add/${{ matrix.test_name }}/${{ matrix.repository_name }}
REPO: libp2p/go-libp2p
BRANCH: perf/go-libp2p
steps: steps:
- name: Checkout test-plans - name: Checkout test-plans
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Configure git - name: Configure git
run: | run: |
git fetch origin $BRANCH && git checkout $BRANCH || git checkout -b $BRANCH git fetch origin $BRANCH && git checkout $BRANCH || git checkout -b $BRANCH
@ -32,40 +74,79 @@ jobs:
git config --global user.email $GITHUB_ACTOR@users.noreply.github.com git config --global user.email $GITHUB_ACTOR@users.noreply.github.com
git config --global user.name $GITHUB_ACTOR git config --global user.name $GITHUB_ACTOR
- id: go - id: go
uses: actions/setup-go@v3 uses: actions/setup-go@v5
with: with:
go-version: stable go-version: stable
- name: Get the latest version (local) - name: Get the latest version (local)
id: local id: local
run: ls -d v* | sort -V | tail -n-1 | xargs -I{} echo "version={}" | tee -a $GITHUB_OUTPUT env:
working-directory: ${{ env.DIR }} IMPLEMENTATION_DIRECTORY: ${{ matrix.test_name }}/impl/${{ matrix.implementation_name }}
run: |
pushd $IMPLEMENTATION_DIRECTORY
ls -d v* | sort -V | tail -n-1 | xargs -I{} echo "version={}" | tee -a $GITHUB_OUTPUT
popd
- name: Get the latest version (remote) - name: Get the latest version (remote)
id: remote id: remote
env: env:
GITHUB_TOKEN: ${{ github.token }} GITHUB_TOKEN: ${{ github.token }}
run: gh api repos/$REPO/releases/latest --jq '.tag_name' | xargs -I{} echo "version={}" | tee -a $GITHUB_OUTPUT REPOSITORY_NAME: ${{ matrix.repository_name }}
run: |
releases="$(gh api --paginate repos/libp2p/$REPOSITORY_NAME/releases)"
latest="$(jq 'map(select(.tag_name | startswith("libp2p-"))) | first' <<< "$releases")"
if [[ "$latest" == "null" ]]; then
latest="$(jq 'first' <<< "$releases")"
fi
tag_name=$(jq -r '.tag_name' <<< "$latest")
target_commitish=$(jq -r '.target_commitish' <<< "$latest")
echo "version=${tag_name#libp2p-}" | tee -a $GITHUB_OUTPUT
echo "target_commitish=${target_commitish}" | tee -a $GITHUB_OUTPUT
- id: mm
env:
REMOTE_VERSION: ${{ steps.remote.outputs.version }}
GO_VERSION: ${{ steps.go.outputs.go-version }}
run: |
echo $REMOTE_VERSION | sed 's/\.[0-9]*$//' | xargs -I{} echo "remote={}" | tee -a $GITHUB_OUTPUT
echo $GO_VERSION | sed 's/\.[0-9]*$//' | xargs -I{} echo "go={}" | tee -a $GITHUB_OUTPUT
- name: Add the latest version - name: Add the latest version
if: ${{ !startsWith(steps.remote.outputs.version, steps.local.outputs.version) }} if: ${{ !startsWith(steps.remote.outputs.version, steps.local.outputs.version) }}
env: env:
LOCAL_VERSION: ${{ steps.local.outputs.version }} LOCAL_MAJOR_MINOR_VERSION: ${{ steps.local.outputs.version }}
REMOTE_VERSION: ${{ steps.remote.outputs.version }} REMOTE_VERSION: ${{ steps.remote.outputs.version }}
REMOTE_MAJOR_MINOR_VERSION: ${{ steps.mm.outputs.remote }}
REMOTE_SHA: ${{ steps.remote.outputs.sha }}
GO_VERSION: ${{ steps.go.outputs.go-version }} GO_VERSION: ${{ steps.go.outputs.go-version }}
GO_MAJOR_MINOR_VERSION: ${{ steps.mm.outputs.go }}
GITHUB_TOKEN: ${{ github.token }} GITHUB_TOKEN: ${{ github.token }}
IMPLEMENTATION_DIRECTORY: ${{ matrix.test_name }}/impl/${{ matrix.implementation_name }}
VERSIONS_DIRECTORY: ${{ matrix.test_name == 'perf' && format('{0}/runner', matrix.test_name) || matrix.test_name }}
IMPLEMENTATION_NAME: ${{ matrix.implementation_name }}
REPOSITORY_NAME: ${{ matrix.repository_name }}
TEST_NAME: ${{ matrix.test_name }}
run: | run: |
majorMinorRemoteVersion=$(echo $REMOTE_VERSION | sed 's/\.[0-9]*$//') pushd $IMPLEMENTATION_DIRECTORY
majorMinorGoVersion=$(echo $GO_VERSION | sed 's/\.[0-9]*$//') cp -r $LOCAL_MAJOR_MINOR_VERSION $REMOTE_MAJOR_MINOR_VERSION
cp -r $LOCAL_VERSION $majorMinorRemoteVersion pushd $REMOTE_MAJOR_MINOR_VERSION
cd $majorMinorRemoteVersion ${{ matrix.implementation_update_script }}
sed -i "1s/$LOCAL_VERSION/$majorMinorRemoteVersion/g" go.mod popd
go mod tidy -go=$majorMinorGoVersion popd
go mod tidy
go get github.com/libp2p/go-libp2p@$REMOTE_VERSION pushd $VERSIONS_DIRECTORY
versions=''
if [[ "$TEST_NAME" == "perf" ]]; then
versions="$(jq '. + map(select(.implementation == env.IMPLEMENTATION_NAME and .id == env.LOCAL_MAJOR_MINOR_VERSION) | .id = env.REMOTE_MAJOR_MINOR_VERSION)' versionsInput.json)"
else
versions="$(jq '. + map(select(.id == "\(env.IMPLEMENTATION_NAME)-\(env.LOCAL_MAJOR_MINOR_VERSION)") | .id = "\(env.IMPLEMENTATION_NAME)-\(env.REMOTE_MAJOR_MINOR_VERSION)")' versionsInput.json)"
fi
echo "$versions" > versionsInput.json
popd
git add . git add .
git commit -m "chore: add go-libp2p@$REMOTE_VERSION to $DIR" git commit -m "chore: add $REPOSITORY_NAME@$REMOTE_VERSION to $TEST_NAME"
git push origin $BRANCH --force git push origin $BRANCH --force
# create a PR if an open one doesn't exist yet
if [[ $(gh pr list --state open --base $GITHUB_REF --head $BRANCH | wc -l) -eq 0 ]]; then if [[ $(gh pr list --state open --base $GITHUB_REF --head $BRANCH | wc -l) -eq 0 ]]; then
gh pr create --title "chore: add go-libp2p@$REMOTE_VERSION to $DIR" --body "This PR adds go-libp2p@$REMOTE_VERSION to $DIR" --head $BRANCH --base $GITHUB_REF gh pr create --title "chore: add $REPOSITORY_NAME@$REMOTE_VERSION to $TEST_NAME" --body "This PR adds $REPOSITORY_NAME@$REMOTE_VERSION to $TEST_NAME" --head $BRANCH --base $GITHUB_REF
fi fi
gh workflow run perf.yml --ref $BRANCH
working-directory: ${{ env.DIR }} gh workflow run $TEST_NAME.yml --ref $BRANCH

1
.gitignore vendored
View File

@ -43,6 +43,7 @@ __pycache__/
### NodeJS ### NodeJS
node_modules node_modules
dist
# ignore system files # ignore system files
.DS_Store .DS_Store

View File

@ -41,8 +41,12 @@ export async function main (runServer, serverIpAddress, transport, uploadBytes,
const { host, port } = splitHostPort(serverIpAddress) const { host, port } = splitHostPort(serverIpAddress)
const config = { const config = {
transports: [tcp()], transports: [
streamMuxers: [yamux()], tcp()
],
streamMuxers: [
yamux()
],
connectionEncryption: [ connectionEncryption: [
noise() noise()
], ],

View File

@ -14,12 +14,12 @@
} }
}, },
"node_modules/@achingbrain/nat-port-mapper": { "node_modules/@achingbrain/nat-port-mapper": {
"version": "1.0.12", "version": "1.0.13",
"resolved": "https://registry.npmjs.org/@achingbrain/nat-port-mapper/-/nat-port-mapper-1.0.12.tgz", "resolved": "https://registry.npmjs.org/@achingbrain/nat-port-mapper/-/nat-port-mapper-1.0.13.tgz",
"integrity": "sha512-rU4G75TEOTIPlkeDnPEVwx/VmMMFta42kY2SMmVobRkrtNLnxtU08Yhriu6tSBc9oO0wXdfNNeuLnNnEnL7w/A==", "integrity": "sha512-B5GL6ILDek72OjoEyFGEuuNYaEOYxO06Ulhcaf/5iQ4EO8uaZWS+OkolYST7L+ecJrkjfaSNmSAsWRRuh+1Z5A==",
"dependencies": { "dependencies": {
"@achingbrain/ssdp": "^4.0.1", "@achingbrain/ssdp": "^4.0.1",
"@libp2p/logger": "^3.0.0", "@libp2p/logger": "^4.0.1",
"default-gateway": "^7.2.2", "default-gateway": "^7.2.2",
"err-code": "^3.0.1", "err-code": "^3.0.1",
"it-first": "^3.0.1", "it-first": "^3.0.1",
@ -28,6 +28,30 @@
"xml2js": "^0.6.0" "xml2js": "^0.6.0"
} }
}, },
"node_modules/@achingbrain/nat-port-mapper/node_modules/@libp2p/interface": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-1.0.1.tgz",
"integrity": "sha512-TRo1YxJ+AVjt5ms+mTOp8xcoCis5HAUMzv0XfCvxtIw77Bog6TPR5VdkGutlEQOKUMzXtLP0lW88fTQBeiiOnA==",
"dependencies": {
"@multiformats/multiaddr": "^12.1.10",
"it-pushable": "^3.2.1",
"it-stream-types": "^2.0.1",
"multiformats": "^12.1.3",
"uint8arraylist": "^2.4.3"
}
},
"node_modules/@achingbrain/nat-port-mapper/node_modules/@libp2p/logger": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-4.0.1.tgz",
"integrity": "sha512-d7kJmbkphNvEI3Da4so+4nxUJhwW/T/d8Pd+aQIuT27RYNeVoRfkFkjYwPIP+NvJXtU4LDju7VDPLbPbU2zFGA==",
"dependencies": {
"@libp2p/interface": "^1.0.1",
"@multiformats/multiaddr": "^12.1.10",
"debug": "^4.3.4",
"interface-datastore": "^8.2.0",
"multiformats": "^12.1.3"
}
},
"node_modules/@achingbrain/ssdp": { "node_modules/@achingbrain/ssdp": {
"version": "4.0.6", "version": "4.0.6",
"resolved": "https://registry.npmjs.org/@achingbrain/ssdp/-/ssdp-4.0.6.tgz", "resolved": "https://registry.npmjs.org/@achingbrain/ssdp/-/ssdp-4.0.6.tgz",
@ -55,9 +79,9 @@
"integrity": "sha512-ndGqEMG1W5WkGagaqOZHpPU172AGdxr+LD15sv3WIUvT5oCFUrG1Y0CW/v2Egwj4JXEvSibaIIIqImsm98y1nA==" "integrity": "sha512-ndGqEMG1W5WkGagaqOZHpPU172AGdxr+LD15sv3WIUvT5oCFUrG1Y0CW/v2Egwj4JXEvSibaIIIqImsm98y1nA=="
}, },
"node_modules/@chainsafe/libp2p-noise": { "node_modules/@chainsafe/libp2p-noise": {
"version": "13.0.3", "version": "13.0.5",
"resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-13.0.3.tgz", "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-13.0.5.tgz",
"integrity": "sha512-hzfhKUEx5XHDaC21wgROhTUFelaeYojH3DFYhCvqFnhRPUjmz+WJh2jweKaUlysKTTrEHv+JJob/TDY/IS6fRw==", "integrity": "sha512-xXqwrkH4nXlv3cYENHtqOgmIT2M4irPDwi548UvpmxzeC9hqa0kmiqbtAFYMV3v+gJ9pqVBVWFRk2hjs83GNrw==",
"dependencies": { "dependencies": {
"@chainsafe/as-chacha20poly1305": "^0.1.0", "@chainsafe/as-chacha20poly1305": "^0.1.0",
"@chainsafe/as-sha256": "^0.4.1", "@chainsafe/as-sha256": "^0.4.1",
@ -85,9 +109,9 @@
} }
}, },
"node_modules/@chainsafe/libp2p-yamux": { "node_modules/@chainsafe/libp2p-yamux": {
"version": "5.0.3", "version": "5.0.4",
"resolved": "https://registry.npmjs.org/@chainsafe/libp2p-yamux/-/libp2p-yamux-5.0.3.tgz", "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-yamux/-/libp2p-yamux-5.0.4.tgz",
"integrity": "sha512-I2g8eJFm4xvyrD9Z8+8RvqpCBqHiFtcOGrl4sQXPkktw0cY5hvXf0knIjOLacoNOdAPKG9MNscT4Vojp+sb6cw==", "integrity": "sha512-3cfOjomFde7+6sscoM0gK7cgA5aEm20oYeVXSSonVzaas/UZzNsGP+FnF/bjLATjdyTB+YqhBHJs/KKk1PAy/Q==",
"dependencies": { "dependencies": {
"@libp2p/interface": "^0.1.0", "@libp2p/interface": "^0.1.0",
"@libp2p/logger": "^3.0.0", "@libp2p/logger": "^3.0.0",
@ -96,10 +120,6 @@
"it-pipe": "^3.0.1", "it-pipe": "^3.0.1",
"it-pushable": "^3.2.0", "it-pushable": "^3.2.0",
"uint8arraylist": "^2.4.3" "uint8arraylist": "^2.4.3"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
} }
}, },
"node_modules/@chainsafe/netmask": { "node_modules/@chainsafe/netmask": {
@ -141,9 +161,9 @@
} }
}, },
"node_modules/@libp2p/interface-internal": { "node_modules/@libp2p/interface-internal": {
"version": "0.1.9", "version": "0.1.12",
"resolved": "https://registry.npmjs.org/@libp2p/interface-internal/-/interface-internal-0.1.9.tgz", "resolved": "https://registry.npmjs.org/@libp2p/interface-internal/-/interface-internal-0.1.12.tgz",
"integrity": "sha512-0HoY3ojG773VqE/m5vw9XtpKzuTqlCNqbOcwh2JvQvrLIiQgwu1zbn6t+T6cKK49eTBGfUqj3uWN7YQgX8rdGA==", "integrity": "sha512-tUZ4hxU8fO4397p/GtXNvAANHiLA/Uxdil90TuNNCnlb+GZijDYEEJiqBfnk2zYAdwm7Q9iO0fVxZCpfoW8B7Q==",
"dependencies": { "dependencies": {
"@libp2p/interface": "^0.1.6", "@libp2p/interface": "^0.1.6",
"@libp2p/peer-collections": "^4.0.8", "@libp2p/peer-collections": "^4.0.8",
@ -179,9 +199,9 @@
} }
}, },
"node_modules/@libp2p/multistream-select": { "node_modules/@libp2p/multistream-select": {
"version": "4.0.6", "version": "4.0.10",
"resolved": "https://registry.npmjs.org/@libp2p/multistream-select/-/multistream-select-4.0.6.tgz", "resolved": "https://registry.npmjs.org/@libp2p/multistream-select/-/multistream-select-4.0.10.tgz",
"integrity": "sha512-WT3thUOqUpzKjTctLkgezQep0C23uIPyE0J5H7tBBoB+h6Ocp90A7aQWsBZMbszGKcNOeAkIIYE7dZ0J1MdKeg==", "integrity": "sha512-f0BDv96L2yF9SZ0YXdg41JcGWwPBGZNAoeFGkna38SMFtj00NQWBOwAjqVdhrYVF58ymB0Ci6OfMzYv1XHVj/A==",
"dependencies": { "dependencies": {
"@libp2p/interface": "^0.1.6", "@libp2p/interface": "^0.1.6",
"@libp2p/logger": "^3.1.0", "@libp2p/logger": "^3.1.0",
@ -200,9 +220,9 @@
} }
}, },
"node_modules/@libp2p/peer-collections": { "node_modules/@libp2p/peer-collections": {
"version": "4.0.8", "version": "4.0.11",
"resolved": "https://registry.npmjs.org/@libp2p/peer-collections/-/peer-collections-4.0.8.tgz", "resolved": "https://registry.npmjs.org/@libp2p/peer-collections/-/peer-collections-4.0.11.tgz",
"integrity": "sha512-Tk7W7pgPRH1v1+DmCx+XDqWX/E1Q7t7dNz3gsKZ1smstLwF6P1OhmYgDuVpMUvJiYroM7j7X6CcPZEoVUvNVog==", "integrity": "sha512-4bHtIm3VfYMm2laRuebkswQukgQmWTUbExnu1sD5vcbI186aCZ7P56QjWyOIMn3XflIoZ0cx9AXX/WuDQSolDA==",
"dependencies": { "dependencies": {
"@libp2p/interface": "^0.1.6", "@libp2p/interface": "^0.1.6",
"@libp2p/peer-id": "^3.0.6" "@libp2p/peer-id": "^3.0.6"
@ -219,9 +239,9 @@
} }
}, },
"node_modules/@libp2p/peer-id-factory": { "node_modules/@libp2p/peer-id-factory": {
"version": "3.0.8", "version": "3.0.11",
"resolved": "https://registry.npmjs.org/@libp2p/peer-id-factory/-/peer-id-factory-3.0.8.tgz", "resolved": "https://registry.npmjs.org/@libp2p/peer-id-factory/-/peer-id-factory-3.0.11.tgz",
"integrity": "sha512-T0pOKWwFw01GqpeA03RRztG2qr0Zl2cSdt20d/WQ+BAjyrJNr7PSBTXux3nRGGdmzoUfJTJU6f992PDtq1z/mQ==", "integrity": "sha512-BmXKgeyAGezPyoY/uni95t439+AE0eqEKMxjfkfy2Hv/LcJ9gdR3zjRl7Hzci1O12b+yeVFtYVU8DZtBCcsZjQ==",
"dependencies": { "dependencies": {
"@libp2p/crypto": "^2.0.8", "@libp2p/crypto": "^2.0.8",
"@libp2p/interface": "^0.1.6", "@libp2p/interface": "^0.1.6",
@ -233,9 +253,9 @@
} }
}, },
"node_modules/@libp2p/peer-record": { "node_modules/@libp2p/peer-record": {
"version": "6.0.9", "version": "6.0.12",
"resolved": "https://registry.npmjs.org/@libp2p/peer-record/-/peer-record-6.0.9.tgz", "resolved": "https://registry.npmjs.org/@libp2p/peer-record/-/peer-record-6.0.12.tgz",
"integrity": "sha512-S8SibblcvJWMeOnHfL62nlQuwvgxDb4fB132Fw/2ej4wABqJa94KrllFk+oejJW7rzWIPCKhImcN5YY/ymIkiQ==", "integrity": "sha512-8IItsbcPeIaFC5QMZD+gGl/dDbwLjE9nrmL7ZAOvMwcfZx+2AVZPN/6nubahO/wQrchpvBYiK3TxaWGnOH8sIA==",
"dependencies": { "dependencies": {
"@libp2p/crypto": "^2.0.8", "@libp2p/crypto": "^2.0.8",
"@libp2p/interface": "^0.1.6", "@libp2p/interface": "^0.1.6",
@ -249,9 +269,9 @@
} }
}, },
"node_modules/@libp2p/peer-store": { "node_modules/@libp2p/peer-store": {
"version": "9.0.9", "version": "9.0.12",
"resolved": "https://registry.npmjs.org/@libp2p/peer-store/-/peer-store-9.0.9.tgz", "resolved": "https://registry.npmjs.org/@libp2p/peer-store/-/peer-store-9.0.12.tgz",
"integrity": "sha512-8wP45gEozPw7mE5/p+2onAUXEPvb5pWiriV2UqPqrt9FZ7OTRUfD4sMxMxFgCGg8K5pcrXuQPBWyG7OEn4GOGg==", "integrity": "sha512-rYpUUhvDI7GTfMFWNJ+HQoEOAVOxfp3t0bgJWLvUFKNtULojEk0znKHa6da7hX2KE06wM7ZEMfF23jZCmrwk1g==",
"dependencies": { "dependencies": {
"@libp2p/interface": "^0.1.6", "@libp2p/interface": "^0.1.6",
"@libp2p/logger": "^3.1.0", "@libp2p/logger": "^3.1.0",
@ -320,13 +340,13 @@
} }
}, },
"node_modules/@multiformats/multiaddr": { "node_modules/@multiformats/multiaddr": {
"version": "12.1.10", "version": "12.1.11",
"resolved": "https://registry.npmjs.org/@multiformats/multiaddr/-/multiaddr-12.1.10.tgz", "resolved": "https://registry.npmjs.org/@multiformats/multiaddr/-/multiaddr-12.1.11.tgz",
"integrity": "sha512-Bi3nJ/SE17+te40OLxFOpr9CvRodusZZLYZb3e5a0w9RzQcHzfKnnlfqdysLXZ2W5vXgxCUL/Uhndl51Ff2S+Q==", "integrity": "sha512-CWG9kETEGTTMdr1T+/JEuMwFld3r3fHNP8LkLoUcLvHRy6yr8sWdotVGEDNEdDO/vrKhuD7bQBws3xMSMMyylg==",
"dependencies": { "dependencies": {
"@chainsafe/is-ip": "^2.0.1", "@chainsafe/is-ip": "^2.0.1",
"@chainsafe/netmask": "^2.0.0", "@chainsafe/netmask": "^2.0.0",
"@libp2p/interface": "^0.1.1", "@libp2p/interface": "^1.0.0",
"dns-over-http-resolver": "3.0.0", "dns-over-http-resolver": "3.0.0",
"multiformats": "^12.0.1", "multiformats": "^12.0.1",
"uint8-varint": "^2.0.1", "uint8-varint": "^2.0.1",
@ -343,6 +363,18 @@
"multiformats": "^12.0.1" "multiformats": "^12.0.1"
} }
}, },
"node_modules/@multiformats/multiaddr/node_modules/@libp2p/interface": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-1.0.1.tgz",
"integrity": "sha512-TRo1YxJ+AVjt5ms+mTOp8xcoCis5HAUMzv0XfCvxtIw77Bog6TPR5VdkGutlEQOKUMzXtLP0lW88fTQBeiiOnA==",
"dependencies": {
"@multiformats/multiaddr": "^12.1.10",
"it-pushable": "^3.2.1",
"it-stream-types": "^2.0.1",
"multiformats": "^12.1.3",
"uint8arraylist": "^2.4.3"
}
},
"node_modules/@noble/ciphers": { "node_modules/@noble/ciphers": {
"version": "0.4.0", "version": "0.4.0",
"resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-0.4.0.tgz", "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-0.4.0.tgz",
@ -379,9 +411,9 @@
"integrity": "sha512-XISRgDJ2Tc5q4TRqvgJtzsRkFYNJzZrhTdtMoGVBttwzzQJkPnS3WWTFc7kuDRoPtPakl+T+OfdEUjYJj7Jbow==" "integrity": "sha512-XISRgDJ2Tc5q4TRqvgJtzsRkFYNJzZrhTdtMoGVBttwzzQJkPnS3WWTFc7kuDRoPtPakl+T+OfdEUjYJj7Jbow=="
}, },
"node_modules/@types/sinon": { "node_modules/@types/sinon": {
"version": "17.0.1", "version": "17.0.2",
"resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.1.tgz", "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.2.tgz",
"integrity": "sha512-Q2Go6TJetYn5Za1+RJA1Aik61Oa2FS8SuJ0juIqUuJ5dZR4wvhKfmSdIqWtQ3P6gljKWjW0/R7FZkA4oXVL6OA==", "integrity": "sha512-Zt6heIGsdqERkxctIpvN5Pv3edgBrhoeb3yHyxffd4InN0AX2SVNKSrhdDZKGQICVOxWP/q4DyhpfPNMSrpIiA==",
"dependencies": { "dependencies": {
"@types/sinonjs__fake-timers": "*" "@types/sinonjs__fake-timers": "*"
} }
@ -427,11 +459,11 @@
} }
}, },
"node_modules/datastore-core": { "node_modules/datastore-core": {
"version": "9.2.3", "version": "9.2.5",
"resolved": "https://registry.npmjs.org/datastore-core/-/datastore-core-9.2.3.tgz", "resolved": "https://registry.npmjs.org/datastore-core/-/datastore-core-9.2.5.tgz",
"integrity": "sha512-jcvrVDt+jp7lUp2WhMXXgX/hoi3VcJebN+z/ZXbIRKOVfNOF4bl8cvr7sQ1y9qITikgC2coXFYd79Wzt/n13ZQ==", "integrity": "sha512-3Z54iBjwj4KDp5Se4aZRYWnjv1OlQgPfrEF2X+T9rlet8Pe3AKRLVYx0v+11PuL+47d7w0Vc/4847Ylas6fEbQ==",
"dependencies": { "dependencies": {
"@libp2p/logger": "^3.0.0", "@libp2p/logger": "^4.0.1",
"err-code": "^3.0.1", "err-code": "^3.0.1",
"interface-store": "^5.0.0", "interface-store": "^5.0.0",
"it-all": "^3.0.1", "it-all": "^3.0.1",
@ -446,6 +478,30 @@
"uint8arrays": "^4.0.2" "uint8arrays": "^4.0.2"
} }
}, },
"node_modules/datastore-core/node_modules/@libp2p/interface": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-1.0.1.tgz",
"integrity": "sha512-TRo1YxJ+AVjt5ms+mTOp8xcoCis5HAUMzv0XfCvxtIw77Bog6TPR5VdkGutlEQOKUMzXtLP0lW88fTQBeiiOnA==",
"dependencies": {
"@multiformats/multiaddr": "^12.1.10",
"it-pushable": "^3.2.1",
"it-stream-types": "^2.0.1",
"multiformats": "^12.1.3",
"uint8arraylist": "^2.4.3"
}
},
"node_modules/datastore-core/node_modules/@libp2p/logger": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-4.0.1.tgz",
"integrity": "sha512-d7kJmbkphNvEI3Da4so+4nxUJhwW/T/d8Pd+aQIuT27RYNeVoRfkFkjYwPIP+NvJXtU4LDju7VDPLbPbU2zFGA==",
"dependencies": {
"@libp2p/interface": "^1.0.1",
"@multiformats/multiaddr": "^12.1.10",
"debug": "^4.3.4",
"interface-datastore": "^8.2.0",
"multiformats": "^12.1.3"
}
},
"node_modules/debug": { "node_modules/debug": {
"version": "4.3.4", "version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
@ -564,19 +620,19 @@
} }
}, },
"node_modules/interface-datastore": { "node_modules/interface-datastore": {
"version": "8.2.5", "version": "8.2.7",
"resolved": "https://registry.npmjs.org/interface-datastore/-/interface-datastore-8.2.5.tgz", "resolved": "https://registry.npmjs.org/interface-datastore/-/interface-datastore-8.2.7.tgz",
"integrity": "sha512-kvLGJMz3RPoJF/g5DbEvfWWempIiSBLVMf63b0PBsziVcSkj0ofzHYI86v8vqpGedkQ81DtPCUKyvX9W7zWvrQ==", "integrity": "sha512-ot5B5+VogufRfjhedAXZHm5NuEKyYZkDyVpTjBYIrxYUpS5GIfF2soE/dsd/FiBVqubcxa4IEToMXL5ruMwhjw==",
"dependencies": { "dependencies": {
"interface-store": "^5.0.0", "interface-store": "^5.0.0",
"nanoid": "^4.0.0", "nanoid": "^5.0.3",
"uint8arrays": "^4.0.2" "uint8arrays": "^4.0.2"
} }
}, },
"node_modules/interface-store": { "node_modules/interface-store": {
"version": "5.1.4", "version": "5.1.5",
"resolved": "https://registry.npmjs.org/interface-store/-/interface-store-5.1.4.tgz", "resolved": "https://registry.npmjs.org/interface-store/-/interface-store-5.1.5.tgz",
"integrity": "sha512-SI2co5IAxAybBc9egRM2bXvHOa1RPh5SQQkO6di6t/aX92RbtzP4t8raB0l3GTzQmJADaBbzz8Tfa1QLgfMdGQ==" "integrity": "sha512-X0KnJBk3o+YL13MxZBMwa88/b3Mdrpm0yPzkSTKDDVn9BSPH7UK6W+ZtIPO2bxKOQVmq7zqOwAnYnpfqWjb6/g=="
}, },
"node_modules/ip-regex": { "node_modules/ip-regex": {
"version": "5.0.0", "version": "5.0.0",
@ -648,9 +704,9 @@
"integrity": "sha512-UMiy0i9DqCHBdWvMbzdYvVGa5/w4t1cc4nchpbnjdLhklglv8mQeEYnii0gvKESJuL1zV32Cqdb33R6/GPfxpQ==" "integrity": "sha512-UMiy0i9DqCHBdWvMbzdYvVGa5/w4t1cc4nchpbnjdLhklglv8mQeEYnii0gvKESJuL1zV32Cqdb33R6/GPfxpQ=="
}, },
"node_modules/it-byte-stream": { "node_modules/it-byte-stream": {
"version": "1.0.3", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/it-byte-stream/-/it-byte-stream-1.0.3.tgz", "resolved": "https://registry.npmjs.org/it-byte-stream/-/it-byte-stream-1.0.5.tgz",
"integrity": "sha512-OKwS1QPK8d6KsQniIs4KjJxzgJ/v4pRWrjVn/zxyilWAMZt0LUE+ynqKtqwXqHDkzfPcTDxil8S4D7b21kOpow==", "integrity": "sha512-wGHbXPE0ZiU0poJTgCNOW06+mh9yyCwdF8bVv0zxchgql6CMQd/2NEXXtmwWE+N65st8bi/KWUWcMU2pJU2fEw==",
"dependencies": { "dependencies": {
"it-stream-types": "^2.0.1", "it-stream-types": "^2.0.1",
"p-defer": "^4.0.0", "p-defer": "^4.0.0",
@ -718,9 +774,9 @@
} }
}, },
"node_modules/it-length-prefixed-stream": { "node_modules/it-length-prefixed-stream": {
"version": "1.1.1", "version": "1.1.4",
"resolved": "https://registry.npmjs.org/it-length-prefixed-stream/-/it-length-prefixed-stream-1.1.1.tgz", "resolved": "https://registry.npmjs.org/it-length-prefixed-stream/-/it-length-prefixed-stream-1.1.4.tgz",
"integrity": "sha512-IRlU0tOcgm43NBfo9UpjGDcy+Ikfx6R4LEMIUZ7SkEapXNqQBiFTElgqRqMu9y+wJ5/AKwgcrohAyDiL3+wq/w==", "integrity": "sha512-6YcQ5jsaYnuXBqF+oSGjSdSY9jF7HWl7yh+dxYytXxbE2GcdiOpn6pLM7m6AlIID9MCzQqMY5nOzaiatQ8A3/A==",
"dependencies": { "dependencies": {
"it-byte-stream": "^1.0.0", "it-byte-stream": "^1.0.0",
"it-length-prefixed": "^9.0.1", "it-length-prefixed": "^9.0.1",
@ -933,6 +989,23 @@
"npm": ">=7.0.0" "npm": ">=7.0.0"
} }
}, },
"node_modules/mortice/node_modules/nanoid": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.2.tgz",
"integrity": "sha512-7ZtY5KTCNheRGfEFxnedV5zFiORN1+Y1N6zvPTnHQd8ENUvfaDBeuJDZb2bN/oXwXxu3qkTXDzy57W5vAmDTBw==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"bin": {
"nanoid": "bin/nanoid.js"
},
"engines": {
"node": "^14 || ^16 || >=18"
}
},
"node_modules/ms": { "node_modules/ms": {
"version": "2.1.2", "version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
@ -948,9 +1021,9 @@
} }
}, },
"node_modules/nanoid": { "node_modules/nanoid": {
"version": "4.0.2", "version": "5.0.3",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.2.tgz", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.0.3.tgz",
"integrity": "sha512-7ZtY5KTCNheRGfEFxnedV5zFiORN1+Y1N6zvPTnHQd8ENUvfaDBeuJDZb2bN/oXwXxu3qkTXDzy57W5vAmDTBw==", "integrity": "sha512-I7X2b22cxA4LIHXPSqbBCEQSL+1wv8TuoefejsX4HFWyC6jc5JG7CEaxOltiKjc1M+YCS2YkrZZcj4+dytw9GA==",
"funding": [ "funding": [
{ {
"type": "github", "type": "github",
@ -961,7 +1034,7 @@
"nanoid": "bin/nanoid.js" "nanoid": "bin/nanoid.js"
}, },
"engines": { "engines": {
"node": "^14 || ^16 || >=18" "node": "^18 || >=20"
} }
}, },
"node_modules/netmask": { "node_modules/netmask": {
@ -1228,21 +1301,17 @@
} }
}, },
"node_modules/uint8arraylist": { "node_modules/uint8arraylist": {
"version": "2.4.3", "version": "2.4.7",
"resolved": "https://registry.npmjs.org/uint8arraylist/-/uint8arraylist-2.4.3.tgz", "resolved": "https://registry.npmjs.org/uint8arraylist/-/uint8arraylist-2.4.7.tgz",
"integrity": "sha512-oEVZr4/GrH87K0kjNce6z8pSCzLEPqHNLNR5sj8cJOySrTP8Vb/pMIbZKLJGhQKxm1TiZ31atNrpn820Pyqpow==", "integrity": "sha512-ohRElqR6C5dd60vRFLq40MCiSnUe1AzkpHvbCEMCGGP6zMoFYECsjdhL6bR1kTK37ONNRDuHQ3RIpScRYcYYIg==",
"dependencies": { "dependencies": {
"uint8arrays": "^4.0.2" "uint8arrays": "^4.0.2"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
} }
}, },
"node_modules/uint8arrays": { "node_modules/uint8arrays": {
"version": "4.0.6", "version": "4.0.9",
"resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.6.tgz", "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.9.tgz",
"integrity": "sha512-4ZesjQhqOU2Ip6GPReIwN60wRxIupavL8T0Iy36BBHr2qyMrNxsPJvr7vpS4eFt8F8kSguWUPad6ZM9izs/vyw==", "integrity": "sha512-iHU8XJJnfeijILZWzV7RgILdPHqe0mjJvyzY4mO8aUUtHsDbPa2Gc8/02Kc4zeokp2W6Qq8z9Ap1xkQ1HfbKwg==",
"dependencies": { "dependencies": {
"multiformats": "^12.0.1" "multiformats": "^12.0.1"
} }

View File

@ -41,16 +41,12 @@ export async function main (runServer, serverIpAddress, transport, uploadBytes,
const { host, port } = splitHostPort(serverIpAddress) const { host, port } = splitHostPort(serverIpAddress)
const config = { const config = {
//peerId, transports: [
transports: [tcp({ tcp()
socket: { ],
noDelay: true streamMuxers: [
}, yamux()
server: { ],
noDelay: true
}
})],
streamMuxers: [yamux()],
connectionEncryption: [ connectionEncryption: [
noise() noise()
], ],

View File

@ -6,11 +6,11 @@
"": { "": {
"name": "@libp2p/perf-js-libp2p-1-0", "name": "@libp2p/perf-js-libp2p-1-0",
"dependencies": { "dependencies": {
"@chainsafe/libp2p-noise": "^13.0.3", "@chainsafe/libp2p-noise": "^14.0.0",
"@chainsafe/libp2p-yamux": "^5.0.3", "@chainsafe/libp2p-yamux": "^6.0.1",
"@libp2p/perf": "next", "@libp2p/perf": "^3.0.4",
"@libp2p/tcp": "next", "@libp2p/tcp": "^9.0.4",
"libp2p": "next" "libp2p": "^1.0.5"
} }
}, },
"node_modules/@chainsafe/as-chacha20poly1305": { "node_modules/@chainsafe/as-chacha20poly1305": {
@ -29,16 +29,15 @@
"integrity": "sha512-ndGqEMG1W5WkGagaqOZHpPU172AGdxr+LD15sv3WIUvT5oCFUrG1Y0CW/v2Egwj4JXEvSibaIIIqImsm98y1nA==" "integrity": "sha512-ndGqEMG1W5WkGagaqOZHpPU172AGdxr+LD15sv3WIUvT5oCFUrG1Y0CW/v2Egwj4JXEvSibaIIIqImsm98y1nA=="
}, },
"node_modules/@chainsafe/libp2p-noise": { "node_modules/@chainsafe/libp2p-noise": {
"version": "13.0.3", "version": "14.0.0",
"resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-13.0.3.tgz", "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-14.0.0.tgz",
"integrity": "sha512-hzfhKUEx5XHDaC21wgROhTUFelaeYojH3DFYhCvqFnhRPUjmz+WJh2jweKaUlysKTTrEHv+JJob/TDY/IS6fRw==", "integrity": "sha512-/E7QnSL24APpfXTj/YRS/EVRvTATg09+AwqEUGs+OeLFcO/DwPal3W6pj7c4eyJFSgxnegbpbgiH8EBvTZ4Iwg==",
"dependencies": { "dependencies": {
"@chainsafe/as-chacha20poly1305": "^0.1.0", "@chainsafe/as-chacha20poly1305": "^0.1.0",
"@chainsafe/as-sha256": "^0.4.1", "@chainsafe/as-sha256": "^0.4.1",
"@libp2p/crypto": "^2.0.0", "@libp2p/crypto": "^3.0.0",
"@libp2p/interface": "^0.1.0", "@libp2p/interface": "^1.0.0",
"@libp2p/logger": "^3.0.0", "@libp2p/peer-id": "^4.0.0",
"@libp2p/peer-id": "^3.0.0",
"@noble/ciphers": "^0.4.0", "@noble/ciphers": "^0.4.0",
"@noble/curves": "^1.1.0", "@noble/curves": "^1.1.0",
"@noble/hashes": "^1.3.1", "@noble/hashes": "^1.3.1",
@ -59,21 +58,17 @@
} }
}, },
"node_modules/@chainsafe/libp2p-yamux": { "node_modules/@chainsafe/libp2p-yamux": {
"version": "5.0.3", "version": "6.0.1",
"resolved": "https://registry.npmjs.org/@chainsafe/libp2p-yamux/-/libp2p-yamux-5.0.3.tgz", "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-yamux/-/libp2p-yamux-6.0.1.tgz",
"integrity": "sha512-I2g8eJFm4xvyrD9Z8+8RvqpCBqHiFtcOGrl4sQXPkktw0cY5hvXf0knIjOLacoNOdAPKG9MNscT4Vojp+sb6cw==", "integrity": "sha512-8ar6jph9ZuUUxQ8t8W1MaZqH7f7KvGK2wR7TDGnN0r4QtZc07ICNgVjnolnI9/8bclrI5Um4uMa8QCYKTrdvDQ==",
"dependencies": { "dependencies": {
"@libp2p/interface": "^0.1.0", "@libp2p/interface": "^1.0.0",
"@libp2p/logger": "^3.0.0", "@libp2p/utils": "^5.0.0",
"get-iterator": "^2.0.1", "get-iterator": "^2.0.1",
"it-foreach": "^2.0.3", "it-foreach": "^2.0.3",
"it-pipe": "^3.0.1", "it-pipe": "^3.0.1",
"it-pushable": "^3.2.0", "it-pushable": "^3.2.0",
"uint8arraylist": "^2.4.3" "uint8arraylist": "^2.4.3"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
} }
}, },
"node_modules/@chainsafe/netmask": { "node_modules/@chainsafe/netmask": {
@ -85,14 +80,14 @@
} }
}, },
"node_modules/@libp2p/crypto": { "node_modules/@libp2p/crypto": {
"version": "2.0.8", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-2.0.8.tgz", "resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-3.0.1.tgz",
"integrity": "sha512-8e5fh6bsJNpSjhrggtlm8QF+BERjelJswIjRS69aKgxp24R4z2kDM4pRYPkfQjXJDLNDtqWtKNmePgX23+QJsA==", "integrity": "sha512-CvqzsWvAYaga/Du3gDRChN9d8PUnOoCQg3VlugKf6tfw5+1pd7sMDhyMLajXqFsWqQUY6FojgB1TS4izpODMpw==",
"dependencies": { "dependencies": {
"@libp2p/interface": "^0.1.6", "@libp2p/interface": "^1.0.1",
"@noble/curves": "^1.1.0", "@noble/curves": "^1.1.0",
"@noble/hashes": "^1.3.1", "@noble/hashes": "^1.3.1",
"multiformats": "^12.0.1", "multiformats": "^12.1.3",
"node-forge": "^1.1.0", "node-forge": "^1.1.0",
"protons-runtime": "^5.0.0", "protons-runtime": "^5.0.0",
"uint8arraylist": "^2.4.3", "uint8arraylist": "^2.4.3",
@ -100,35 +95,9 @@
} }
}, },
"node_modules/@libp2p/interface": { "node_modules/@libp2p/interface": {
"version": "0.1.6", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6.tgz", "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-1.0.1.tgz",
"integrity": "sha512-Lzc5cS/hXuoXhuAbVIxJIHLCYmfPcbU0vVgrpMoiP1Qb2Q3ETU4A46GB8s8mWXgSU6tr9RcqerUqzFYD6+OAag==", "integrity": "sha512-TRo1YxJ+AVjt5ms+mTOp8xcoCis5HAUMzv0XfCvxtIw77Bog6TPR5VdkGutlEQOKUMzXtLP0lW88fTQBeiiOnA==",
"dependencies": {
"@multiformats/multiaddr": "^12.1.5",
"abortable-iterator": "^5.0.1",
"it-pushable": "^3.2.0",
"it-stream-types": "^2.0.1",
"multiformats": "^12.0.1",
"p-defer": "^4.0.0",
"race-signal": "^1.0.0",
"uint8arraylist": "^2.4.3"
}
},
"node_modules/@libp2p/interface-internal": {
"version": "0.1.9-d8f5bc211",
"resolved": "https://registry.npmjs.org/@libp2p/interface-internal/-/interface-internal-0.1.9-d8f5bc211.tgz",
"integrity": "sha512-nW8Rk6dcx1SbhWigrHexoIoyspOUuXaTesgmDVGtPcsIT+efT5RNjgKo+1ep6H4hxz1Z9GKVlI0H7mOslQXJ1A==",
"dependencies": {
"@libp2p/interface": "0.1.6-d8f5bc211",
"@libp2p/peer-collections": "4.0.8-d8f5bc211",
"@multiformats/multiaddr": "^12.1.10",
"uint8arraylist": "^2.4.3"
}
},
"node_modules/@libp2p/interface-internal/node_modules/@libp2p/interface": {
"version": "0.1.6-d8f5bc211",
"resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-d8f5bc211.tgz",
"integrity": "sha512-TpetndcnUxxbS9fxejLUhD8I9DqyWbgkhhtFoSUGa78rkhF8Dn/zIiEuNdW73kXAErb/HTpuB9BCGrroEShi/w==",
"dependencies": { "dependencies": {
"@multiformats/multiaddr": "^12.1.10", "@multiformats/multiaddr": "^12.1.10",
"it-pushable": "^3.2.1", "it-pushable": "^3.2.1",
@ -137,146 +106,87 @@
"uint8arraylist": "^2.4.3" "uint8arraylist": "^2.4.3"
} }
}, },
"node_modules/@libp2p/logger": { "node_modules/@libp2p/interface-internal": {
"version": "3.1.0", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-3.1.0.tgz", "resolved": "https://registry.npmjs.org/@libp2p/interface-internal/-/interface-internal-1.0.1.tgz",
"integrity": "sha512-qJbJBAhxHVsRBtQSOIkSLi0lskUSFjzE+zm0QvoyxzZKSz+mX41mZLbnofPIVOVauoDQ40dXpe7WDUOq8AbiQQ==", "integrity": "sha512-mJ2uWPzjnIk9Y1/Ca/xk0coz8PCg8tnAQgxN+GNG0cdAbY6Wu7dNDm0P3aTh9NYfjCp+5nzSSEE2UW/nr7TB9Q==",
"dependencies": { "dependencies": {
"@libp2p/interface": "^0.1.6", "@libp2p/interface": "^1.0.1",
"@multiformats/multiaddr": "^12.1.5", "@libp2p/peer-collections": "^5.0.0",
"@multiformats/multiaddr": "^12.1.10",
"uint8arraylist": "^2.4.3"
}
},
"node_modules/@libp2p/logger": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-4.0.1.tgz",
"integrity": "sha512-d7kJmbkphNvEI3Da4so+4nxUJhwW/T/d8Pd+aQIuT27RYNeVoRfkFkjYwPIP+NvJXtU4LDju7VDPLbPbU2zFGA==",
"dependencies": {
"@libp2p/interface": "^1.0.1",
"@multiformats/multiaddr": "^12.1.10",
"debug": "^4.3.4", "debug": "^4.3.4",
"interface-datastore": "^8.2.0", "interface-datastore": "^8.2.0",
"multiformats": "^12.0.1" "multiformats": "^12.1.3"
} }
}, },
"node_modules/@libp2p/multistream-select": { "node_modules/@libp2p/multistream-select": {
"version": "4.0.6-d8f5bc211", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/@libp2p/multistream-select/-/multistream-select-4.0.6-d8f5bc211.tgz", "resolved": "https://registry.npmjs.org/@libp2p/multistream-select/-/multistream-select-5.0.0.tgz",
"integrity": "sha512-QVkPzdVeVdMDxIQaYDyDOFhZulmlxYva5tIsvWTocmXto/BddfMyYNAxVp44ocTHyp37DAo3vHQ1qGfcc4f4KQ==", "integrity": "sha512-1y4b8he9djNQYteKFRnDisryOGV70SQOaSuiNJgKaIPFFJ9DwYbz/ZCV0k0Ld4zqB4Ncm8ibBmyYuZg+yoOBuQ==",
"dependencies": { "dependencies": {
"@libp2p/interface": "0.1.6-d8f5bc211", "@libp2p/interface": "^1.0.1",
"it-length-prefixed": "^9.0.3", "it-length-prefixed": "^9.0.3",
"it-length-prefixed-stream": "^1.1.1", "it-length-prefixed-stream": "^1.1.1",
"it-pipe": "^3.0.1", "it-pipe": "^3.0.1",
"it-stream-types": "^2.0.1", "it-stream-types": "^2.0.1",
"p-defer": "^4.0.0",
"uint8-varint": "^2.0.2", "uint8-varint": "^2.0.2",
"uint8arraylist": "^2.4.3", "uint8arraylist": "^2.4.3",
"uint8arrays": "^4.0.6" "uint8arrays": "^4.0.6"
} }
}, },
"node_modules/@libp2p/multistream-select/node_modules/@libp2p/interface": {
"version": "0.1.6-d8f5bc211",
"resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-d8f5bc211.tgz",
"integrity": "sha512-TpetndcnUxxbS9fxejLUhD8I9DqyWbgkhhtFoSUGa78rkhF8Dn/zIiEuNdW73kXAErb/HTpuB9BCGrroEShi/w==",
"dependencies": {
"@multiformats/multiaddr": "^12.1.10",
"it-pushable": "^3.2.1",
"it-stream-types": "^2.0.1",
"multiformats": "^12.1.3",
"uint8arraylist": "^2.4.3"
}
},
"node_modules/@libp2p/peer-collections": { "node_modules/@libp2p/peer-collections": {
"version": "4.0.8-d8f5bc211", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/@libp2p/peer-collections/-/peer-collections-4.0.8-d8f5bc211.tgz", "resolved": "https://registry.npmjs.org/@libp2p/peer-collections/-/peer-collections-5.0.0.tgz",
"integrity": "sha512-b6oJKUuXXetqLq+ivcaXRYHYTCe6uYnnmPcdxox2MsJFMKmgJUcoSQckvxAwvTwkAJ7ipCR1BqKgeFgPW1acQg==", "integrity": "sha512-2h6BF6t68TxnsErZrPzkMapH0GpZSCmOaimUMidrs9oSnxIMf62QnNAbfar8U2XbXnPJD9WkEicnSuJgDwg8Vw==",
"dependencies": { "dependencies": {
"@libp2p/interface": "0.1.6-d8f5bc211", "@libp2p/interface": "^1.0.1",
"@libp2p/peer-id": "3.0.6-d8f5bc211" "@libp2p/peer-id": "^4.0.1"
}
},
"node_modules/@libp2p/peer-collections/node_modules/@libp2p/interface": {
"version": "0.1.6-d8f5bc211",
"resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-d8f5bc211.tgz",
"integrity": "sha512-TpetndcnUxxbS9fxejLUhD8I9DqyWbgkhhtFoSUGa78rkhF8Dn/zIiEuNdW73kXAErb/HTpuB9BCGrroEShi/w==",
"dependencies": {
"@multiformats/multiaddr": "^12.1.10",
"it-pushable": "^3.2.1",
"it-stream-types": "^2.0.1",
"multiformats": "^12.1.3",
"uint8arraylist": "^2.4.3"
}
},
"node_modules/@libp2p/peer-collections/node_modules/@libp2p/peer-id": {
"version": "3.0.6-d8f5bc211",
"resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6-d8f5bc211.tgz",
"integrity": "sha512-lCmqh5bK6o793xauQmeY53Xw5XdeKvmqJj8snQgi+CoMhqKtn1ScICSki6cL/sQmxwEhnotvfMxrrNejoR8OYA==",
"dependencies": {
"@libp2p/interface": "0.1.6-d8f5bc211",
"multiformats": "^12.1.3",
"uint8arrays": "^4.0.6"
} }
}, },
"node_modules/@libp2p/peer-id": { "node_modules/@libp2p/peer-id": {
"version": "3.0.6", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6.tgz", "resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-4.0.1.tgz",
"integrity": "sha512-iN1Ia5gH2U1V/GOVRmLHmVY6fblxzrOPUoZrMYjHl/K4s+AiI7ym/527WDeQvhQpD7j3TfDwcAYforD2dLGpLw==", "integrity": "sha512-rEgZ4YPSVh7gqIXxWE9HVw318Og8fJohI2vWXNx2h+Ib/iMQTGrqGgSaJhjUMWYIy8MadpjofCPXObPEIX3E3g==",
"dependencies": { "dependencies": {
"@libp2p/interface": "^0.1.6", "@libp2p/interface": "^1.0.1",
"multiformats": "^12.0.1", "multiformats": "^12.1.3",
"uint8arrays": "^4.0.6" "uint8arrays": "^4.0.6"
} }
}, },
"node_modules/@libp2p/peer-id-factory": { "node_modules/@libp2p/peer-id-factory": {
"version": "3.0.8-d8f5bc211", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/@libp2p/peer-id-factory/-/peer-id-factory-3.0.8-d8f5bc211.tgz", "resolved": "https://registry.npmjs.org/@libp2p/peer-id-factory/-/peer-id-factory-4.0.0.tgz",
"integrity": "sha512-W1CRuXT5R6UjP1OnaBwj5Sek+74SlCUerQ5naRTNRrtXCWU9MpyrnAMG+a0Zkbt70TcpuIDaJKnoJEo37hIIaw==", "integrity": "sha512-dFbQOpxqEw4CqV+ZalMc5UABqts+hskMoaqytjmR55pXgL4KDamOyg7hBT/HrHRp2sStf8E2vwQ5wnjv1W9uFQ==",
"dependencies": { "dependencies": {
"@libp2p/crypto": "2.0.8-d8f5bc211", "@libp2p/crypto": "^3.0.1",
"@libp2p/interface": "0.1.6-d8f5bc211", "@libp2p/interface": "^1.0.1",
"@libp2p/peer-id": "3.0.6-d8f5bc211", "@libp2p/peer-id": "^4.0.1",
"multiformats": "^12.1.3", "multiformats": "^12.1.3",
"protons-runtime": "^5.0.0", "protons-runtime": "^5.0.0",
"uint8arraylist": "^2.4.3", "uint8arraylist": "^2.4.3",
"uint8arrays": "^4.0.6" "uint8arrays": "^4.0.6"
} }
}, },
"node_modules/@libp2p/peer-id-factory/node_modules/@libp2p/crypto": {
"version": "2.0.8-d8f5bc211",
"resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-2.0.8-d8f5bc211.tgz",
"integrity": "sha512-EX/wl/2Ln0eMcMjfjFSNzIvYE9m7ISOoeYcY7joQPF4YukMrLgLtWn00NHwvEssWzwyGjYk+jdeM/3AGVlr5KQ==",
"dependencies": {
"@libp2p/interface": "0.1.6-d8f5bc211",
"@noble/curves": "^1.1.0",
"@noble/hashes": "^1.3.1",
"multiformats": "^12.1.3",
"node-forge": "^1.1.0",
"protons-runtime": "^5.0.0",
"uint8arraylist": "^2.4.3",
"uint8arrays": "^4.0.6"
}
},
"node_modules/@libp2p/peer-id-factory/node_modules/@libp2p/interface": {
"version": "0.1.6-d8f5bc211",
"resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-d8f5bc211.tgz",
"integrity": "sha512-TpetndcnUxxbS9fxejLUhD8I9DqyWbgkhhtFoSUGa78rkhF8Dn/zIiEuNdW73kXAErb/HTpuB9BCGrroEShi/w==",
"dependencies": {
"@multiformats/multiaddr": "^12.1.10",
"it-pushable": "^3.2.1",
"it-stream-types": "^2.0.1",
"multiformats": "^12.1.3",
"uint8arraylist": "^2.4.3"
}
},
"node_modules/@libp2p/peer-id-factory/node_modules/@libp2p/peer-id": {
"version": "3.0.6-d8f5bc211",
"resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6-d8f5bc211.tgz",
"integrity": "sha512-lCmqh5bK6o793xauQmeY53Xw5XdeKvmqJj8snQgi+CoMhqKtn1ScICSki6cL/sQmxwEhnotvfMxrrNejoR8OYA==",
"dependencies": {
"@libp2p/interface": "0.1.6-d8f5bc211",
"multiformats": "^12.1.3",
"uint8arrays": "^4.0.6"
}
},
"node_modules/@libp2p/peer-record": { "node_modules/@libp2p/peer-record": {
"version": "6.0.9-d8f5bc211", "version": "7.0.0",
"resolved": "https://registry.npmjs.org/@libp2p/peer-record/-/peer-record-6.0.9-d8f5bc211.tgz", "resolved": "https://registry.npmjs.org/@libp2p/peer-record/-/peer-record-7.0.0.tgz",
"integrity": "sha512-UZ+9+LeIC9hkobjOrobMa5rNVNaF9EY7hShF1JqzNl0uBYmPxwp3pQbVHBSIrZm1j7Hl24SvkXBHIyuWZMkiwQ==", "integrity": "sha512-Kr5XgyRzqJjK4rBu+QA2e2zGT59rp2OKD8kviwpE4NwKWyDs85JaRduorso9KujJG/F0uZI8tOhPjadO1Lwatw==",
"dependencies": { "dependencies": {
"@libp2p/crypto": "2.0.8-d8f5bc211", "@libp2p/crypto": "^3.0.1",
"@libp2p/interface": "0.1.6-d8f5bc211", "@libp2p/interface": "^1.0.1",
"@libp2p/peer-id": "3.0.6-d8f5bc211", "@libp2p/peer-id": "^4.0.1",
"@libp2p/utils": "4.0.7-d8f5bc211", "@libp2p/utils": "^5.0.2",
"@multiformats/multiaddr": "^12.1.10", "@multiformats/multiaddr": "^12.1.10",
"protons-runtime": "^5.0.0", "protons-runtime": "^5.0.0",
"uint8-varint": "^2.0.0", "uint8-varint": "^2.0.0",
@ -284,53 +194,16 @@
"uint8arrays": "^4.0.6" "uint8arrays": "^4.0.6"
} }
}, },
"node_modules/@libp2p/peer-record/node_modules/@libp2p/crypto": {
"version": "2.0.8-d8f5bc211",
"resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-2.0.8-d8f5bc211.tgz",
"integrity": "sha512-EX/wl/2Ln0eMcMjfjFSNzIvYE9m7ISOoeYcY7joQPF4YukMrLgLtWn00NHwvEssWzwyGjYk+jdeM/3AGVlr5KQ==",
"dependencies": {
"@libp2p/interface": "0.1.6-d8f5bc211",
"@noble/curves": "^1.1.0",
"@noble/hashes": "^1.3.1",
"multiformats": "^12.1.3",
"node-forge": "^1.1.0",
"protons-runtime": "^5.0.0",
"uint8arraylist": "^2.4.3",
"uint8arrays": "^4.0.6"
}
},
"node_modules/@libp2p/peer-record/node_modules/@libp2p/interface": {
"version": "0.1.6-d8f5bc211",
"resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-d8f5bc211.tgz",
"integrity": "sha512-TpetndcnUxxbS9fxejLUhD8I9DqyWbgkhhtFoSUGa78rkhF8Dn/zIiEuNdW73kXAErb/HTpuB9BCGrroEShi/w==",
"dependencies": {
"@multiformats/multiaddr": "^12.1.10",
"it-pushable": "^3.2.1",
"it-stream-types": "^2.0.1",
"multiformats": "^12.1.3",
"uint8arraylist": "^2.4.3"
}
},
"node_modules/@libp2p/peer-record/node_modules/@libp2p/peer-id": {
"version": "3.0.6-d8f5bc211",
"resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6-d8f5bc211.tgz",
"integrity": "sha512-lCmqh5bK6o793xauQmeY53Xw5XdeKvmqJj8snQgi+CoMhqKtn1ScICSki6cL/sQmxwEhnotvfMxrrNejoR8OYA==",
"dependencies": {
"@libp2p/interface": "0.1.6-d8f5bc211",
"multiformats": "^12.1.3",
"uint8arrays": "^4.0.6"
}
},
"node_modules/@libp2p/peer-store": { "node_modules/@libp2p/peer-store": {
"version": "9.0.9-d8f5bc211", "version": "10.0.0",
"resolved": "https://registry.npmjs.org/@libp2p/peer-store/-/peer-store-9.0.9-d8f5bc211.tgz", "resolved": "https://registry.npmjs.org/@libp2p/peer-store/-/peer-store-10.0.0.tgz",
"integrity": "sha512-tyTo+0VrZL0t+RcVqZiNPJCIVW5+BPowF0Um6sK8fAGECIWuigabpPhyiIpkpFy4eai+7dfujgUt97jJK0DMew==", "integrity": "sha512-DQilgZXfwokKTbr1EDQssIfn5bAMLCEUronhqy9VEIrF7mkiSqjsBtOcftDEJT4dXhDOV8F7mifznvJI32tZIA==",
"dependencies": { "dependencies": {
"@libp2p/interface": "0.1.6-d8f5bc211", "@libp2p/interface": "^1.0.1",
"@libp2p/peer-collections": "4.0.8-d8f5bc211", "@libp2p/peer-collections": "^5.0.0",
"@libp2p/peer-id": "3.0.6-d8f5bc211", "@libp2p/peer-id": "^4.0.1",
"@libp2p/peer-id-factory": "3.0.8-d8f5bc211", "@libp2p/peer-id-factory": "^4.0.0",
"@libp2p/peer-record": "6.0.9-d8f5bc211", "@libp2p/peer-record": "^7.0.0",
"@multiformats/multiaddr": "^12.1.10", "@multiformats/multiaddr": "^12.1.10",
"interface-datastore": "^8.2.0", "interface-datastore": "^8.2.0",
"it-all": "^3.0.2", "it-all": "^3.0.2",
@ -341,83 +214,37 @@
"uint8arrays": "^4.0.6" "uint8arrays": "^4.0.6"
} }
}, },
"node_modules/@libp2p/peer-store/node_modules/@libp2p/interface": {
"version": "0.1.6-d8f5bc211",
"resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-d8f5bc211.tgz",
"integrity": "sha512-TpetndcnUxxbS9fxejLUhD8I9DqyWbgkhhtFoSUGa78rkhF8Dn/zIiEuNdW73kXAErb/HTpuB9BCGrroEShi/w==",
"dependencies": {
"@multiformats/multiaddr": "^12.1.10",
"it-pushable": "^3.2.1",
"it-stream-types": "^2.0.1",
"multiformats": "^12.1.3",
"uint8arraylist": "^2.4.3"
}
},
"node_modules/@libp2p/peer-store/node_modules/@libp2p/peer-id": {
"version": "3.0.6-d8f5bc211",
"resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6-d8f5bc211.tgz",
"integrity": "sha512-lCmqh5bK6o793xauQmeY53Xw5XdeKvmqJj8snQgi+CoMhqKtn1ScICSki6cL/sQmxwEhnotvfMxrrNejoR8OYA==",
"dependencies": {
"@libp2p/interface": "0.1.6-d8f5bc211",
"multiformats": "^12.1.3",
"uint8arrays": "^4.0.6"
}
},
"node_modules/@libp2p/perf": { "node_modules/@libp2p/perf": {
"version": "2.0.1-d8f5bc211", "version": "3.0.4",
"resolved": "https://registry.npmjs.org/@libp2p/perf/-/perf-2.0.1-d8f5bc211.tgz", "resolved": "https://registry.npmjs.org/@libp2p/perf/-/perf-3.0.4.tgz",
"integrity": "sha512-FUnjoFsHYcSYmOAPUP68l0fpfDpVjCCz1Kd5LFQ0Bu9tkS9C5YkOHw7GtWXgmB72QISYgdGfCBLa107pT/q+dg==", "integrity": "sha512-keoLx6WkhWn+W5IA6Y4m/N1JxfLdpReXdDmrNMDwoLFsymWI0KmCUq/wQRT3l2T+xRlSPthg+Q7/QabJDSU3ig==",
"dependencies": { "dependencies": {
"@libp2p/interface": "0.1.6-d8f5bc211", "@libp2p/interface": "^1.0.1",
"@libp2p/interface-internal": "0.1.9-d8f5bc211", "@libp2p/interface-internal": "^1.0.1",
"@multiformats/multiaddr": "^12.1.10", "@multiformats/multiaddr": "^12.1.10",
"it-pushable": "^3.2.3" "it-pushable": "^3.2.3"
} }
}, },
"node_modules/@libp2p/perf/node_modules/@libp2p/interface": {
"version": "0.1.6-d8f5bc211",
"resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-d8f5bc211.tgz",
"integrity": "sha512-TpetndcnUxxbS9fxejLUhD8I9DqyWbgkhhtFoSUGa78rkhF8Dn/zIiEuNdW73kXAErb/HTpuB9BCGrroEShi/w==",
"dependencies": {
"@multiformats/multiaddr": "^12.1.10",
"it-pushable": "^3.2.1",
"it-stream-types": "^2.0.1",
"multiformats": "^12.1.3",
"uint8arraylist": "^2.4.3"
}
},
"node_modules/@libp2p/tcp": { "node_modules/@libp2p/tcp": {
"version": "8.0.13-d8f5bc211", "version": "9.0.4",
"resolved": "https://registry.npmjs.org/@libp2p/tcp/-/tcp-8.0.13-d8f5bc211.tgz", "resolved": "https://registry.npmjs.org/@libp2p/tcp/-/tcp-9.0.4.tgz",
"integrity": "sha512-EXa2HUZmPGmcEd71vYmtSuEjbfqr272/rCCCLgt1qX5WEUjSOUJI/rKEW5Zxz4lpl28ufFCpeJZMw2i7jw/eYg==", "integrity": "sha512-q3wAZMhEUXIEKnHPPHEjcO564P7pIkCWazC8SUGIPRLbmuSnni8cT2kd/Jx6xSv5ZOK2LHzJSKodLlpfi1Gmzg==",
"dependencies": { "dependencies": {
"@libp2p/interface": "0.1.6-d8f5bc211", "@libp2p/interface": "^1.0.1",
"@libp2p/utils": "4.0.7-d8f5bc211", "@libp2p/utils": "^5.0.2",
"@multiformats/mafmt": "^12.1.6", "@multiformats/mafmt": "^12.1.6",
"@multiformats/multiaddr": "^12.1.10", "@multiformats/multiaddr": "^12.1.10",
"@types/sinon": "^17.0.0", "@types/sinon": "^17.0.0",
"stream-to-it": "^0.2.2" "stream-to-it": "^0.2.2"
} }
}, },
"node_modules/@libp2p/tcp/node_modules/@libp2p/interface": {
"version": "0.1.6-d8f5bc211",
"resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-d8f5bc211.tgz",
"integrity": "sha512-TpetndcnUxxbS9fxejLUhD8I9DqyWbgkhhtFoSUGa78rkhF8Dn/zIiEuNdW73kXAErb/HTpuB9BCGrroEShi/w==",
"dependencies": {
"@multiformats/multiaddr": "^12.1.10",
"it-pushable": "^3.2.1",
"it-stream-types": "^2.0.1",
"multiformats": "^12.1.3",
"uint8arraylist": "^2.4.3"
}
},
"node_modules/@libp2p/utils": { "node_modules/@libp2p/utils": {
"version": "4.0.7-d8f5bc211", "version": "5.0.2",
"resolved": "https://registry.npmjs.org/@libp2p/utils/-/utils-4.0.7-d8f5bc211.tgz", "resolved": "https://registry.npmjs.org/@libp2p/utils/-/utils-5.0.2.tgz",
"integrity": "sha512-/QsY2IokV1ebFojNLEIe/QVPJ5+pVg8oiwMeGBRQp3M8b5Tp0Ozjm8C9QC98CG9NNGL5ssaO1TrUKOB16j8Q2A==", "integrity": "sha512-PcDAH8pwtXq0pfoO9arHtg3CsqF+reheUd0OaQ9/Fn0YjjNpqcpseQyByBiwhiuQsauWo5RU+CKqRaRdvXKemA==",
"dependencies": { "dependencies": {
"@chainsafe/is-ip": "^2.0.2", "@chainsafe/is-ip": "^2.0.2",
"@libp2p/interface": "0.1.6-d8f5bc211", "@libp2p/interface": "^1.0.1",
"@multiformats/multiaddr": "^12.1.10", "@multiformats/multiaddr": "^12.1.10",
"@multiformats/multiaddr-matcher": "^1.1.0", "@multiformats/multiaddr-matcher": "^1.1.0",
"get-iterator": "^2.0.1", "get-iterator": "^2.0.1",
@ -430,18 +257,6 @@
"uint8arraylist": "^2.4.3" "uint8arraylist": "^2.4.3"
} }
}, },
"node_modules/@libp2p/utils/node_modules/@libp2p/interface": {
"version": "0.1.6-d8f5bc211",
"resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-d8f5bc211.tgz",
"integrity": "sha512-TpetndcnUxxbS9fxejLUhD8I9DqyWbgkhhtFoSUGa78rkhF8Dn/zIiEuNdW73kXAErb/HTpuB9BCGrroEShi/w==",
"dependencies": {
"@multiformats/multiaddr": "^12.1.10",
"it-pushable": "^3.2.1",
"it-stream-types": "^2.0.1",
"multiformats": "^12.1.3",
"uint8arraylist": "^2.4.3"
}
},
"node_modules/@multiformats/mafmt": { "node_modules/@multiformats/mafmt": {
"version": "12.1.6", "version": "12.1.6",
"resolved": "https://registry.npmjs.org/@multiformats/mafmt/-/mafmt-12.1.6.tgz", "resolved": "https://registry.npmjs.org/@multiformats/mafmt/-/mafmt-12.1.6.tgz",
@ -451,13 +266,13 @@
} }
}, },
"node_modules/@multiformats/multiaddr": { "node_modules/@multiformats/multiaddr": {
"version": "12.1.10", "version": "12.1.11",
"resolved": "https://registry.npmjs.org/@multiformats/multiaddr/-/multiaddr-12.1.10.tgz", "resolved": "https://registry.npmjs.org/@multiformats/multiaddr/-/multiaddr-12.1.11.tgz",
"integrity": "sha512-Bi3nJ/SE17+te40OLxFOpr9CvRodusZZLYZb3e5a0w9RzQcHzfKnnlfqdysLXZ2W5vXgxCUL/Uhndl51Ff2S+Q==", "integrity": "sha512-CWG9kETEGTTMdr1T+/JEuMwFld3r3fHNP8LkLoUcLvHRy6yr8sWdotVGEDNEdDO/vrKhuD7bQBws3xMSMMyylg==",
"dependencies": { "dependencies": {
"@chainsafe/is-ip": "^2.0.1", "@chainsafe/is-ip": "^2.0.1",
"@chainsafe/netmask": "^2.0.0", "@chainsafe/netmask": "^2.0.0",
"@libp2p/interface": "^0.1.1", "@libp2p/interface": "^1.0.0",
"dns-over-http-resolver": "3.0.0", "dns-over-http-resolver": "3.0.0",
"multiformats": "^12.0.1", "multiformats": "^12.0.1",
"uint8-varint": "^2.0.1", "uint8-varint": "^2.0.1",
@ -505,9 +320,9 @@
} }
}, },
"node_modules/@types/sinon": { "node_modules/@types/sinon": {
"version": "17.0.1", "version": "17.0.2",
"resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.1.tgz", "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.2.tgz",
"integrity": "sha512-Q2Go6TJetYn5Za1+RJA1Aik61Oa2FS8SuJ0juIqUuJ5dZR4wvhKfmSdIqWtQ3P6gljKWjW0/R7FZkA4oXVL6OA==", "integrity": "sha512-Zt6heIGsdqERkxctIpvN5Pv3edgBrhoeb3yHyxffd4InN0AX2SVNKSrhdDZKGQICVOxWP/q4DyhpfPNMSrpIiA==",
"dependencies": { "dependencies": {
"@types/sinonjs__fake-timers": "*" "@types/sinonjs__fake-timers": "*"
} }
@ -517,19 +332,6 @@
"resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.5.tgz", "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.5.tgz",
"integrity": "sha512-mQkU2jY8jJEF7YHjHvsQO8+3ughTL1mcnn96igfhONmR+fUPSKIkefQYpSe8bsly2Ep7oQbn/6VG5/9/0qcArQ==" "integrity": "sha512-mQkU2jY8jJEF7YHjHvsQO8+3ughTL1mcnn96igfhONmR+fUPSKIkefQYpSe8bsly2Ep7oQbn/6VG5/9/0qcArQ=="
}, },
"node_modules/abortable-iterator": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/abortable-iterator/-/abortable-iterator-5.0.1.tgz",
"integrity": "sha512-hlZ5Z8UwqrKsJcelVPEqDduZowJPBQJ9ZhBC2FXpja3lXy8X6MoI5uMzIgmrA8+3jcVnp8TF/tx+IBBqYJNUrg==",
"dependencies": {
"get-iterator": "^2.0.0",
"it-stream-types": "^2.0.1"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/any-signal": { "node_modules/any-signal": {
"version": "4.1.1", "version": "4.1.1",
"resolved": "https://registry.npmjs.org/any-signal/-/any-signal-4.1.1.tgz", "resolved": "https://registry.npmjs.org/any-signal/-/any-signal-4.1.1.tgz",
@ -540,11 +342,11 @@
} }
}, },
"node_modules/datastore-core": { "node_modules/datastore-core": {
"version": "9.2.3", "version": "9.2.5",
"resolved": "https://registry.npmjs.org/datastore-core/-/datastore-core-9.2.3.tgz", "resolved": "https://registry.npmjs.org/datastore-core/-/datastore-core-9.2.5.tgz",
"integrity": "sha512-jcvrVDt+jp7lUp2WhMXXgX/hoi3VcJebN+z/ZXbIRKOVfNOF4bl8cvr7sQ1y9qITikgC2coXFYd79Wzt/n13ZQ==", "integrity": "sha512-3Z54iBjwj4KDp5Se4aZRYWnjv1OlQgPfrEF2X+T9rlet8Pe3AKRLVYx0v+11PuL+47d7w0Vc/4847Ylas6fEbQ==",
"dependencies": { "dependencies": {
"@libp2p/logger": "^3.0.0", "@libp2p/logger": "^4.0.1",
"err-code": "^3.0.1", "err-code": "^3.0.1",
"interface-store": "^5.0.0", "interface-store": "^5.0.0",
"it-all": "^3.0.1", "it-all": "^3.0.1",
@ -611,19 +413,19 @@
"integrity": "sha512-7HuY/hebu4gryTDT7O/XY/fvY9wRByEGdK6QOa4of8npTcv0+NS6frFKABcf6S9EBAsveTuKTsZQQBFMMNILIg==" "integrity": "sha512-7HuY/hebu4gryTDT7O/XY/fvY9wRByEGdK6QOa4of8npTcv0+NS6frFKABcf6S9EBAsveTuKTsZQQBFMMNILIg=="
}, },
"node_modules/interface-datastore": { "node_modules/interface-datastore": {
"version": "8.2.5", "version": "8.2.7",
"resolved": "https://registry.npmjs.org/interface-datastore/-/interface-datastore-8.2.5.tgz", "resolved": "https://registry.npmjs.org/interface-datastore/-/interface-datastore-8.2.7.tgz",
"integrity": "sha512-kvLGJMz3RPoJF/g5DbEvfWWempIiSBLVMf63b0PBsziVcSkj0ofzHYI86v8vqpGedkQ81DtPCUKyvX9W7zWvrQ==", "integrity": "sha512-ot5B5+VogufRfjhedAXZHm5NuEKyYZkDyVpTjBYIrxYUpS5GIfF2soE/dsd/FiBVqubcxa4IEToMXL5ruMwhjw==",
"dependencies": { "dependencies": {
"interface-store": "^5.0.0", "interface-store": "^5.0.0",
"nanoid": "^4.0.0", "nanoid": "^5.0.3",
"uint8arrays": "^4.0.2" "uint8arrays": "^4.0.2"
} }
}, },
"node_modules/interface-store": { "node_modules/interface-store": {
"version": "5.1.4", "version": "5.1.5",
"resolved": "https://registry.npmjs.org/interface-store/-/interface-store-5.1.4.tgz", "resolved": "https://registry.npmjs.org/interface-store/-/interface-store-5.1.5.tgz",
"integrity": "sha512-SI2co5IAxAybBc9egRM2bXvHOa1RPh5SQQkO6di6t/aX92RbtzP4t8raB0l3GTzQmJADaBbzz8Tfa1QLgfMdGQ==" "integrity": "sha512-X0KnJBk3o+YL13MxZBMwa88/b3Mdrpm0yPzkSTKDDVn9BSPH7UK6W+ZtIPO2bxKOQVmq7zqOwAnYnpfqWjb6/g=="
}, },
"node_modules/ip-regex": { "node_modules/ip-regex": {
"version": "5.0.0", "version": "5.0.0",
@ -722,9 +524,9 @@
} }
}, },
"node_modules/it-length-prefixed-stream": { "node_modules/it-length-prefixed-stream": {
"version": "1.1.3", "version": "1.1.4",
"resolved": "https://registry.npmjs.org/it-length-prefixed-stream/-/it-length-prefixed-stream-1.1.3.tgz", "resolved": "https://registry.npmjs.org/it-length-prefixed-stream/-/it-length-prefixed-stream-1.1.4.tgz",
"integrity": "sha512-NJvKLB3k8e2AdDCYn2dSgCBKB8m05AMqItdjAjiZ28U71FRwQEVrEnCn1cW6ufu3+8dOX4dsFu8c63Ww4Vflhw==", "integrity": "sha512-6YcQ5jsaYnuXBqF+oSGjSdSY9jF7HWl7yh+dxYytXxbE2GcdiOpn6pLM7m6AlIID9MCzQqMY5nOzaiatQ8A3/A==",
"dependencies": { "dependencies": {
"it-byte-stream": "^1.0.0", "it-byte-stream": "^1.0.0",
"it-length-prefixed": "^9.0.1", "it-length-prefixed": "^9.0.1",
@ -825,20 +627,20 @@
"integrity": "sha512-RG8HDjAZlvkzz5Nav4xq6gK5zNT+Ff1UTIf+CrSJW8nIl6N1FpBH5e7clUshiCn+MmmMoSdIEpw4UaTolszxhA==" "integrity": "sha512-RG8HDjAZlvkzz5Nav4xq6gK5zNT+Ff1UTIf+CrSJW8nIl6N1FpBH5e7clUshiCn+MmmMoSdIEpw4UaTolszxhA=="
}, },
"node_modules/libp2p": { "node_modules/libp2p": {
"version": "0.46.21-d8f5bc211", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/libp2p/-/libp2p-0.46.21-d8f5bc211.tgz", "resolved": "https://registry.npmjs.org/libp2p/-/libp2p-1.0.5.tgz",
"integrity": "sha512-vQN9rdTBydRy4fut6+o46I+f0Xb9YEI2s/8WJfgcVpU1ff58Zky3z+tEbGnwOk0MYu6kpWczUKNjUIXApR+N7A==", "integrity": "sha512-h6JsVRCo31WWNwZxI6T5e0hbBagw6GG2N4u2n1vCpnSyVPZQV64cm3hgMQFuNPHv3e69+ABGq2viHRzrBDAaTw==",
"dependencies": { "dependencies": {
"@libp2p/crypto": "2.0.8-d8f5bc211", "@libp2p/crypto": "^3.0.1",
"@libp2p/interface": "0.1.6-d8f5bc211", "@libp2p/interface": "^1.0.1",
"@libp2p/interface-internal": "0.1.9-d8f5bc211", "@libp2p/interface-internal": "^1.0.1",
"@libp2p/logger": "3.1.0-d8f5bc211", "@libp2p/logger": "^4.0.1",
"@libp2p/multistream-select": "4.0.6-d8f5bc211", "@libp2p/multistream-select": "^5.0.0",
"@libp2p/peer-collections": "4.0.8-d8f5bc211", "@libp2p/peer-collections": "^5.0.0",
"@libp2p/peer-id": "3.0.6-d8f5bc211", "@libp2p/peer-id": "^4.0.1",
"@libp2p/peer-id-factory": "3.0.8-d8f5bc211", "@libp2p/peer-id-factory": "^4.0.0",
"@libp2p/peer-store": "9.0.9-d8f5bc211", "@libp2p/peer-store": "^10.0.0",
"@libp2p/utils": "4.0.7-d8f5bc211", "@libp2p/utils": "^5.0.2",
"@multiformats/mafmt": "^12.1.6", "@multiformats/mafmt": "^12.1.6",
"@multiformats/multiaddr": "^12.1.10", "@multiformats/multiaddr": "^12.1.10",
"@multiformats/multiaddr-matcher": "^1.1.0", "@multiformats/multiaddr-matcher": "^1.1.0",
@ -864,55 +666,6 @@
"uint8arrays": "^4.0.6" "uint8arrays": "^4.0.6"
} }
}, },
"node_modules/libp2p/node_modules/@libp2p/crypto": {
"version": "2.0.8-d8f5bc211",
"resolved": "https://registry.npmjs.org/@libp2p/crypto/-/crypto-2.0.8-d8f5bc211.tgz",
"integrity": "sha512-EX/wl/2Ln0eMcMjfjFSNzIvYE9m7ISOoeYcY7joQPF4YukMrLgLtWn00NHwvEssWzwyGjYk+jdeM/3AGVlr5KQ==",
"dependencies": {
"@libp2p/interface": "0.1.6-d8f5bc211",
"@noble/curves": "^1.1.0",
"@noble/hashes": "^1.3.1",
"multiformats": "^12.1.3",
"node-forge": "^1.1.0",
"protons-runtime": "^5.0.0",
"uint8arraylist": "^2.4.3",
"uint8arrays": "^4.0.6"
}
},
"node_modules/libp2p/node_modules/@libp2p/interface": {
"version": "0.1.6-d8f5bc211",
"resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6-d8f5bc211.tgz",
"integrity": "sha512-TpetndcnUxxbS9fxejLUhD8I9DqyWbgkhhtFoSUGa78rkhF8Dn/zIiEuNdW73kXAErb/HTpuB9BCGrroEShi/w==",
"dependencies": {
"@multiformats/multiaddr": "^12.1.10",
"it-pushable": "^3.2.1",
"it-stream-types": "^2.0.1",
"multiformats": "^12.1.3",
"uint8arraylist": "^2.4.3"
}
},
"node_modules/libp2p/node_modules/@libp2p/logger": {
"version": "3.1.0-d8f5bc211",
"resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-3.1.0-d8f5bc211.tgz",
"integrity": "sha512-3CoLZmoM7mJV3ttGbYgsS8926/e768Ayll+66wFhfxYuDRFLhybKAwV0UbReeNP24f4pd8Fj1izyBd/1XftErw==",
"dependencies": {
"@libp2p/interface": "0.1.6-d8f5bc211",
"@multiformats/multiaddr": "^12.1.10",
"debug": "^4.3.4",
"interface-datastore": "^8.2.0",
"multiformats": "^12.1.3"
}
},
"node_modules/libp2p/node_modules/@libp2p/peer-id": {
"version": "3.0.6-d8f5bc211",
"resolved": "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-3.0.6-d8f5bc211.tgz",
"integrity": "sha512-lCmqh5bK6o793xauQmeY53Xw5XdeKvmqJj8snQgi+CoMhqKtn1ScICSki6cL/sQmxwEhnotvfMxrrNejoR8OYA==",
"dependencies": {
"@libp2p/interface": "0.1.6-d8f5bc211",
"multiformats": "^12.1.3",
"uint8arrays": "^4.0.6"
}
},
"node_modules/merge-options": { "node_modules/merge-options": {
"version": "3.0.4", "version": "3.0.4",
"resolved": "https://registry.npmjs.org/merge-options/-/merge-options-3.0.4.tgz", "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-3.0.4.tgz",
@ -939,6 +692,23 @@
"npm": ">=7.0.0" "npm": ">=7.0.0"
} }
}, },
"node_modules/mortice/node_modules/nanoid": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.2.tgz",
"integrity": "sha512-7ZtY5KTCNheRGfEFxnedV5zFiORN1+Y1N6zvPTnHQd8ENUvfaDBeuJDZb2bN/oXwXxu3qkTXDzy57W5vAmDTBw==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"bin": {
"nanoid": "bin/nanoid.js"
},
"engines": {
"node": "^14 || ^16 || >=18"
}
},
"node_modules/ms": { "node_modules/ms": {
"version": "2.1.2", "version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
@ -954,9 +724,9 @@
} }
}, },
"node_modules/nanoid": { "node_modules/nanoid": {
"version": "4.0.2", "version": "5.0.3",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-4.0.2.tgz", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.0.3.tgz",
"integrity": "sha512-7ZtY5KTCNheRGfEFxnedV5zFiORN1+Y1N6zvPTnHQd8ENUvfaDBeuJDZb2bN/oXwXxu3qkTXDzy57W5vAmDTBw==", "integrity": "sha512-I7X2b22cxA4LIHXPSqbBCEQSL+1wv8TuoefejsX4HFWyC6jc5JG7CEaxOltiKjc1M+YCS2YkrZZcj4+dytw9GA==",
"funding": [ "funding": [
{ {
"type": "github", "type": "github",
@ -967,7 +737,7 @@
"nanoid": "bin/nanoid.js" "nanoid": "bin/nanoid.js"
}, },
"engines": { "engines": {
"node": "^14 || ^16 || >=18" "node": "^18 || >=20"
} }
}, },
"node_modules/netmask": { "node_modules/netmask": {
@ -1107,21 +877,17 @@
} }
}, },
"node_modules/uint8arraylist": { "node_modules/uint8arraylist": {
"version": "2.4.3", "version": "2.4.7",
"resolved": "https://registry.npmjs.org/uint8arraylist/-/uint8arraylist-2.4.3.tgz", "resolved": "https://registry.npmjs.org/uint8arraylist/-/uint8arraylist-2.4.7.tgz",
"integrity": "sha512-oEVZr4/GrH87K0kjNce6z8pSCzLEPqHNLNR5sj8cJOySrTP8Vb/pMIbZKLJGhQKxm1TiZ31atNrpn820Pyqpow==", "integrity": "sha512-ohRElqR6C5dd60vRFLq40MCiSnUe1AzkpHvbCEMCGGP6zMoFYECsjdhL6bR1kTK37ONNRDuHQ3RIpScRYcYYIg==",
"dependencies": { "dependencies": {
"uint8arrays": "^4.0.2" "uint8arrays": "^4.0.2"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
} }
}, },
"node_modules/uint8arrays": { "node_modules/uint8arrays": {
"version": "4.0.6", "version": "4.0.9",
"resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.6.tgz", "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.9.tgz",
"integrity": "sha512-4ZesjQhqOU2Ip6GPReIwN60wRxIupavL8T0Iy36BBHr2qyMrNxsPJvr7vpS4eFt8F8kSguWUPad6ZM9izs/vyw==", "integrity": "sha512-iHU8XJJnfeijILZWzV7RgILdPHqe0mjJvyzY4mO8aUUtHsDbPa2Gc8/02Kc4zeokp2W6Qq8z9Ap1xkQ1HfbKwg==",
"dependencies": { "dependencies": {
"multiformats": "^12.0.1" "multiformats": "^12.0.1"
} }

View File

@ -4,10 +4,10 @@
"main": "index.js", "main": "index.js",
"type": "module", "type": "module",
"dependencies": { "dependencies": {
"@chainsafe/libp2p-noise": "^13.0.3", "@chainsafe/libp2p-noise": "^14.0.0",
"@chainsafe/libp2p-yamux": "^5.0.3", "@chainsafe/libp2p-yamux": "^6.0.1",
"@libp2p/perf": "next", "@libp2p/perf": "^3.0.4",
"@libp2p/tcp": "next", "@libp2p/tcp": "^9.0.4",
"libp2p": "next" "libp2p": "^1.0.5"
} }
} }

View File

@ -1,4 +1,4 @@
commitSha := d15bb69a9d2b353d73ead79a29f668dca3e1dc4a commitSha := b7914e407da34c99fb76dcc300b3d44b9af97fac
all: perf all: perf

File diff suppressed because it is too large Load Diff

View File

@ -1,53 +1,10 @@
import fs from 'fs';
import path from 'path';
export type Version = { export type Version = {
id: string, id: string,
implementation: "go-libp2p" | "js-libp2p" | "nim-libp2p" | "rust-libp2p" | "zig-libp2p" | "https" | "quic-go", implementation: "go-libp2p" | "js-libp2p" | "nim-libp2p" | "rust-libp2p" | "zig-libp2p" | "https" | "quic-go",
transportStacks: string[], transportStacks: string[],
} }
export const versions: Array<Version> = [ export const versions: Array<Version> = JSON.parse(fs.readFileSync(path.join(__dirname, '../versionsInput.json'), 'utf8'));
{
id: "v0.34",
implementation: "quic-go",
transportStacks: ["quic-v1"]
},
{
id: "v0.53",
implementation: "rust-libp2p",
transportStacks: ["tcp", "quic-v1"]
},
{
id: "v0.1",
implementation: "https",
transportStacks: ["tcp"]
},
{
id: "v0.27",
implementation: "go-libp2p",
transportStacks: ["tcp", "quic-v1"]
},
{
id: "v0.28",
implementation: "go-libp2p",
transportStacks: ["tcp", "quic-v1"]
},
{
id: "v0.29",
implementation: "go-libp2p",
transportStacks: ["tcp", "quic-v1"]
},
{
id: "v0.31",
implementation: "go-libp2p",
transportStacks: ["tcp", "quic-v1"]
},
{
id: "v0.46",
implementation: "js-libp2p",
transportStacks: ["tcp"]
},
{
id: "v1.0",
implementation: "js-libp2p",
transportStacks: ["tcp"]
},
]

View File

@ -0,0 +1,70 @@
[
{
"id": "v0.34",
"implementation": "quic-go",
"transportStacks": [
"quic-v1"
]
},
{
"id": "v0.53",
"implementation": "rust-libp2p",
"transportStacks": [
"tcp",
"quic-v1"
]
},
{
"id": "v0.1",
"implementation": "https",
"transportStacks": [
"tcp"
]
},
{
"id": "v0.27",
"implementation": "go-libp2p",
"transportStacks": [
"tcp",
"quic-v1"
]
},
{
"id": "v0.28",
"implementation": "go-libp2p",
"transportStacks": [
"tcp",
"quic-v1"
]
},
{
"id": "v0.29",
"implementation": "go-libp2p",
"transportStacks": [
"tcp",
"quic-v1"
]
},
{
"id": "v0.31",
"implementation": "go-libp2p",
"transportStacks": [
"tcp",
"quic-v1"
]
},
{
"id": "v0.46",
"implementation": "js-libp2p",
"transportStacks": [
"tcp"
]
},
{
"id": "v1.0",
"implementation": "js-libp2p",
"transportStacks": [
"tcp"
]
}
]

View File

@ -0,0 +1,31 @@
image_name := go-v0.32
version := 0.32.2
all: image.json
image.json: verify-checksum go-libp2p-${version}
cd go-libp2p-${version} && IMAGE_NAME=${image_name} ../../../../dockerBuildWrapper.sh -f test-plans/PingDockerfile .
docker image inspect ${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@
go-libp2p-${version}: go-libp2p-${version}.zip
unzip -o go-libp2p-${version}.zip
go-libp2p-${version}.zip:
wget -O $@ "https://github.com/libp2p/go-libp2p/archive/v${version}.zip"
# Run `make version.lock` to generate this lock file. This file should be commited.
# This locks the exact contents of the specified version. This lets us use the
# human readable name while still making sure the contents don't change.
version.lock: go-libp2p-${version}.zip
shasum -a 256 go-libp2p-${version}.zip > $@
verify-checksum: go-libp2p-${version}.zip
shasum -a 256 -c version.lock
.PHONY: clean all verify-checksum
clean:
rm image.json
rm go-libp2p-*.zip
rm -rf go-libp2p-*

View File

@ -0,0 +1 @@
2169e11c42c71e57398930c9d334e437fb1958b9acd9afdf20a6cce30040588f go-libp2p-0.32.2.zip

View File

@ -0,0 +1,31 @@
image_name := go-v0.33
version := 0.33.0
all: image.json
image.json: verify-checksum go-libp2p-${version}
cd go-libp2p-${version} && IMAGE_NAME=${image_name} ../../../../dockerBuildWrapper.sh -f test-plans/PingDockerfile .
docker image inspect ${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@
go-libp2p-${version}: go-libp2p-${version}.zip
unzip -o go-libp2p-${version}.zip
go-libp2p-${version}.zip:
wget -O $@ "https://github.com/libp2p/go-libp2p/archive/v${version}.zip"
# Run `make version.lock` to generate this lock file. This file should be commited.
# This locks the exact contents of the specified version. This lets us use the
# human readable name while still making sure the contents don't change.
version.lock: go-libp2p-${version}.zip
shasum -a 256 go-libp2p-${version}.zip > $@
verify-checksum: go-libp2p-${version}.zip
shasum -a 256 -c version.lock
.PHONY: clean all verify-checksum
clean:
rm image.json
rm go-libp2p-*.zip
rm -rf go-libp2p-*

View File

@ -0,0 +1 @@
6ec52eaeaf89648848c5844507c6d0db1afb9643eb9499d53242231df939ad0f go-libp2p-0.33.0.zip

View File

@ -0,0 +1,31 @@
image_name := go-v0.34
version := 0.34.0
all: image.json
image.json: verify-checksum go-libp2p-${version}
cd go-libp2p-${version} && IMAGE_NAME=${image_name} ../../../../dockerBuildWrapper.sh -f test-plans/PingDockerfile .
docker image inspect ${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@
go-libp2p-${version}: go-libp2p-${version}.zip
unzip -o go-libp2p-${version}.zip
go-libp2p-${version}.zip:
wget -O $@ "https://github.com/libp2p/go-libp2p/archive/v${version}.zip"
# Run `make version.lock` to generate this lock file. This file should be commited.
# This locks the exact contents of the specified version. This lets us use the
# human readable name while still making sure the contents don't change.
version.lock: go-libp2p-${version}.zip
shasum -a 256 go-libp2p-${version}.zip > $@
verify-checksum: go-libp2p-${version}.zip
shasum -a 256 -c version.lock
.PHONY: clean all verify-checksum
clean:
rm image.json
rm go-libp2p-*.zip
rm -rf go-libp2p-*

View File

@ -0,0 +1 @@
4d9d7fbf769a4008112475419174e18a83a6eeebf0fa0635a50e4afd692b5510 go-libp2p-0.34.0.zip

View File

@ -0,0 +1,31 @@
image_name := go-v0.35
version := 0.35.0
all: image.json
image.json: verify-checksum go-libp2p-${version}
cd go-libp2p-${version} && IMAGE_NAME=${image_name} ../../../../dockerBuildWrapper.sh -f test-plans/PingDockerfile .
docker image inspect ${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@
go-libp2p-${version}: go-libp2p-${version}.zip
unzip -o go-libp2p-${version}.zip
go-libp2p-${version}.zip:
wget -O $@ "https://github.com/libp2p/go-libp2p/archive/v${version}.zip"
# Run `make version.lock` to generate this lock file. This file should be commited.
# This locks the exact contents of the specified version. This lets us use the
# human readable name while still making sure the contents don't change.
version.lock: go-libp2p-${version}.zip
shasum -a 256 go-libp2p-${version}.zip > $@
verify-checksum: go-libp2p-${version}.zip
shasum -a 256 -c version.lock
.PHONY: clean all verify-checksum
clean:
rm image.json
rm go-libp2p-*.zip
rm -rf go-libp2p-*

View File

@ -0,0 +1 @@
535ef1d8984c5f79fcdbbd569e827aad9cd41d9168a2827f67182c99736caa31 go-libp2p-0.35.0.zip

View File

@ -0,0 +1,31 @@
image_name := go-v0.36
version := 0.36.0
all: image.json
image.json: verify-checksum go-libp2p-${version}
cd go-libp2p-${version} && IMAGE_NAME=${image_name} ../../../../dockerBuildWrapper.sh -f test-plans/PingDockerfile .
docker image inspect ${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@
go-libp2p-${version}: go-libp2p-${version}.zip
unzip -o go-libp2p-${version}.zip
go-libp2p-${version}.zip:
wget -O $@ "https://github.com/libp2p/go-libp2p/archive/v${version}.zip"
# Run `make version.lock` to generate this lock file. This file should be commited.
# This locks the exact contents of the specified version. This lets us use the
# human readable name while still making sure the contents don't change.
version.lock: go-libp2p-${version}.zip
shasum -a 256 go-libp2p-${version}.zip > $@
verify-checksum: go-libp2p-${version}.zip
shasum -a 256 -c version.lock
.PHONY: clean all verify-checksum
clean:
rm image.json
rm go-libp2p-*.zip
rm -rf go-libp2p-*

View File

@ -0,0 +1 @@
09828c27b44af441d49617146f196638879a19570e1ba06cb7bf63df0a34bbef go-libp2p-0.36.0.zip

View File

@ -0,0 +1,117 @@
/* eslint-disable no-console */
import http from 'http'
import { pEvent } from 'p-event'
import { createClient } from 'redis'
const redisAddr = process.env.redis_addr || 'redis:6379'
const transport = process.env.transport
const isDialer = process.env.is_dialer === 'true'
/** @type {import('aegir/types').PartialOptions} */
export default {
test: {
browser: {
config: {
// Ignore self signed certificates
browserContextOptions: { ignoreHTTPSErrors: true }
}
},
async before () {
// import after build is complete
const { createRelay } = await import('./dist/test/fixtures/relay.js')
let relayNode
let relayAddr
if (transport === 'webrtc' && !isDialer) {
relayNode = await createRelay()
const sortByNonLocalIp = (a, b) => {
if (a.toString().includes('127.0.0.1')) {
return 1
}
return -1
}
relayAddr = relayNode.getMultiaddrs().sort(sortByNonLocalIp)[0].toString()
}
const redisClient = createClient({
url: `redis://${redisAddr}`
})
redisClient.on('error', (err) => {
console.error('Redis client error:', err)
})
await redisClient.connect()
const requestListener = async function (req, res) {
const requestJSON = await new Promise(resolve => {
let body = ''
req.on('data', function (data) {
body += data
})
req.on('end', function () {
resolve(JSON.parse(body))
})
})
try {
const redisRes = await redisClient.sendCommand(requestJSON)
if (redisRes == null) {
console.error('Redis failure - sent', requestJSON, 'received', redisRes)
res.writeHead(500, {
'Access-Control-Allow-Origin': '*'
})
res.end(JSON.stringify({
message: 'Redis sent back null'
}))
return
}
res.writeHead(200, {
'Access-Control-Allow-Origin': '*'
})
res.end(JSON.stringify(redisRes))
} catch (err) {
console.error('Error in redis command:', err)
res.writeHead(500, {
'Access-Control-Allow-Origin': '*'
})
res.end(err.toString())
}
}
const proxyServer = http.createServer(requestListener)
proxyServer.listen(0)
await pEvent(proxyServer, 'listening', {
signal: AbortSignal.timeout(5000)
})
return {
redisClient,
relayNode,
proxyServer,
env: {
...process.env,
RELAY_ADDR: relayAddr,
REDIS_PROXY_PORT: proxyServer.address().port
}
}
},
async after (_, { proxyServer, redisClient, relayNode }) {
await new Promise(resolve => {
proxyServer?.close(() => resolve())
})
try {
// We don't care if this fails
await redisClient?.disconnect()
await relayNode?.stop()
} catch { }
}
}
}

View File

@ -8,14 +8,17 @@ FROM ${BASE_IMAGE} as js-libp2p-base
FROM mcr.microsoft.com/playwright FROM mcr.microsoft.com/playwright
COPY --from=js-libp2p-base /app/ /app/ COPY --from=js-libp2p-base /app/ /app/
WORKDIR /app/interop WORKDIR /app
# We install browsers here instead of the cached version so that we use the latest browsers at run time. # We install browsers here instead of the cached version so that we use the latest browsers at run time.
# Ideally this would also be pinned, but playwright controls this, so there isn't much we can do about it. # Ideally this would also be pinned, but playwright controls this, so there isn't much we can do about it.
# By installing here, we avoid installing it at test time. # By installing here, we avoid installing it at test time.
RUN npx playwright install-deps
RUN npx playwright install RUN npx playwright install
ARG BROWSER=chromium # Options: chromium, firefox, webkit
ENV BROWSER=$BROWSER
ENTRYPOINT npm test -- --build false --types false -t browser -- --browser $BROWSER # Options: chromium, firefox, webkit
ARG BROWSER=chromium
ENV BROWSER=${BROWSER}
ENTRYPOINT npm test -- -t browser -- --browser $BROWSER

View File

@ -1,11 +1,17 @@
# Here because we want to fetch the node_modules within docker so that it's # Here because we want to fetch the node_modules within docker so that it's
# installed on the same platform the test is run. Otherwise tools like `esbuild` will fail to run # installed on the same platform the test is run. Otherwise tools like `esbuild` will fail to run
FROM node:18 FROM node:lts
WORKDIR /app WORKDIR /app
COPY . .
RUN npm i && npm run build
WORKDIR /app/interop COPY package*.json .aegir.js tsconfig.json ./
RUN npm i && npm run build COPY src ./src
COPY test ./test
ENTRYPOINT [ "npm", "test", "--", "--build", "false", "--types", "false", "-t", "node" ] # disable colored output and CLI animation from test runners
ENV CI true
RUN npm ci
RUN npm run build
ENTRYPOINT npm test -- -t node

View File

@ -1,8 +1,7 @@
image_name := js-v0.45 image_name := js-v0.45
commitSha := 47a96706527fd82cd9daf3cc298f56866a5d027a
# TODO Enable webkit once https://github.com/libp2p/js-libp2p/pull/1627 is in # TODO Enable webkit once https://github.com/libp2p/js-libp2p/pull/1627 is in
all: image.json chromium-image.json firefox-image.json all: image.json chromium-image.json firefox-image.json update-lock-file
# Necessary because multistage builds require a docker image name rather than a digest to be used # Necessary because multistage builds require a docker image name rather than a digest to be used
load-image-json: image.json load-image-json: image.json
@ -18,17 +17,19 @@ firefox-image.json: load-image-json BrowserDockerfile
docker image inspect firefox-${image_name} -f "{{.Id}}" | \ docker image inspect firefox-${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@ xargs -I {} echo "{\"imageID\": \"{}\"}" > $@
image.json: js-libp2p-${commitSha} # We update the lock file here so that we make sure we are always using the correct lock file.
cd js-libp2p-${commitSha} && docker build -t ${image_name} -f ../Dockerfile . # If this changes, CI will fail since there are unstaged changes.
update-lock-file: image.json
CONTAINER_ID=$$(docker create $$(jq -r .imageID image.json)); \
docker cp $$CONTAINER_ID:/app/package-lock.json ./package-lock.json; \
docker rm $$CONTAINER_ID
image.json:
docker build -t ${image_name} -f ./Dockerfile .
docker image inspect ${image_name} -f "{{.Id}}" | \ docker image inspect ${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@ xargs -I {} echo "{\"imageID\": \"{}\"}" > $@
js-libp2p-${commitSha}:
wget -O js-libp2p-${commitSha}.zip "https://github.com/libp2p/js-libp2p/archive/${commitSha}.zip"
unzip -o js-libp2p-${commitSha}.zip
unzip -o js-libp2p-${commitSha}.zip
clean: clean:
rm -rf image.json js-libp2p-*.zip js-libp2p-* *-image.json rm -rf *-image.json
.PHONY: all clean browser-images load-image-json .PHONY: all clean browser-images load-image-json

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,31 @@
{
"name": "@libp2p/transport-interop-libp2p-0.45.x",
"version": "1.0.0",
"type": "module",
"private": true,
"scripts": {
"clean": "aegir clean",
"build": "aegir build --bundle false",
"test": "aegir test",
"lint": "aegir lint",
"dep-check": "aegir dep-check"
},
"devDependencies": {
"@chainsafe/libp2p-noise": "^12.0.1",
"@chainsafe/libp2p-yamux": "^4.0.2",
"@libp2p/interface-libp2p": "^3.2.0",
"@libp2p/mplex": "^8.0.3",
"@libp2p/tcp": "^7.0.1",
"@libp2p/webrtc": "^2.0.10",
"@libp2p/websockets": "^6.0.3",
"@libp2p/webtransport": "^2.0.1",
"@multiformats/multiaddr": "^12.1.3",
"aegir": "^42.2.11",
"libp2p": "^0.45.6",
"p-event": "^6.0.1",
"redis": "^4.6.14"
},
"browser": {
"@libp2p/tcp": false
}
}

View File

@ -0,0 +1,3 @@
// Everything is defined in the test folder
export { }

View File

@ -0,0 +1,55 @@
/* eslint-disable no-console */
/* eslint-env mocha */
import { multiaddr } from '@multiformats/multiaddr'
import { getLibp2p } from './fixtures/get-libp2p.js'
import { redisProxy } from './fixtures/redis-proxy.js'
import type { Libp2p } from 'libp2p'
import type { PingService } from 'libp2p/ping'
const isDialer: boolean = process.env.is_dialer === 'true'
const timeoutSecs: string = process.env.test_timeout_secs ?? '180'
describe('ping test (dialer)', function () {
if (!isDialer) {
return
}
// make the default timeout longer than the listener timeout
this.timeout((parseInt(timeoutSecs) * 1000) + 30000)
let node: Libp2p<{ ping: PingService }>
beforeEach(async () => {
node = await getLibp2p()
})
afterEach(async () => {
// Shutdown libp2p node
try {
// We don't care if this fails
await node.stop()
} catch { }
})
it('should dial and ping', async function () {
let [, otherMaStr]: string[] = await redisProxy(['BLPOP', 'listenerAddr', timeoutSecs])
// Hack until these are merged:
// - https://github.com/multiformats/js-multiaddr-to-uri/pull/120
otherMaStr = otherMaStr.replace('/tls/ws', '/wss')
const otherMa = multiaddr(otherMaStr)
const handshakeStartInstant = Date.now()
console.error(`node ${node.peerId.toString()} dials: ${otherMa}`)
await node.dial(otherMa)
console.error(`node ${node.peerId.toString()} pings: ${otherMa}`)
const pingRTT = await node.services.ping.ping(multiaddr(otherMa))
const handshakePlusOneRTT = Date.now() - handshakeStartInstant
console.log(JSON.stringify({
handshakePlusOneRTTMillis: handshakePlusOneRTT,
pingRTTMilllis: pingRTT
}))
})
})

View File

@ -0,0 +1,130 @@
/* eslint-disable complexity */
import { noise } from '@chainsafe/libp2p-noise'
import { yamux } from '@chainsafe/libp2p-yamux'
import { mplex } from '@libp2p/mplex'
import { tcp } from '@libp2p/tcp'
import { webRTC, webRTCDirect } from '@libp2p/webrtc'
import { webSockets } from '@libp2p/websockets'
import * as filters from '@libp2p/websockets/filters'
import { webTransport } from '@libp2p/webtransport'
import { type Libp2pOptions, createLibp2p } from 'libp2p'
import { circuitRelayTransport } from 'libp2p/circuit-relay'
import { identifyService } from 'libp2p/identify'
import { type PingService, pingService } from 'libp2p/ping'
import type { Libp2p } from '@libp2p/interface-libp2p'
const isDialer: boolean = process.env.is_dialer === 'true'
// Setup libp2p node
const TRANSPORT = process.env.transport
const SECURE_CHANNEL = process.env.security
const MUXER = process.env.muxer
const IP = process.env.ip ?? '0.0.0.0'
export async function getLibp2p (): Promise<Libp2p<{ ping: PingService }>> {
const options: Libp2pOptions<{ ping: PingService, identify: unknown }> = {
start: true,
connectionManager: {
minConnections: 0
},
connectionGater: {
denyDialMultiaddr: async () => false
},
services: {
ping: pingService(),
identify: identifyService()
}
}
switch (TRANSPORT) {
case 'tcp':
options.transports = [tcp()]
options.addresses = {
listen: isDialer ? [] : [`/ip4/${IP}/tcp/0`]
}
break
case 'webtransport':
options.transports = [webTransport()]
if (!isDialer) {
throw new Error('WebTransport is not supported as a listener')
}
break
case 'webrtc-direct':
options.transports = [webRTCDirect()]
options.addresses = {
listen: isDialer ? [] : [`/ip4/${IP}/udp/0/webrtc-direct`]
}
break
case 'webrtc':
options.transports = [webRTC(),
webSockets({ filter: filters.all }), // ws needed to connect to relay
circuitRelayTransport({
discoverRelays: 1
}) // needed to use the relay
]
options.addresses = {
listen: isDialer ? [] : ['/webrtc']
}
break
case 'ws':
options.transports = [webSockets()]
options.addresses = {
listen: isDialer ? [] : [`/ip4/${IP}/tcp/0/ws`]
}
break
case 'wss':
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'
options.transports = [webSockets()]
options.addresses = {
listen: isDialer ? [] : [`/ip4/${IP}/tcp/0/wss`]
}
break
default:
throw new Error(`Unknown transport: ${TRANSPORT ?? '???'}`)
}
let skipSecureChannel = false
let skipMuxer = false
switch (TRANSPORT) {
case 'webtransport':
case 'webrtc-direct':
skipSecureChannel = true
skipMuxer = true
break
case 'webrtc':
skipSecureChannel = true
skipMuxer = true
// Setup yamux and noise to connect to the relay node
options.streamMuxers = [yamux()]
options.connectionEncryption = [noise()]
break
default:
// Do nothing
}
if (!skipSecureChannel) {
switch (SECURE_CHANNEL) {
case 'noise':
options.connectionEncryption = [noise()]
break
default:
throw new Error(`Unknown secure channel: ${SECURE_CHANNEL ?? ''}`)
}
}
if (!skipMuxer) {
switch (MUXER) {
case 'mplex':
options.streamMuxers = [mplex()]
break
case 'yamux':
options.streamMuxers = [yamux()]
break
default:
throw new Error(`Unknown muxer: ${MUXER ?? '???'}`)
}
}
return createLibp2p(options)
}

View File

@ -0,0 +1,12 @@
export async function redisProxy (commands: any[]): Promise<any> {
const res = await fetch(`http://localhost:${process.env.REDIS_PROXY_PORT}`, {
method: 'POST',
body: JSON.stringify(commands)
})
if (!res.ok) {
throw new Error('Redis command failed')
}
return res.json()
}

View File

@ -0,0 +1,34 @@
import { noise } from '@chainsafe/libp2p-noise'
import { yamux } from '@chainsafe/libp2p-yamux'
import { webSockets } from '@libp2p/websockets'
import * as filters from '@libp2p/websockets/filters'
import { createLibp2p } from 'libp2p'
import { circuitRelayServer } from 'libp2p/circuit-relay'
import { identifyService } from 'libp2p/identify'
import type { Libp2p } from '@libp2p/interface-libp2p'
export async function createRelay (): Promise<Libp2p> {
const server = await createLibp2p({
addresses: {
listen: ['/ip4/0.0.0.0/tcp/0/ws']
},
transports: [
webSockets({
filter: filters.all
})
],
connectionEncryption: [noise()],
streamMuxers: [yamux()],
services: {
identify: identifyService(),
relay: circuitRelayServer({
reservations: {
maxReservations: Infinity,
applyDefaultLimit: false
}
})
}
})
return server
}

View File

@ -0,0 +1,76 @@
/* eslint-disable no-console */
/* eslint-env mocha */
import { multiaddr, type Multiaddr } from '@multiformats/multiaddr'
import { getLibp2p } from './fixtures/get-libp2p.js'
import { redisProxy } from './fixtures/redis-proxy.js'
import type { Libp2p } from 'libp2p'
import type { PingService } from 'libp2p/ping'
const isDialer: boolean = process.env.is_dialer === 'true'
const timeoutSecs: string = process.env.test_timeout_secs ?? '180'
describe('ping test (listener)', function () {
if (isDialer) {
return
}
// make the default timeout longer than the listener timeout
this.timeout((parseInt(timeoutSecs) * 1000) + 30000)
let node: Libp2p<{ ping: PingService }>
beforeEach(async () => {
node = await getLibp2p()
})
afterEach(async () => {
// Shutdown libp2p node
try {
// We don't care if this fails
await node.stop()
} catch { }
})
it('should listen for ping', async function () {
const sortByNonLocalIp = (a: Multiaddr, b: Multiaddr): -1 | 0 | 1 => {
if (a.toString().includes('127.0.0.1')) {
return 1
}
return -1
}
let multiaddrs = node.getMultiaddrs().sort(sortByNonLocalIp).map(ma => ma.toString())
const transport = process.env.transport
if (transport === 'webrtc') {
const relayAddr = process.env.RELAY_ADDR
const hasWebrtcMultiaddr = new Promise<string[]>((resolve) => {
const abortController = new AbortController()
node.addEventListener('self:peer:update', (event) => {
const webrtcMas = node.getMultiaddrs().filter(ma => ma.toString().includes('/webrtc'))
if (webrtcMas.length > 0) {
resolve(webrtcMas.sort(sortByNonLocalIp).map(ma => ma.toString()))
}
abortController.abort()
}, { signal: abortController.signal })
})
if (relayAddr == null || relayAddr === '') {
throw new Error('No relayAddr')
}
// const conn = await node.dial(multiaddr(relayAddr))
console.error('dial relay')
await node.dial(multiaddr(relayAddr))
console.error('wait for relay reservation')
multiaddrs = await hasWebrtcMultiaddr
}
console.error('inform redis of dial address')
// Send the listener addr over the proxy server so this works on both the Browser and Node
await redisProxy(['RPUSH', 'listenerAddr', multiaddrs[0]])
// Wait
console.error('wait for incoming ping')
await new Promise(resolve => setTimeout(resolve, 1000 * parseInt(timeoutSecs, 10)))
})
})

View File

@ -0,0 +1,10 @@
{
"extends": "aegir/src/config/tsconfig.aegir.json",
"compilerOptions": {
"outDir": "dist"
},
"include": [
"src",
"test"
]
}

View File

@ -0,0 +1,117 @@
/* eslint-disable no-console */
import http from 'http'
import { pEvent } from 'p-event'
import { createClient } from 'redis'
const redisAddr = process.env.redis_addr || 'redis:6379'
const transport = process.env.transport
const isDialer = process.env.is_dialer === 'true'
/** @type {import('aegir/types').PartialOptions} */
export default {
test: {
browser: {
config: {
// Ignore self signed certificates
browserContextOptions: { ignoreHTTPSErrors: true }
}
},
async before () {
// import after build is complete
const { createRelay } = await import('./dist/test/fixtures/relay.js')
let relayNode
let relayAddr
if (transport === 'webrtc' && !isDialer) {
relayNode = await createRelay()
const sortByNonLocalIp = (a, b) => {
if (a.toString().includes('127.0.0.1')) {
return 1
}
return -1
}
relayAddr = relayNode.getMultiaddrs().sort(sortByNonLocalIp)[0].toString()
}
const redisClient = createClient({
url: `redis://${redisAddr}`
})
redisClient.on('error', (err) => {
console.error('Redis client error:', err)
})
await redisClient.connect()
const requestListener = async function (req, res) {
const requestJSON = await new Promise(resolve => {
let body = ''
req.on('data', function (data) {
body += data
})
req.on('end', function () {
resolve(JSON.parse(body))
})
})
try {
const redisRes = await redisClient.sendCommand(requestJSON)
if (redisRes == null) {
console.error('Redis failure - sent', requestJSON, 'received', redisRes)
res.writeHead(500, {
'Access-Control-Allow-Origin': '*'
})
res.end(JSON.stringify({
message: 'Redis sent back null'
}))
return
}
res.writeHead(200, {
'Access-Control-Allow-Origin': '*'
})
res.end(JSON.stringify(redisRes))
} catch (err) {
console.error('Error in redis command:', err)
res.writeHead(500, {
'Access-Control-Allow-Origin': '*'
})
res.end(err.toString())
}
}
const proxyServer = http.createServer(requestListener)
proxyServer.listen(0)
await pEvent(proxyServer, 'listening', {
signal: AbortSignal.timeout(5000)
})
return {
redisClient,
relayNode,
proxyServer,
env: {
...process.env,
RELAY_ADDR: relayAddr,
REDIS_PROXY_PORT: proxyServer.address().port
}
}
},
async after (_, { proxyServer, redisClient, relayNode }) {
await new Promise(resolve => {
proxyServer?.close(() => resolve())
})
try {
// We don't care if this fails
await redisClient?.disconnect()
await relayNode?.stop()
} catch { }
}
}
}

View File

@ -8,14 +8,17 @@ FROM ${BASE_IMAGE} as js-libp2p-base
FROM mcr.microsoft.com/playwright FROM mcr.microsoft.com/playwright
COPY --from=js-libp2p-base /app/ /app/ COPY --from=js-libp2p-base /app/ /app/
WORKDIR /app/node_modules/@libp2p/multidim-interop WORKDIR /app
# We install browsers here instead of the cached version so that we use the latest browsers at run time. # We install browsers here instead of the cached version so that we use the latest browsers at run time.
# Ideally this would also be pinned, but playwright controls this, so there isn't much we can do about it. # Ideally this would also be pinned, but playwright controls this, so there isn't much we can do about it.
# By installing here, we avoid installing it at test time. # By installing here, we avoid installing it at test time.
RUN npx playwright install-deps
RUN npx playwright install RUN npx playwright install
ARG BROWSER=chromium # Options: chromium, firefox, webkit
ENV BROWSER=$BROWSER
ENTRYPOINT npm run test:interop:multidim -- --build false --types false -t browser -- --browser $BROWSER # Options: chromium, firefox, webkit
ARG BROWSER=chromium
ENV BROWSER=${BROWSER}
ENTRYPOINT npm test -- -t browser -- --browser $BROWSER

View File

@ -1,11 +1,17 @@
# Here because we want to fetch the node_modules within docker so that it's # Here because we want to fetch the node_modules within docker so that it's
# installed on the same platform the test is run. Otherwise tools like `esbuild` will fail to run # installed on the same platform the test is run. Otherwise tools like `esbuild` will fail to run
FROM node:18.17.1 FROM node:lts
WORKDIR /app WORKDIR /app
RUN apt-get update && apt-get install -y cmake
COPY package*.json ./ COPY package*.json .aegir.js tsconfig.json ./
COPY src ./src
COPY test ./test
# disable colored output and CLI animation from test runners
ENV CI true
RUN npm ci RUN npm ci
RUN npm run build
WORKDIR /app/node_modules/@libp2p/multidim-interop ENTRYPOINT npm test -- -t node
ENTRYPOINT [ "npm", "run", "test:interop:multidim", "--", "--build", "false", "--types", "false", "-t", "node" ]

View File

@ -1,4 +1,4 @@
image_name := js-v0.46.17 image_name := js-v0.46
# TODO Enable webkit once https://github.com/libp2p/js-libp2p/pull/1627 is in # TODO Enable webkit once https://github.com/libp2p/js-libp2p/pull/1627 is in
all: image.json chromium-image.json firefox-image.json update-lock-file all: image.json chromium-image.json firefox-image.json update-lock-file
@ -29,7 +29,6 @@ image.json:
docker image inspect ${image_name} -f "{{.Id}}" | \ docker image inspect ${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@ xargs -I {} echo "{\"imageID\": \"{}\"}" > $@
clean: clean:
rm -rf image.json *-image.json rm -rf image.json *-image.json

File diff suppressed because it is too large Load Diff

View File

@ -1,17 +1,31 @@
{ {
"dependencies": { "name": "@libp2p/transport-interop-libp2p-0.46.x",
"@libp2p/multidim-interop": "^1.0.14", "version": "1.0.0",
"type": "module",
"private": true,
"scripts": {
"clean": "aegir clean",
"build": "aegir build --bundle false",
"test": "aegir test",
"lint": "aegir lint",
"dep-check": "aegir dep-check"
},
"devDependencies": {
"@chainsafe/libp2p-noise": "^13.0.3", "@chainsafe/libp2p-noise": "^13.0.3",
"@chainsafe/libp2p-yamux": "^5.0.2", "@chainsafe/libp2p-yamux": "^5.0.2",
"@libp2p/interface": "^0.1.6",
"@libp2p/mplex": "^9.0.12", "@libp2p/mplex": "^9.0.12",
"@libp2p/tcp": "^8.0.13", "@libp2p/tcp": "^8.0.13",
"@libp2p/webrtc": "^3.2.11", "@libp2p/webrtc": "^3.2.11",
"@libp2p/websockets": "^7.0.13", "@libp2p/websockets": "^7.0.13",
"@libp2p/webtransport": "^3.1.10", "@libp2p/webtransport": "^3.1.10",
"@multiformats/mafmt": "^12.1.6",
"@multiformats/multiaddr": "^12.1.10", "@multiformats/multiaddr": "^12.1.10",
"aegir": "^41.1.9", "aegir": "^42.2.11",
"libp2p": "^0.46.21", "libp2p": "^0.46.21",
"p-event": "^6.0.1",
"redis": "^4.6.10" "redis": "^4.6.10"
},
"browser": {
"@libp2p/tcp": false
} }
} }

View File

@ -0,0 +1,3 @@
// Everything is defined in the test folder
export { }

View File

@ -0,0 +1,55 @@
/* eslint-disable no-console */
/* eslint-env mocha */
import { multiaddr } from '@multiformats/multiaddr'
import { getLibp2p } from './fixtures/get-libp2p.js'
import { redisProxy } from './fixtures/redis-proxy.js'
import type { Libp2p } from '@libp2p/interface'
import type { PingService } from 'libp2p/ping'
const isDialer: boolean = process.env.is_dialer === 'true'
const timeoutSecs: string = process.env.test_timeout_secs ?? '180'
describe('ping test (dialer)', function () {
if (!isDialer) {
return
}
// make the default timeout longer than the listener timeout
this.timeout((parseInt(timeoutSecs) * 1000) + 30000)
let node: Libp2p<{ ping: PingService }>
beforeEach(async () => {
node = await getLibp2p()
})
afterEach(async () => {
// Shutdown libp2p node
try {
// We don't care if this fails
await node.stop()
} catch { }
})
it('should dial and ping', async function () {
let [, otherMaStr]: string[] = await redisProxy(['BLPOP', 'listenerAddr', timeoutSecs])
// Hack until these are merged:
// - https://github.com/multiformats/js-multiaddr-to-uri/pull/120
otherMaStr = otherMaStr.replace('/tls/ws', '/wss')
const otherMa = multiaddr(otherMaStr)
const handshakeStartInstant = Date.now()
console.error(`node ${node.peerId.toString()} dials: ${otherMa}`)
await node.dial(otherMa)
console.error(`node ${node.peerId.toString()} pings: ${otherMa}`)
const pingRTT = await node.services.ping.ping(multiaddr(otherMa))
const handshakePlusOneRTT = Date.now() - handshakeStartInstant
console.log(JSON.stringify({
handshakePlusOneRTTMillis: handshakePlusOneRTT,
pingRTTMilllis: pingRTT
}))
})
})

View File

@ -0,0 +1,130 @@
/* eslint-disable complexity */
import { noise } from '@chainsafe/libp2p-noise'
import { yamux } from '@chainsafe/libp2p-yamux'
import { mplex } from '@libp2p/mplex'
import { tcp } from '@libp2p/tcp'
import { webRTC, webRTCDirect } from '@libp2p/webrtc'
import { webSockets } from '@libp2p/websockets'
import * as filters from '@libp2p/websockets/filters'
import { webTransport } from '@libp2p/webtransport'
import { type Libp2pOptions, createLibp2p } from 'libp2p'
import { circuitRelayTransport } from 'libp2p/circuit-relay'
import { type IdentifyService, identifyService } from 'libp2p/identify'
import { type PingService, pingService } from 'libp2p/ping'
import type { Libp2p } from '@libp2p/interface'
const isDialer: boolean = process.env.is_dialer === 'true'
// Setup libp2p node
const TRANSPORT = process.env.transport
const SECURE_CHANNEL = process.env.security
const MUXER = process.env.muxer
const IP = process.env.ip ?? '0.0.0.0'
export async function getLibp2p (): Promise<Libp2p<{ ping: PingService }>> {
const options: Libp2pOptions<{ ping: PingService, identify: IdentifyService }> = {
start: true,
connectionManager: {
minConnections: 0
},
connectionGater: {
denyDialMultiaddr: async () => false
},
services: {
ping: pingService(),
identify: identifyService()
}
}
switch (TRANSPORT) {
case 'tcp':
options.transports = [tcp()]
options.addresses = {
listen: isDialer ? [] : [`/ip4/${IP}/tcp/0`]
}
break
case 'webtransport':
options.transports = [webTransport()]
if (!isDialer) {
throw new Error('WebTransport is not supported as a listener')
}
break
case 'webrtc-direct':
options.transports = [webRTCDirect()]
options.addresses = {
listen: isDialer ? [] : [`/ip4/${IP}/udp/0/webrtc-direct`]
}
break
case 'webrtc':
options.transports = [webRTC(),
webSockets({ filter: filters.all }), // ws needed to connect to relay
circuitRelayTransport({
discoverRelays: 1
}) // needed to use the relay
]
options.addresses = {
listen: isDialer ? [] : ['/webrtc']
}
break
case 'ws':
options.transports = [webSockets()]
options.addresses = {
listen: isDialer ? [] : [`/ip4/${IP}/tcp/0/ws`]
}
break
case 'wss':
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'
options.transports = [webSockets()]
options.addresses = {
listen: isDialer ? [] : [`/ip4/${IP}/tcp/0/wss`]
}
break
default:
throw new Error(`Unknown transport: ${TRANSPORT ?? '???'}`)
}
let skipSecureChannel = false
let skipMuxer = false
switch (TRANSPORT) {
case 'webtransport':
case 'webrtc-direct':
skipSecureChannel = true
skipMuxer = true
break
case 'webrtc':
skipSecureChannel = true
skipMuxer = true
// Setup yamux and noise to connect to the relay node
options.streamMuxers = [yamux()]
options.connectionEncryption = [noise()]
break
default:
// Do nothing
}
if (!skipSecureChannel) {
switch (SECURE_CHANNEL) {
case 'noise':
options.connectionEncryption = [noise()]
break
default:
throw new Error(`Unknown secure channel: ${SECURE_CHANNEL ?? ''}`)
}
}
if (!skipMuxer) {
switch (MUXER) {
case 'mplex':
options.streamMuxers = [mplex()]
break
case 'yamux':
options.streamMuxers = [yamux()]
break
default:
throw new Error(`Unknown muxer: ${MUXER ?? '???'}`)
}
}
return createLibp2p(options)
}

View File

@ -0,0 +1,12 @@
export async function redisProxy (commands: any[]): Promise<any> {
const res = await fetch(`http://localhost:${process.env.REDIS_PROXY_PORT}`, {
method: 'POST',
body: JSON.stringify(commands)
})
if (!res.ok) {
throw new Error('Redis command failed')
}
return res.json()
}

View File

@ -0,0 +1,34 @@
import { noise } from '@chainsafe/libp2p-noise'
import { yamux } from '@chainsafe/libp2p-yamux'
import { webSockets } from '@libp2p/websockets'
import * as filters from '@libp2p/websockets/filters'
import { createLibp2p } from 'libp2p'
import { circuitRelayServer } from 'libp2p/circuit-relay'
import { identifyService } from 'libp2p/identify'
import type { Libp2p } from '@libp2p/interface'
export async function createRelay (): Promise<Libp2p> {
const server = await createLibp2p({
addresses: {
listen: ['/ip4/0.0.0.0/tcp/0/ws']
},
transports: [
webSockets({
filter: filters.all
})
],
connectionEncryption: [noise()],
streamMuxers: [yamux()],
services: {
identify: identifyService(),
relay: circuitRelayServer({
reservations: {
maxReservations: Infinity,
applyDefaultLimit: false
}
})
}
})
return server
}

View File

@ -0,0 +1,76 @@
/* eslint-disable no-console */
/* eslint-env mocha */
import { multiaddr, type Multiaddr } from '@multiformats/multiaddr'
import { getLibp2p } from './fixtures/get-libp2p.js'
import { redisProxy } from './fixtures/redis-proxy.js'
import type { Libp2p } from '@libp2p/interface'
import type { PingService } from 'libp2p/ping'
const isDialer: boolean = process.env.is_dialer === 'true'
const timeoutSecs: string = process.env.test_timeout_secs ?? '180'
describe('ping test (listener)', function () {
if (isDialer) {
return
}
// make the default timeout longer than the listener timeout
this.timeout((parseInt(timeoutSecs) * 1000) + 30000)
let node: Libp2p<{ ping: PingService }>
beforeEach(async () => {
node = await getLibp2p()
})
afterEach(async () => {
// Shutdown libp2p node
try {
// We don't care if this fails
await node.stop()
} catch { }
})
it('should listen for ping', async function () {
const sortByNonLocalIp = (a: Multiaddr, b: Multiaddr): -1 | 0 | 1 => {
if (a.toString().includes('127.0.0.1')) {
return 1
}
return -1
}
let multiaddrs = node.getMultiaddrs().sort(sortByNonLocalIp).map(ma => ma.toString())
const transport = process.env.transport
if (transport === 'webrtc') {
const relayAddr = process.env.RELAY_ADDR
const hasWebrtcMultiaddr = new Promise<string[]>((resolve) => {
const abortController = new AbortController()
node.addEventListener('self:peer:update', (event) => {
const webrtcMas = node.getMultiaddrs().filter(ma => ma.toString().includes('/webrtc'))
if (webrtcMas.length > 0) {
resolve(webrtcMas.sort(sortByNonLocalIp).map(ma => ma.toString()))
}
abortController.abort()
}, { signal: abortController.signal })
})
if (relayAddr == null || relayAddr === '') {
throw new Error('No relayAddr')
}
// const conn = await node.dial(multiaddr(relayAddr))
console.error('dial relay')
await node.dial(multiaddr(relayAddr))
console.error('wait for relay reservation')
multiaddrs = await hasWebrtcMultiaddr
}
console.error('inform redis of dial address')
// Send the listener addr over the proxy server so this works on both the Browser and Node
await redisProxy(['RPUSH', 'listenerAddr', multiaddrs[0]])
// Wait
console.error('wait for incoming ping')
await new Promise(resolve => setTimeout(resolve, 1000 * parseInt(timeoutSecs, 10)))
})
})

View File

@ -0,0 +1,10 @@
{
"extends": "aegir/src/config/tsconfig.aegir.json",
"compilerOptions": {
"outDir": "dist"
},
"include": [
"src",
"test"
]
}

View File

@ -0,0 +1,117 @@
/* eslint-disable no-console */
import http from 'http'
import { pEvent } from 'p-event'
import { createClient } from 'redis'
const redisAddr = process.env.redis_addr || 'redis:6379'
const transport = process.env.transport
const isDialer = process.env.is_dialer === 'true'
/** @type {import('aegir/types').PartialOptions} */
export default {
test: {
browser: {
config: {
// Ignore self signed certificates
browserContextOptions: { ignoreHTTPSErrors: true }
}
},
async before () {
// import after build is complete
const { createRelay } = await import('./dist/test/fixtures/relay.js')
let relayNode
let relayAddr
if (transport === 'webrtc' && !isDialer) {
relayNode = await createRelay()
const sortByNonLocalIp = (a, b) => {
if (a.toString().includes('127.0.0.1')) {
return 1
}
return -1
}
relayAddr = relayNode.getMultiaddrs().sort(sortByNonLocalIp)[0].toString()
}
const redisClient = createClient({
url: `redis://${redisAddr}`
})
redisClient.on('error', (err) => {
console.error('Redis client error:', err)
})
await redisClient.connect()
const requestListener = async function (req, res) {
const requestJSON = await new Promise(resolve => {
let body = ''
req.on('data', function (data) {
body += data
})
req.on('end', function () {
resolve(JSON.parse(body))
})
})
try {
const redisRes = await redisClient.sendCommand(requestJSON)
if (redisRes == null) {
console.error('Redis failure - sent', requestJSON, 'received', redisRes)
res.writeHead(500, {
'Access-Control-Allow-Origin': '*'
})
res.end(JSON.stringify({
message: 'Redis sent back null'
}))
return
}
res.writeHead(200, {
'Access-Control-Allow-Origin': '*'
})
res.end(JSON.stringify(redisRes))
} catch (err) {
console.error('Error in redis command:', err)
res.writeHead(500, {
'Access-Control-Allow-Origin': '*'
})
res.end(err.toString())
}
}
const proxyServer = http.createServer(requestListener)
proxyServer.listen(0)
await pEvent(proxyServer, 'listening', {
signal: AbortSignal.timeout(5000)
})
return {
redisClient,
relayNode,
proxyServer,
env: {
...process.env,
RELAY_ADDR: relayAddr,
REDIS_PROXY_PORT: proxyServer.address().port
}
}
},
async after (_, { proxyServer, redisClient, relayNode }) {
await new Promise(resolve => {
proxyServer?.close(() => resolve())
})
try {
// We don't care if this fails
await redisClient?.disconnect()
await relayNode?.stop()
} catch { }
}
}
}

View File

@ -0,0 +1,24 @@
# syntax=docker/dockerfile:1
# Copied since we won't have the repo to use if expanding from cache.
# Workaround: https://github.com/docker/cli/issues/996
ARG BASE_IMAGE=node-js-libp2p-head
FROM ${BASE_IMAGE} as js-libp2p-base
FROM mcr.microsoft.com/playwright
COPY --from=js-libp2p-base /app/ /app/
WORKDIR /app
# We install browsers here instead of the cached version so that we use the latest browsers at run time.
# Ideally this would also be pinned, but playwright controls this, so there isn't much we can do about it.
# By installing here, we avoid installing it at test time.
RUN npx playwright install-deps
RUN npx playwright install
# Options: chromium, firefox, webkit
ARG BROWSER=chromium
ENV BROWSER=${BROWSER}
ENTRYPOINT npm test -- -t browser -- --browser $BROWSER

View File

@ -0,0 +1,17 @@
# Here because we want to fetch the node_modules within docker so that it's
# installed on the same platform the test is run. Otherwise tools like `esbuild` will fail to run
FROM node:lts
WORKDIR /app
COPY package*.json .aegir.js tsconfig.json ./
COPY src ./src
COPY test ./test
# disable colored output and CLI animation from test runners
ENV CI true
RUN npm ci
RUN npm run build
ENTRYPOINT npm test -- -t node

View File

@ -0,0 +1,35 @@
image_name := js-v1.x
# TODO Enable webkit once https://github.com/libp2p/js-libp2p/pull/1627 is in
all: image.json chromium-image.json firefox-image.json update-lock-file
# Necessary because multistage builds require a docker image name rather than a digest to be used
load-image-json: image.json
docker image tag $$(jq -r .imageID image.json) ${image_name}
chromium-image.json: load-image-json BrowserDockerfile
docker build -f BrowserDockerfile --build-arg=BASE_IMAGE=${image_name} --build-arg=BROWSER=chromium -t chromium-${image_name} .
docker image inspect chromium-${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@
firefox-image.json: load-image-json BrowserDockerfile
docker build -f BrowserDockerfile --build-arg=BASE_IMAGE=${image_name} --build-arg=BROWSER=firefox -t firefox-${image_name} .
docker image inspect firefox-${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@
# We update the lock file here so that we make sure we are always using the correct lock file.
# If this changes, CI will fail since there are unstaged changes.
update-lock-file: image.json
CONTAINER_ID=$$(docker create $$(jq -r .imageID image.json)); \
docker cp $$CONTAINER_ID:/app/package-lock.json ./package-lock.json; \
docker rm $$CONTAINER_ID
image.json:
docker build -t ${image_name} -f ./Dockerfile .
docker image inspect ${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@
clean:
rm -rf image.json *-image.json
.PHONY: all clean browser-images load-image-json

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,34 @@
{
"name": "@libp2p/transport-interop-libp2p-1.x",
"version": "1.0.0",
"type": "module",
"private": true,
"scripts": {
"clean": "aegir clean",
"build": "aegir build --bundle false",
"test": "aegir test",
"lint": "aegir lint",
"dep-check": "aegir dep-check"
},
"devDependencies": {
"@chainsafe/libp2p-noise": "^15.0.0",
"@chainsafe/libp2p-yamux": "^6.0.2",
"@libp2p/circuit-relay-v2": "^1.0.24",
"@libp2p/identify": "^2.0.2",
"@libp2p/interface": "^1.4.0",
"@libp2p/mplex": "^10.0.24",
"@libp2p/ping": "^1.0.19",
"@libp2p/tcp": "^9.0.26",
"@libp2p/webrtc": "^4.0.33",
"@libp2p/websockets": "^8.0.24",
"@libp2p/webtransport": "^4.0.32",
"@multiformats/multiaddr": "^12.1.10",
"aegir": "^42.2.11",
"libp2p": "^1.6.0",
"p-event": "^6.0.1",
"redis": "^4.6.10"
},
"browser": {
"@libp2p/tcp": false
}
}

View File

@ -0,0 +1,3 @@
// Everything is defined in the test folder
export { }

View File

@ -0,0 +1,55 @@
/* eslint-disable no-console */
/* eslint-env mocha */
import { multiaddr } from '@multiformats/multiaddr'
import { getLibp2p } from './fixtures/get-libp2p.js'
import { redisProxy } from './fixtures/redis-proxy.js'
import type { Libp2p } from '@libp2p/interface'
import type { PingService } from '@libp2p/ping'
const isDialer: boolean = process.env.is_dialer === 'true'
const timeoutSecs: string = process.env.test_timeout_secs ?? '180'
describe('ping test (dialer)', function () {
if (!isDialer) {
return
}
// make the default timeout longer than the listener timeout
this.timeout((parseInt(timeoutSecs) * 1000) + 30000)
let node: Libp2p<{ ping: PingService }>
beforeEach(async () => {
node = await getLibp2p()
})
afterEach(async () => {
// Shutdown libp2p node
try {
// We don't care if this fails
await node.stop()
} catch { }
})
it('should dial and ping', async function () {
let [, otherMaStr]: string[] = await redisProxy(['BLPOP', 'listenerAddr', timeoutSecs])
// Hack until these are merged:
// - https://github.com/multiformats/js-multiaddr-to-uri/pull/120
otherMaStr = otherMaStr.replace('/tls/ws', '/wss')
const otherMa = multiaddr(otherMaStr)
const handshakeStartInstant = Date.now()
console.error(`node ${node.peerId.toString()} dials: ${otherMa}`)
await node.dial(otherMa)
console.error(`node ${node.peerId.toString()} pings: ${otherMa}`)
const pingRTT = await node.services.ping.ping(multiaddr(otherMa))
const handshakePlusOneRTT = Date.now() - handshakeStartInstant
console.log(JSON.stringify({
handshakePlusOneRTTMillis: handshakePlusOneRTT,
pingRTTMilllis: pingRTT
}))
})
})

View File

@ -0,0 +1,130 @@
/* eslint-disable complexity */
import { noise } from '@chainsafe/libp2p-noise'
import { yamux } from '@chainsafe/libp2p-yamux'
import { mplex } from '@libp2p/mplex'
import { tcp } from '@libp2p/tcp'
import { webRTC, webRTCDirect } from '@libp2p/webrtc'
import { webSockets } from '@libp2p/websockets'
import * as filters from '@libp2p/websockets/filters'
import { webTransport } from '@libp2p/webtransport'
import { type Libp2pOptions, createLibp2p } from 'libp2p'
import { circuitRelayTransport } from '@libp2p/circuit-relay-v2'
import { type Identify, identify } from '@libp2p/identify'
import { type PingService, ping } from '@libp2p/ping'
import type { Libp2p } from '@libp2p/interface'
const isDialer: boolean = process.env.is_dialer === 'true'
// Setup libp2p node
const TRANSPORT = process.env.transport
const SECURE_CHANNEL = process.env.security
const MUXER = process.env.muxer
const IP = process.env.ip ?? '0.0.0.0'
export async function getLibp2p (): Promise<Libp2p<{ ping: PingService }>> {
const options: Libp2pOptions<{ ping: PingService, identify: Identify }> = {
start: true,
connectionManager: {
minConnections: 0
},
connectionGater: {
denyDialMultiaddr: async () => false
},
services: {
ping: ping(),
identify: identify()
}
}
switch (TRANSPORT) {
case 'tcp':
options.transports = [tcp()]
options.addresses = {
listen: isDialer ? [] : [`/ip4/${IP}/tcp/0`]
}
break
case 'webtransport':
options.transports = [webTransport()]
if (!isDialer) {
throw new Error('WebTransport is not supported as a listener')
}
break
case 'webrtc-direct':
options.transports = [webRTCDirect()]
options.addresses = {
listen: isDialer ? [] : [`/ip4/${IP}/udp/0/webrtc-direct`]
}
break
case 'webrtc':
options.transports = [webRTC(),
webSockets({ filter: filters.all }), // ws needed to connect to relay
circuitRelayTransport({
discoverRelays: 1
}) // needed to use the relay
]
options.addresses = {
listen: isDialer ? [] : ['/webrtc']
}
break
case 'ws':
options.transports = [webSockets()]
options.addresses = {
listen: isDialer ? [] : [`/ip4/${IP}/tcp/0/ws`]
}
break
case 'wss':
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'
options.transports = [webSockets()]
options.addresses = {
listen: isDialer ? [] : [`/ip4/${IP}/tcp/0/wss`]
}
break
default:
throw new Error(`Unknown transport: ${TRANSPORT ?? '???'}`)
}
let skipSecureChannel = false
let skipMuxer = false
switch (TRANSPORT) {
case 'webtransport':
case 'webrtc-direct':
skipSecureChannel = true
skipMuxer = true
break
case 'webrtc':
skipSecureChannel = true
skipMuxer = true
// Setup yamux and noise to connect to the relay node
options.streamMuxers = [yamux()]
options.connectionEncryption = [noise()]
break
default:
// Do nothing
}
if (!skipSecureChannel) {
switch (SECURE_CHANNEL) {
case 'noise':
options.connectionEncryption = [noise()]
break
default:
throw new Error(`Unknown secure channel: ${SECURE_CHANNEL ?? ''}`)
}
}
if (!skipMuxer) {
switch (MUXER) {
case 'mplex':
options.streamMuxers = [mplex()]
break
case 'yamux':
options.streamMuxers = [yamux()]
break
default:
throw new Error(`Unknown muxer: ${MUXER ?? '???'}`)
}
}
return createLibp2p(options)
}

View File

@ -0,0 +1,12 @@
export async function redisProxy (commands: any[]): Promise<any> {
const res = await fetch(`http://localhost:${process.env.REDIS_PROXY_PORT}`, {
method: 'POST',
body: JSON.stringify(commands)
})
if (!res.ok) {
throw new Error('Redis command failed')
}
return res.json()
}

View File

@ -0,0 +1,34 @@
import { noise } from '@chainsafe/libp2p-noise'
import { yamux } from '@chainsafe/libp2p-yamux'
import { webSockets } from '@libp2p/websockets'
import * as filters from '@libp2p/websockets/filters'
import { createLibp2p } from 'libp2p'
import { circuitRelayServer } from '@libp2p/circuit-relay-v2'
import { identify } from '@libp2p/identify'
import type { Libp2p } from '@libp2p/interface'
export async function createRelay (): Promise<Libp2p> {
const server = await createLibp2p({
addresses: {
listen: ['/ip4/0.0.0.0/tcp/0/ws']
},
transports: [
webSockets({
filter: filters.all
})
],
connectionEncryption: [noise()],
streamMuxers: [yamux()],
services: {
identify: identify(),
relay: circuitRelayServer({
reservations: {
maxReservations: Infinity,
applyDefaultLimit: false
}
})
}
})
return server
}

View File

@ -0,0 +1,76 @@
/* eslint-disable no-console */
/* eslint-env mocha */
import { multiaddr, type Multiaddr } from '@multiformats/multiaddr'
import { getLibp2p } from './fixtures/get-libp2p.js'
import { redisProxy } from './fixtures/redis-proxy.js'
import type { Libp2p } from '@libp2p/interface'
import type { PingService } from '@libp2p/ping'
const isDialer: boolean = process.env.is_dialer === 'true'
const timeoutSecs: string = process.env.test_timeout_secs ?? '180'
describe('ping test (listener)', function () {
if (isDialer) {
return
}
// make the default timeout longer than the listener timeout
this.timeout((parseInt(timeoutSecs) * 1000) + 30000)
let node: Libp2p<{ ping: PingService }>
beforeEach(async () => {
node = await getLibp2p()
})
afterEach(async () => {
// Shutdown libp2p node
try {
// We don't care if this fails
await node.stop()
} catch { }
})
it('should listen for ping', async function () {
const sortByNonLocalIp = (a: Multiaddr, b: Multiaddr): -1 | 0 | 1 => {
if (a.toString().includes('127.0.0.1')) {
return 1
}
return -1
}
let multiaddrs = node.getMultiaddrs().sort(sortByNonLocalIp).map(ma => ma.toString())
const transport = process.env.transport
if (transport === 'webrtc') {
const relayAddr = process.env.RELAY_ADDR
const hasWebrtcMultiaddr = new Promise<string[]>((resolve) => {
const abortController = new AbortController()
node.addEventListener('self:peer:update', (event) => {
const webrtcMas = node.getMultiaddrs().filter(ma => ma.toString().includes('/webrtc'))
if (webrtcMas.length > 0) {
resolve(webrtcMas.sort(sortByNonLocalIp).map(ma => ma.toString()))
}
abortController.abort()
}, { signal: abortController.signal })
})
if (relayAddr == null || relayAddr === '') {
throw new Error('No relayAddr')
}
// const conn = await node.dial(multiaddr(relayAddr))
console.error('dial relay')
await node.dial(multiaddr(relayAddr))
console.error('wait for relay reservation')
multiaddrs = await hasWebrtcMultiaddr
}
console.error('inform redis of dial address')
// Send the listener addr over the proxy server so this works on both the Browser and Node
await redisProxy(['RPUSH', 'listenerAddr', multiaddrs[0]])
// Wait
console.error('wait for incoming ping')
await new Promise(resolve => setTimeout(resolve, 1000 * parseInt(timeoutSecs, 10)))
})
})

View File

@ -0,0 +1,10 @@
{
"extends": "aegir/src/config/tsconfig.aegir.json",
"compilerOptions": {
"outDir": "dist"
},
"include": [
"src",
"test"
]
}

View File

@ -1,4 +1,4 @@
ARG NimVersion="1.6.10" ARG NimVersion="1.6.16"
FROM nimlang/nim:${NimVersion}-alpine as builder FROM nimlang/nim:${NimVersion}-alpine as builder
WORKDIR /app WORKDIR /app

View File

@ -1,5 +1,6 @@
image_name := rust-v0.52 image_name := rust-chromium-v0.52
commitSha := 51070dae6395821c5ab45014b7208f15975c9101 # BROKEN because glibc does not match.
commitSha := f1bfe8d4ed423d03df4ef477072178e953c85f45
all: image.json all: image.json

View File

@ -0,0 +1,20 @@
image_name := rust-chromium-v0.53
commitSha := b7914e407da34c99fb76dcc300b3d44b9af97fac
all: image.json
image.json: rust-libp2p-${commitSha}
cd rust-libp2p-${commitSha} && IMAGE_NAME=${image_name} ../../../../dockerBuildWrapper.sh -f interop-tests/Dockerfile.chromium .
docker image inspect ${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@
rust-libp2p-${commitSha}: rust-libp2p-${commitSha}.zip
unzip -o rust-libp2p-${commitSha}.zip
rust-libp2p-${commitSha}.zip:
wget -O $@ "https://github.com/libp2p/rust-libp2p/archive/${commitSha}.zip"
clean:
rm image.json
rm rust-libp2p-*.zip
rm -rf rust-libp2p-*

View File

@ -1,5 +1,5 @@
image_name := rust-v0.52 image_name := rust-v0.52
commitSha := 51070dae6395821c5ab45014b7208f15975c9101 commitSha := f1bfe8d4ed423d03df4ef477072178e953c85f45
all: image.json all: image.json

View File

@ -0,0 +1,20 @@
image_name := rust-v0.53
commitSha := b7914e407da34c99fb76dcc300b3d44b9af97fac
all: image.json
image.json: rust-libp2p-${commitSha}
cd rust-libp2p-${commitSha} && IMAGE_NAME=${image_name} ../../../../dockerBuildWrapper.sh -f interop-tests/Dockerfile.native .
docker image inspect ${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@
rust-libp2p-${commitSha}: rust-libp2p-${commitSha}.zip
unzip -o rust-libp2p-${commitSha}.zip
rust-libp2p-${commitSha}.zip:
wget -O $@ "https://github.com/libp2p/rust-libp2p/archive/${commitSha}.zip"
clean:
rm image.json
rm rust-libp2p-*.zip
rm -rf rust-libp2p-*

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
{ {
"name": "Multidimensional libp2p interop test", "name": "@libp2p/transport-interop",
"version": "0.0.1", "version": "0.0.1",
"description": "Tests libp2p implementations against each other across various dimensions.", "description": "Tests libp2p implementations against each other across various dimensions.",
"main": "testplans.ts", "main": "testplans.ts",

View File

@ -3,7 +3,6 @@ import { promises as fs } from 'fs';
import path from 'path'; import path from 'path';
import { exec as execStd } from 'child_process'; import { exec as execStd } from 'child_process';
import util from 'util'; import util from 'util';
import { env } from 'process';
import { ComposeSpecification, PropertiesServices } from "../compose-spec/compose-spec"; import { ComposeSpecification, PropertiesServices } from "../compose-spec/compose-spec";
import { stringify } from 'yaml'; import { stringify } from 'yaml';
import { dialerStdout, dialerTimings } from './compose-stdout-helper'; import { dialerStdout, dialerTimings } from './compose-stdout-helper';
@ -47,11 +46,10 @@ export async function run(namespace: string, compose: ComposeSpecification, opts
} }
try { try {
const controller = new AbortController(); const { stdout, stderr } = await exec(`docker compose -f ${path.join(dir, "compose.yaml")} up ${upFlags.join(" ")}`, {
const timeoutId = setTimeout(() => controller.abort(), 1000 * timeoutSecs) signal: AbortSignal.timeout(1000 * timeoutSecs)
const { signal } = controller; })
const { stdout, stderr } = await exec(`docker compose -f ${path.join(dir, "compose.yaml")} up ${upFlags.join(" ")}`, { signal })
clearTimeout(timeoutId)
try { try {
const testResultsParsed = dialerTimings(dialerStdout(stdout)) const testResultsParsed = dialerTimings(dialerStdout(stdout))
console.log("Finished:", namespace, testResultsParsed) console.log("Finished:", namespace, testResultsParsed)

View File

@ -13,11 +13,21 @@ export function dialerStdout(composeStdout: string): string {
} }
export function dialerTimings(dialerStdout: string): Object { export function dialerTimings(dialerStdout: string): Object {
const openBracket = dialerStdout.indexOf("{") let openBracket = dialerStdout.indexOf("{")
if (openBracket === -1) throw new Error("Invalid JSON. No opening curly bracket found") let error
const closeBracket = dialerStdout.indexOf("}", openBracket) while (true) {
if (closeBracket === -1) throw new Error("Invalid JSON. No closing curly bracket found") if (openBracket === -1) break
return JSON.parse(dialerStdout.substring(openBracket, closeBracket + 1)) const closeBracket = dialerStdout.indexOf("}", openBracket)
if (closeBracket === -1) throw new Error("Invalid JSON. No closing curly bracket found")
try {
const result = JSON.parse(dialerStdout.substring(openBracket, closeBracket + 1))
if (result.handshakePlusOneRTTMillis != null && result.pingRTTMilllis != null) return result
} catch (err) {
error = err
}
openBracket = dialerStdout.indexOf("{", openBracket + 1)
}
throw error ?? new Error("Invalid JSON. No opening curly bracket found")
} }
// simple test case - avoids bringing in a whole test framework // simple test case - avoids bringing in a whole test framework
@ -57,9 +67,9 @@ function test() {
2023-07-05T22:41:18.8186846Z zig-v0_0_1_x_zig-v0_0_1__quic-v1_-redis-1 | 1:M 05 Jul 2023 22:41:17.439 # Server initialized 2023-07-05T22:41:18.8186846Z zig-v0_0_1_x_zig-v0_0_1__quic-v1_-redis-1 | 1:M 05 Jul 2023 22:41:17.439 # Server initialized
2023-07-05T22:41:18.8188914Z zig-v0_0_1_x_zig-v0_0_1__quic-v1_-redis-1 | 1:M 05 Jul 2023 22:41:17.439 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect. 2023-07-05T22:41:18.8188914Z zig-v0_0_1_x_zig-v0_0_1__quic-v1_-redis-1 | 1:M 05 Jul 2023 22:41:17.439 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
2023-07-05T22:41:18.8190173Z zig-v0_0_1_x_zig-v0_0_1__quic-v1_-redis-1 | 1:M 05 Jul 2023 22:41:17.439 * Ready to accept connections 2023-07-05T22:41:18.8190173Z zig-v0_0_1_x_zig-v0_0_1__quic-v1_-redis-1 | 1:M 05 Jul 2023 22:41:17.439 * Ready to accept connections
2023-07-05T22:41:18.8190833Z zig-v0_0_1_x_zig-v0_0_1__quic-v1_-dialer-1 | {"handshakePlusOneRTTMillis": 2023-07-05T22:41:18.8190833Z zig-v0_0_1_x_zig-v0_0_1__quic-v1_-dialer-1 | {"handshakePlusOneRTTMillis":
2023-07-05T22:41:18.8191389Z zig-v0_0_1_x_zig-v0_0_1__quic-v1_-dialer-1 | 8.849 2023-07-05T22:41:18.8191389Z zig-v0_0_1_x_zig-v0_0_1__quic-v1_-dialer-1 | 8.849
2023-07-05T22:41:18.8191930Z zig-v0_0_1_x_zig-v0_0_1__quic-v1_-dialer-1 | , "pingRTTMilllis": 2023-07-05T22:41:18.8191930Z zig-v0_0_1_x_zig-v0_0_1__quic-v1_-dialer-1 | , "pingRTTMilllis":
2023-07-05T22:41:18.8192455Z zig-v0_0_1_x_zig-v0_0_1__quic-v1_-dialer-1 | 7.897} 2023-07-05T22:41:18.8192455Z zig-v0_0_1_x_zig-v0_0_1__quic-v1_-dialer-1 | 7.897}
2023-07-05T22:41:18.8192987Z zig-v0_0_1_x_zig-v0_0_1__quic-v1_-dialer-1 exited with code 0` 2023-07-05T22:41:18.8192987Z zig-v0_0_1_x_zig-v0_0_1__quic-v1_-dialer-1 exited with code 0`
@ -71,16 +81,16 @@ function test() {
{ {
const exampleComposeStdout = ` const exampleComposeStdout = `
2023-07-06T00:36:52.6198781Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-redis-1 | 1:M 06 Jul 2023 00:36:19.136 * Ready to accept connections 2023-07-06T00:36:52.6198781Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-redis-1 | 1:M 06 Jul 2023 00:36:19.136 * Ready to accept connections
2023-07-06T00:36:52.6199494Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-listener-1 | 2023-07-06T00:36:52.6199494Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-listener-1 |
2023-07-06T00:36:52.6200270Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-listener-1 | > multidim-interop@1.0.0 test 2023-07-06T00:36:52.6200270Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-listener-1 | > multidim-interop@1.0.0 test
2023-07-06T00:36:52.6201247Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-listener-1 | > aegir test --build false --types false -t browser -- --browser firefox 2023-07-06T00:36:52.6201247Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-listener-1 | > aegir test --build false --types false -t browser -- --browser firefox
2023-07-06T00:36:52.6202009Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-listener-1 | 2023-07-06T00:36:52.6202009Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-listener-1 |
2023-07-06T00:36:52.6202659Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-listener-1 | 2023-07-06T00:36:52.6202659Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-listener-1 |
2023-07-06T00:36:52.6203296Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-dialer-1 | 2023-07-06T00:36:52.6203296Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-dialer-1 |
2023-07-06T00:36:52.6204045Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-dialer-1 | > multidim-interop@1.0.0 test 2023-07-06T00:36:52.6204045Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-dialer-1 | > multidim-interop@1.0.0 test
2023-07-06T00:36:52.6205016Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-dialer-1 | > aegir test --build false --types false -t browser -- --browser firefox 2023-07-06T00:36:52.6205016Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-dialer-1 | > aegir test --build false --types false -t browser -- --browser firefox
2023-07-06T00:36:52.6205760Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-dialer-1 | 2023-07-06T00:36:52.6205760Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-dialer-1 |
2023-07-06T00:36:52.6206397Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-dialer-1 | 2023-07-06T00:36:52.6206397Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-dialer-1 |
2023-07-06T00:36:52.6207074Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-listener-1 | test browser 2023-07-06T00:36:52.6207074Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-listener-1 | test browser
2023-07-06T00:36:52.6207782Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-dialer-1 | test browser 2023-07-06T00:36:52.6207782Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-dialer-1 | test browser
2023-07-06T00:36:52.6208473Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-dialer-1 |  2023-07-06T00:36:52.6208473Z firefox-js-v0_45_x_firefox-js-v0_45__webrtc__noise__yamux_-dialer-1 | 
@ -96,6 +106,63 @@ function test() {
const expectedParsed = JSON.stringify({ "handshakePlusOneRTTMillis": 4155, "pingRTTMilllis": 781 }) const expectedParsed = JSON.stringify({ "handshakePlusOneRTTMillis": 4155, "pingRTTMilllis": 781 })
assert(JSON.stringify(dialerTimings(dialerStdout(exampleComposeStdout))) === expectedParsed) assert(JSON.stringify(dialerTimings(dialerStdout(exampleComposeStdout))) === expectedParsed)
}
{
const exampleComposeStdout = `
Attaching to dialer-1, listener-1, redis-1
redis-1 | 1:C 05 May 2024 12:33:40.595 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
redis-1 | 1:C 05 May 2024 12:33:40.595 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis-1 | 1:C 05 May 2024 12:33:40.595 * Redis version=7.2.4, bits=64, commit=00000000, modified=0, pid=1, just started
redis-1 | 1:C 05 May 2024 12:33:40.595 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
redis-1 | 1:M 05 May 2024 12:33:40.596 * monotonic clock: POSIX clock_gettime
redis-1 | 1:M 05 May 2024 12:33:40.596 * Running mode=standalone, port=6379.
redis-1 | 1:M 05 May 2024 12:33:40.597 * Server initialized
redis-1 | 1:M 05 May 2024 12:33:40.597 * Ready to accept connections tcp
listener-1 | [2024-05-05T12:33:41Z INFO interop_tests] Running ping test: 12D3KooWT3dMe8wpuqmztR3syYzni4vVk3TSCGujMGBeGN3qR4Cn
listener-1 | [2024-05-05T12:33:41Z INFO interop_tests] Test instance, listening for incoming connections on: "/ip4/0.0.0.0/udp/0/webrtc-direct".
dialer-1 |
dialer-1 | > @libp2p/multidim-interop@2.0.31 test:interop:multidim
dialer-1 | > aegir test --build false --types false -t browser -- --browser firefox
dialer-1 |
dialer-1 | test browser
dialer-1 | [JavaScript Error: "Clear-Site-Data header found. Unknown value “"cache"”." {file: "http://127.0.0.1:34451/" line: 0}]
dialer-1 | [JavaScript Error: "Clear-Site-Data header forced the clean up of “cookies” data." {file: "http://127.0.0.1:34451/" line: 0}]
dialer-1 | [JavaScript Error: "Clear-Site-Data header forced the clean up of “storage” data." {file: "http://127.0.0.1:34451/" line: 0}]
dialer-1 |
dialer-1 | ping test
dialer-1 | - should listen for ping
listener-1 | [2024-05-05T12:33:55Z INFO webrtc::peer_connection] signaling state changed to have-remote-offer
listener-1 | [2024-05-05T12:33:55Z INFO webrtc_ice::mdns] mDNS is using 224.0.0.251:5353 as dest_addr
listener-1 | [2024-05-05T12:33:55Z INFO webrtc_ice::agent::agent_internal] [controlled]: Setting new connection state: Checking
listener-1 | [2024-05-05T12:33:55Z INFO webrtc_mdns::conn] Looping and listening Ok(224.0.0.251:5353)
listener-1 | [2024-05-05T12:33:55Z INFO webrtc::peer_connection] ICE connection state changed: checking
listener-1 | [2024-05-05T12:33:55Z INFO webrtc::peer_connection] signaling state changed to stable
listener-1 | [2024-05-05T12:33:55Z INFO webrtc_ice::agent::agent_internal] [controlled]: Setting new connection state: Connected
listener-1 | [2024-05-05T12:33:55Z INFO webrtc::peer_connection] ICE connection state changed: connected
listener-1 | [2024-05-05T12:33:55Z WARN webrtc_dtls::handshake::handshake_message_client_hello] Unsupported Extension Type 0 16
listener-1 | [2024-05-05T12:33:55Z WARN webrtc_dtls::handshake::handshake_message_client_hello] Unsupported Extension Type 0 28
listener-1 | [2024-05-05T12:33:55Z WARN webrtc_dtls::handshake::handshake_message_client_hello] Unsupported Extension Type 0 16
listener-1 | [2024-05-05T12:33:55Z WARN webrtc_dtls::handshake::handshake_message_client_hello] Unsupported Extension Type 0 28
listener-1 | [2024-05-05T12:33:55Z WARN webrtc_dtls::handshake::handshake_message_client_hello] Unsupported Extension Type 0 16
listener-1 | [2024-05-05T12:33:55Z WARN webrtc_dtls::handshake::handshake_message_client_hello] Unsupported Extension Type 0 28
listener-1 | [2024-05-05T12:33:55Z WARN webrtc_dtls::handshake::handshake_message_client_hello] Unsupported Extension Type 0 16
listener-1 | [2024-05-05T12:33:55Z WARN webrtc_dtls::handshake::handshake_message_client_hello] Unsupported Extension Type 0 28
listener-1 | [2024-05-05T12:33:55Z INFO webrtc::peer_connection] peer connection state changed: connected
listener-1 | [2024-05-05T12:33:55Z INFO libp2p_webrtc_utils::stream::drop_listener] Stream dropped without graceful close, sending Reset
listener-1 | [2024-05-05T12:33:56Z INFO libp2p_webrtc_utils::stream::drop_listener] Stream dropped without graceful close, sending Reset
dialer-1 | {"handshakePlusOneRTTMillis":1384,"pingRTTMilllis":39}
dialer-1 | should dial and ping (1405ms)
listener-1 | [2024-05-05T12:33:57Z WARN webrtc_sctp::association] [] failed to read packets on net_conn: Alert is Fatal or Close Notify
dialer-1 | 1 passing (2s)
dialer-1 | 1 pending
listener-1 | [2024-05-05T12:33:57Z INFO libp2p_webrtc_utils::stream::drop_listener] Stream dropped without graceful close, sending Reset
dialer-1 exited with code 0
`
const expectedParsed = JSON.stringify({ "handshakePlusOneRTTMillis": 1384, "pingRTTMilllis": 39 })
assert(JSON.stringify(dialerTimings(dialerStdout(exampleComposeStdout))) === expectedParsed)
} }
} }

View File

@ -49,91 +49,12 @@ function browserImageIDLookup(id: string): string {
return imageID return imageID
} }
export const versions: Array<Version> = [ export const versions: Array<Version> = JSON.parse(fs.readFileSync(path.join(__dirname, 'versionsInput.json') , 'utf8')).map((v: Version) => {
{ switch(v.containerImageID) {
id: "rust-v0.51", case "browser":
transports: ["ws", "tcp", "quic-v1", "webrtc-direct"], return { ...v, containerImageID: browserImageIDLookup }
secureChannels: ["tls", "noise"], case "canonical":
muxers: ["mplex", "yamux"], default:
}, return { ...v, containerImageID: canonicalImageIDLookup }
{ }
id: "rust-v0.52", });
transports: ["ws", "tcp", "quic-v1", "webrtc-direct"],
secureChannels: ["tls", "noise"],
muxers: ["mplex", "yamux"],
},
{
id: "rust-chromium-v0.52",
transports: [{ name: "webtransport", onlyDial: true }],
secureChannels: [],
muxers: [],
},
{
id: "js-v0.45",
transports: ["tcp", "ws", { name: "wss", onlyDial: true }],
secureChannels: ["noise"],
muxers: ["mplex", "yamux"],
},
{
id: "js-v0.46",
transports: ["tcp", "ws", { name: "wss", onlyDial: true }],
secureChannels: ["noise"],
muxers: ["mplex", "yamux"],
},
{
id: "chromium-js-v0.46",
containerImageID: browserImageIDLookup,
transports: [{ name: "webtransport", onlyDial: true }, { name: "wss", onlyDial: true }, { name: "webrtc-direct", onlyDial: true }, "webrtc"],
secureChannels: ["noise"],
muxers: ["mplex", "yamux"],
},
{
id: "firefox-js-v0.46",
containerImageID: browserImageIDLookup,
transports: [{ name: "wss", onlyDial: true }, { name: "webrtc-direct", onlyDial: true }, "webrtc"],
secureChannels: ["noise"],
muxers: ["mplex", "yamux"],
},
{
id: "go-v0.31",
transports: ["tcp", "ws", "quic-v1", "webtransport"],
secureChannels: ["tls", "noise"],
muxers: ["yamux"],
},
{
id: "go-v0.30",
transports: ["tcp", "ws", "quic-v1", "webtransport"],
secureChannels: ["tls", "noise"],
muxers: ["yamux"],
},
{
id: "go-v0.29",
transports: ["tcp", "ws", "quic", "quic-v1", "webtransport"],
secureChannels: ["tls", "noise"],
muxers: ["mplex", "yamux"],
},
{
id: "nim-v1.0",
transports: ["tcp", "ws"],
secureChannels: ["noise"],
muxers: ["mplex", "yamux"],
},
{
id: "zig-v0.0.1",
transports: ["quic-v1"],
secureChannels: [],
muxers: [],
},
{
id: "java-v0.0.1",
transports: ["tcp"],
secureChannels: ["tls", "noise"],
muxers: ["mplex", "yamux"],
},
{
id: "java-v0.6",
transports: ["tcp"],
secureChannels: ["tls", "noise"],
muxers: ["mplex", "yamux"],
},
].map((v: Version) => (typeof v.containerImageID === "undefined" ? ({ ...v, containerImageID: canonicalImageIDLookup }) : v))

View File

@ -0,0 +1,260 @@
[
{
"id": "rust-v0.51",
"transports": [
"ws",
"tcp",
"quic-v1",
"webrtc-direct"
],
"secureChannels": [
"tls",
"noise"
],
"muxers": [
"mplex",
"yamux"
]
},
{
"id": "rust-v0.52",
"transports": [
"ws",
"tcp",
"quic-v1",
"webrtc-direct"
],
"secureChannels": [
"tls",
"noise"
],
"muxers": [
"mplex",
"yamux"
]
},
{
"id": "rust-v0.53",
"transports": [
"ws",
"tcp",
"quic-v1",
"webrtc-direct"
],
"secureChannels": [
"tls",
"noise"
],
"muxers": [
"mplex",
"yamux"
]
},
{
"id": "rust-chromium-v0.53",
"transports": [
{
"name": "webtransport",
"onlyDial": true
},
{
"name": "webrtc-direct",
"onlyDial": true
},
{
"name": "ws",
"onlyDial": true
}
],
"secureChannels": [
"noise"
],
"muxers": [
"mplex",
"yamux"
]
},
{
"id": "chromium-js-v1.x",
"containerImageID": "browser",
"transports": [
{
"name": "webtransport",
"onlyDial": true
},
{
"name": "wss",
"onlyDial": true
},
{
"name": "webrtc-direct",
"onlyDial": true
},
"webrtc"
],
"secureChannels": [
"noise"
],
"muxers": [
"mplex",
"yamux"
]
},
{
"id": "firefox-js-v1.x",
"containerImageID": "browser",
"transports": [
{
"name": "wss",
"onlyDial": true
},
{
"name": "webrtc-direct",
"onlyDial": true
},
"webrtc"
],
"secureChannels": [
"noise"
],
"muxers": [
"mplex",
"yamux"
]
},
{
"id": "go-v0.33",
"transports": [
"tcp",
"ws",
"quic-v1",
"webrtc-direct"
],
"secureChannels": [
"tls",
"noise"
],
"muxers": [
"yamux"
]
},
{
"id": "nim-v1.0",
"transports": [
"tcp",
"ws"
],
"secureChannels": [
"noise"
],
"muxers": [
"mplex",
"yamux"
]
},
{
"id": "zig-v0.0.1",
"transports": [
"quic-v1"
],
"secureChannels": [],
"muxers": []
},
{
"id": "java-v0.0.1",
"transports": [
"tcp"
],
"secureChannels": [
"tls",
"noise"
],
"muxers": [
"mplex",
"yamux"
]
},
{
"id": "java-v0.6",
"transports": [
"tcp"
],
"secureChannels": [
"tls",
"noise"
],
"muxers": [
"mplex",
"yamux"
]
},
{
"id": "js-v1.x",
"transports": [
"tcp",
"ws",
{
"name": "wss",
"onlyDial": true
}
],
"secureChannels": [
"noise"
],
"muxers": [
"mplex",
"yamux"
]
},
{
"id": "go-v0.34",
"transports": [
"tcp",
"ws",
"quic-v1",
"webtransport",
"webrtc-direct"
],
"secureChannels": [
"tls",
"noise"
],
"muxers": [
"yamux"
]
},
{
"id": "go-v0.35",
"transports": [
"tcp",
"ws",
"quic-v1",
"webtransport",
"webrtc-direct"
],
"secureChannels": [
"tls",
"noise"
],
"muxers": [
"yamux"
]
},
{
"id": "go-v0.36",
"transports": [
"tcp",
"ws",
"quic-v1",
"webtransport",
"webrtc-direct"
],
"secureChannels": [
"tls",
"noise"
],
"muxers": [
"yamux"
]
}
]