Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: merge stat properties into stream/connection objects #1856

Merged
merged 17 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/auto-relay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
},
"dependencies": {
"@chainsafe/libp2p-noise": "^12.0.1",
"@chainsafe/libp2p-yamux": "^4.0.2",
"@chainsafe/libp2p-yamux": "^4.0.0",
"@libp2p/mplex": "^8.0.0",
"@libp2p/websockets": "^6.0.0",
"@multiformats/multiaddr": "^12.1.3",
"libp2p": "^0.45.0"
},
"devDependencies": {
"aegir": "^39.0.10",
"aegir": "^39.0.13",
"execa": "^7.1.1",
"p-defer": "^4.0.0",
"uint8arrays": "^4.0.4"
Expand Down
4 changes: 2 additions & 2 deletions examples/chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"dependencies": {
"@chainsafe/libp2p-noise": "^12.0.1",
"@chainsafe/libp2p-yamux": "^4.0.2",
"@chainsafe/libp2p-yamux": "^4.0.0",
"@libp2p/mplex": "^8.0.0",
"@libp2p/peer-id-factory": "^2.0.0",
"@libp2p/tcp": "^7.0.0",
Expand All @@ -44,7 +44,7 @@
"uint8arrays": "^4.0.4"
},
"devDependencies": {
"aegir": "^39.0.10",
"aegir": "^39.0.13",
"execa": "^7.1.1",
"p-defer": "^4.0.0"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/connection-encryption/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
},
"dependencies": {
"@chainsafe/libp2p-noise": "^12.0.1",
"@chainsafe/libp2p-yamux": "^4.0.2",
"@chainsafe/libp2p-yamux": "^4.0.0",
"@libp2p/mplex": "^8.0.0",
"@libp2p/tcp": "^7.0.0",
"it-pipe": "^3.0.1",
"libp2p": "^0.45.0",
"uint8arrays": "^4.0.4"
},
"devDependencies": {
"aegir": "^39.0.10",
"aegir": "^39.0.13",
"test-ipfs-example": "^1.0.0"
},
"private": true
Expand Down
2 changes: 1 addition & 1 deletion examples/delegated-routing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"react-scripts": "^5.0.1"
},
"devDependencies": {
"aegir": "^39.0.10"
"aegir": "^39.0.13"
},
"browserslist": [
">0.2%",
Expand Down
4 changes: 2 additions & 2 deletions examples/discovery-mechanisms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"dependencies": {
"@chainsafe/libp2p-noise": "^12.0.1",
"@chainsafe/libp2p-yamux": "^4.0.2",
"@chainsafe/libp2p-yamux": "^4.0.0",
"@libp2p/bootstrap": "^8.0.0",
"@libp2p/floodsub": "^7.0.0",
"@libp2p/mdns": "^8.0.0",
Expand All @@ -41,7 +41,7 @@
"libp2p": "^0.45.0"
},
"devDependencies": {
"aegir": "^39.0.10",
"aegir": "^39.0.13",
"execa": "^7.1.1",
"p-wait-for": "^5.0.2",
"uint8arrays": "^4.0.4"
Expand Down
4 changes: 2 additions & 2 deletions examples/echo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"dependencies": {
"@chainsafe/libp2p-noise": "^12.0.1",
"@chainsafe/libp2p-yamux": "^4.0.2",
"@chainsafe/libp2p-yamux": "^4.0.0",
"@libp2p/mplex": "^8.0.0",
"@libp2p/peer-id-factory": "^2.0.0",
"@libp2p/tcp": "^7.0.0",
Expand All @@ -42,7 +42,7 @@
"uint8arrays": "^4.0.4"
},
"devDependencies": {
"aegir": "^39.0.10",
"aegir": "^39.0.13",
"execa": "^7.1.1",
"p-defer": "^4.0.0"
},
Expand Down
6 changes: 3 additions & 3 deletions examples/libp2p-in-the-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
"test:example": "node test.js"
},
"dependencies": {
"@chainsafe/libp2p-gossipsub": "^8.0.0",
"@chainsafe/libp2p-gossipsub": "^9.0.0",
"@chainsafe/libp2p-noise": "^12.0.1",
"@chainsafe/libp2p-yamux": "^4.0.2",
"@chainsafe/libp2p-yamux": "^4.0.0",
"@libp2p/bootstrap": "^8.0.0",
"@libp2p/kad-dht": "^9.0.0",
"@libp2p/mplex": "^8.0.0",
Expand All @@ -42,7 +42,7 @@
"libp2p": "^0.45.0"
},
"devDependencies": {
"aegir": "^39.0.10",
"aegir": "^39.0.13",
"execa": "^7.1.1",
"playwright": "^1.35.1",
"vite": "^2.8.6"
Expand Down
4 changes: 2 additions & 2 deletions examples/peer-and-content-routing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"dependencies": {
"@chainsafe/libp2p-noise": "^12.0.1",
"@chainsafe/libp2p-yamux": "^4.0.2",
"@chainsafe/libp2p-yamux": "^4.0.0",
"@libp2p/kad-dht": "^9.0.0",
"@libp2p/mplex": "^8.0.0",
"@libp2p/tcp": "^7.0.0",
Expand All @@ -40,7 +40,7 @@
"multiformats": "^12.0.1"
},
"devDependencies": {
"aegir": "^39.0.10",
"aegir": "^39.0.13",
"test-ipfs-example": "^1.0.0"
},
"private": true
Expand Down
4 changes: 2 additions & 2 deletions examples/pnet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
},
"dependencies": {
"@chainsafe/libp2p-noise": "^12.0.1",
"@chainsafe/libp2p-yamux": "^4.0.2",
"@chainsafe/libp2p-yamux": "^4.0.0",
"@libp2p/mplex": "^8.0.0",
"@libp2p/tcp": "^7.0.0",
"it-pipe": "^3.0.1",
"libp2p": "^0.45.0",
"uint8arrays": "^4.0.4"
},
"devDependencies": {
"aegir": "^39.0.10",
"aegir": "^39.0.13",
"test-ipfs-example": "^1.0.0"
},
"private": true
Expand Down
4 changes: 2 additions & 2 deletions examples/protocol-and-stream-muxing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ There is still one last feature, you can provide multiple protocols for the same

```JavaScript
node2.handle(['/another-protocol/1.0.0', '/another-protocol/2.0.0'], ({ stream }) => {
if (stream.stat.protocol === '/another-protocol/2.0.0') {
if (stream.protocol === '/another-protocol/2.0.0') {
// handle backwards compatibility
}

Expand Down Expand Up @@ -149,7 +149,7 @@ node2.handle(['/a', '/b'], ({ stream }) => {
stream,
async function (source) {
for await (const msg of source) {
console.log(`from: ${stream.stat.protocol}, msg: ${uint8ArrayToString(msg.subarray())}`)
console.log(`from: ${stream.protocol}, msg: ${uint8ArrayToString(msg.subarray())}`)
}
}
)
Expand Down
4 changes: 2 additions & 2 deletions examples/protocol-and-stream-muxing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
},
"dependencies": {
"@chainsafe/libp2p-noise": "^12.0.1",
"@chainsafe/libp2p-yamux": "^4.0.2",
"@chainsafe/libp2p-yamux": "^4.0.0",
"@libp2p/mplex": "^8.0.0",
"@libp2p/tcp": "^7.0.0",
"it-pipe": "^3.0.1",
"libp2p": "^0.45.0",
"uint8arrays": "^4.0.4"
},
"devDependencies": {
"aegir": "^39.0.10",
"aegir": "^39.0.13",
"test-ipfs-example": "^1.0.0"
},
"private": true
Expand Down
4 changes: 2 additions & 2 deletions examples/pubsub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
},
"dependencies": {
"@chainsafe/libp2p-noise": "^12.0.1",
"@chainsafe/libp2p-yamux": "^4.0.2",
"@chainsafe/libp2p-yamux": "^4.0.0",
"@libp2p/floodsub": "^7.0.0",
"@libp2p/mplex": "^8.0.0",
"@libp2p/tcp": "^7.0.0",
"libp2p": "^0.45.0",
"uint8arrays": "^4.0.4"
},
"devDependencies": {
"aegir": "^39.0.10",
"aegir": "^39.0.13",
"execa": "^7.1.1",
"p-defer": "^4.0.0"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/transports/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"dependencies": {
"@chainsafe/libp2p-noise": "^12.0.1",
"@chainsafe/libp2p-yamux": "^4.0.2",
"@chainsafe/libp2p-yamux": "^4.0.0",
"@libp2p/mplex": "^8.0.0",
"@libp2p/tcp": "^7.0.0",
"@libp2p/websockets": "^6.0.0",
Expand All @@ -40,7 +40,7 @@
"uint8arrays": "^4.0.4"
},
"devDependencies": {
"aegir": "^39.0.10",
"aegir": "^39.0.13",
"test-ipfs-example": "^1.0.0"
},
"private": true
Expand Down
5 changes: 0 additions & 5 deletions interop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
## Table of contents <!-- omit in toc -->

- [Install](#install)
- [API Docs](#api-docs)
- [License](#license)
- [Contribution](#contribution)

Expand All @@ -20,10 +19,6 @@
$ npm i multidim-interop
```

## API Docs

- <https://libp2p.github.io/js-libp2p/modules/multidim_interop.html>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps API DOCS isn't the most appropriate header but we should link to the interop repo since that's where the bulk of the code lives


## License

Licensed under either of
Expand Down
4 changes: 2 additions & 2 deletions interop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"dependencies": {
"@chainsafe/libp2p-noise": "^12.0.1",
"@chainsafe/libp2p-yamux": "^4.0.2",
"@chainsafe/libp2p-yamux": "^4.0.0",
"@libp2p/mplex": "^8.0.0",
"@libp2p/tcp": "^7.0.0",
"@libp2p/webrtc": "^2.0.0",
Expand All @@ -51,7 +51,7 @@
"redis": "4.5.1"
},
"devDependencies": {
"aegir": "^39.0.10"
"aegir": "^39.0.13"
},
"browser": {
"@libp2p/tcp": false
Expand Down
3 changes: 3 additions & 0 deletions interop/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
{
"path": "../packages/stream-multiplexer-mplex"
},
{
"path": "../packages/stream-multiplexer-yamux"
},
{
"path": "../packages/transport-tcp"
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"private": true,
"scripts": {
"reset": "aegir run clean && aegir clean packages/*/node_modules node_modules package-lock.json packages/*/package-lock.json",
"reset": "aegir run clean && aegir clean interop/node_modules examples/*/node_modules packages/*/node_modules node_modules package-lock.json packages/*/package-lock.json examples/*/package-lock.json interop/*/package-lock.json",
"test": "aegir run test",
"test:node": "aegir run test:node",
"test:chrome": "aegir run test:chrome",
Expand All @@ -36,7 +36,7 @@
"docs": "NODE_OPTIONS=--max_old_space_size=4096 aegir docs"
},
"devDependencies": {
"aegir": "^39.0.5"
"aegir": "^39.0.13"
},
"eslintConfig": {
"extends": "ipfs",
Expand Down
2 changes: 1 addition & 1 deletion packages/crypto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
},
"devDependencies": {
"@types/mocha": "^10.0.0",
"aegir": "^39.0.10",
"aegir": "^39.0.13",
"benchmark": "^2.1.4",
"protons": "^7.0.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-compliance-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"uint8arrays": "^4.0.4"
},
"devDependencies": {
"aegir": "^39.0.10"
"aegir": "^39.0.13"
},
"typedoc": {
"entryPoint": "./src/index.ts"
Expand Down
Loading