Skip to content

Commit 616b0a8

Browse files
committed
Merge remote-tracking branch 'origin/master' into feat/call-progress-callback-for-content-and-peer-routing
2 parents c709a17 + 16a8707 commit 616b0a8

File tree

379 files changed

+2879
-9745
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

379 files changed

+2879
-9745
lines changed

.github/workflows/examples.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Examples
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- '**'
9+
10+
jobs:
11+
12+
build:
13+
name: Build
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-node@v3
18+
with:
19+
node-version: lts/*
20+
- uses: ipfs/aegir/actions/cache-node-modules@master
21+
22+
test-examples:
23+
name: Test example ${{ matrix.example.name }}
24+
runs-on: ubuntu-latest
25+
needs: build
26+
continue-on-error: true
27+
strategy:
28+
matrix:
29+
example:
30+
- name: js-libp2p-example-chat
31+
repo: https://github.com/libp2p/js-libp2p-example-chat.git
32+
deps:
33+
- '@libp2p/peer-id-factory@$PWD/packages/peer-id-factory'
34+
- '@libp2p/tcp@$PWD/packages/transport-tcp'
35+
- '@libp2p/websockets@$PWD/packages/transport-websockets'
36+
- 'libp2p@$PWD/packages/libp2p'
37+
- name: js-libp2p-example-circuit-relay
38+
repo: https://github.com/libp2p/js-libp2p-example-circuit-relay.git
39+
deps:
40+
- '@libp2p/websockets@$PWD/packages/transport-websockets'
41+
- 'libp2p@$PWD/packages/libp2p'
42+
- name: js-libp2p-example-connection-encryption
43+
repo: https://github.com/libp2p/js-libp2p-example-connection-encryption.git
44+
deps:
45+
- '@libp2p/tcp@$PWD/packages/transport-tcp'
46+
- 'libp2p@$PWD/packages/libp2p'
47+
steps:
48+
- uses: actions/checkout@v3
49+
- uses: actions/setup-node@v3
50+
with:
51+
node-version: lts/*
52+
- uses: ipfs/aegir/actions/cache-node-modules@master
53+
- run: npx xvfb-maybe aegir test-dependant ${{ matrix.example.repo }} --deps ${{ join(matrix.example.deps, ',') }}

.github/workflows/main.yml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: ci
1+
name: CI
22
on:
33
push:
44
branches:
@@ -17,6 +17,10 @@ jobs:
1717
with:
1818
node-version: lts/*
1919
- uses: ipfs/aegir/actions/cache-node-modules@master
20+
with:
21+
directories: |
22+
./interop/dist
23+
./interop/node_modules
2024
2125
check:
2226
needs: build
@@ -48,8 +52,8 @@ jobs:
4852
- run: npm run --if-present test:node
4953
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
5054
with:
51-
directory: ./.nyc_output
5255
flags: node
56+
files: .coverage/*,packages/*/.coverage/*
5357

5458
test-chrome:
5559
needs: build
@@ -63,8 +67,8 @@ jobs:
6367
- run: npm run --if-present test:chrome
6468
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
6569
with:
66-
directory: ./.nyc_output
6770
flags: chrome
71+
files: .coverage/*,packages/*/.coverage/*
6872

6973
test-chrome-webworker:
7074
needs: build
@@ -78,8 +82,8 @@ jobs:
7882
- run: npm run --if-present test:chrome-webworker
7983
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
8084
with:
81-
directory: ./.nyc_output
8285
flags: chrome-webworker
86+
files: .coverage/*,packages/*/.coverage/*
8387

8488
test-firefox:
8589
needs: build
@@ -93,8 +97,8 @@ jobs:
9397
- run: npm run --if-present test:firefox
9498
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
9599
with:
96-
directory: ./.nyc_output
97100
flags: firefox
101+
files: .coverage/*,packages/*/.coverage/*
98102

99103
test-firefox-webworker:
100104
needs: build
@@ -108,8 +112,8 @@ jobs:
108112
- run: npm run --if-present test:firefox-webworker
109113
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
110114
with:
111-
directory: ./.nyc_output
112115
flags: firefox-webworker
116+
files: .coverage/*,packages/*/.coverage/*
113117

114118
test-webkit:
115119
needs: build
@@ -124,8 +128,8 @@ jobs:
124128
- run: npm run --if-present test:webkit
125129
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
126130
with:
127-
directory: ./.nyc_output
128131
flags: webkit
132+
files: .coverage/*,packages/*/.coverage/*
129133

130134
test-electron-main:
131135
needs: build
@@ -139,8 +143,8 @@ jobs:
139143
- run: npx xvfb-maybe npm run --if-present test:electron-main
140144
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
141145
with:
142-
directory: ./.nyc_output
143146
flags: electron-main
147+
files: .coverage/*,packages/*/.coverage/*
144148

145149
test-electron-renderer:
146150
needs: build
@@ -154,8 +158,8 @@ jobs:
154158
- run: npx xvfb-maybe npm run --if-present test:electron-renderer
155159
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
156160
with:
157-
directory: ./.nyc_output
158161
flags: electron-renderer
162+
files: .coverage/*,packages/*/.coverage/*
159163

160164
test-interop:
161165
needs: build
@@ -168,17 +172,6 @@ jobs:
168172
- uses: ipfs/aegir/actions/cache-node-modules@master
169173
- run: npm run test:interop -- --bail
170174

171-
test-examples:
172-
needs: build
173-
runs-on: ubuntu-latest
174-
steps:
175-
- uses: actions/checkout@v3
176-
- uses: actions/setup-node@v3
177-
with:
178-
node-version: lts/*
179-
- uses: ipfs/aegir/actions/cache-node-modules@master
180-
- run: npm run --if-present test:example
181-
182175
transport-interop:
183176
needs: build
184177
runs-on: ${{ fromJSON(github.repository == 'libp2p/js-libp2p' && '["self-hosted", "linux", "x64", "4xlarge"]' || '"ubuntu-latest"') }}
@@ -188,6 +181,10 @@ jobs:
188181
with:
189182
node-version: lts/*
190183
- uses: ipfs/aegir/actions/cache-node-modules@master
184+
with:
185+
directories: |
186+
./interop/dist
187+
./interop/node_modules
191188
- name: Build images
192189
run: (cd interop && make -j 4)
193190
- name: Save package-lock.json as artifact
@@ -218,7 +215,6 @@ jobs:
218215
test-electron-main,
219216
test-electron-renderer,
220217
test-interop,
221-
test-examples,
222218
transport-interop
223219
]
224220
if: github.event_name == 'push' && github.ref == 'refs/heads/master'

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"interop":"1.0.6","packages/crypto":"2.0.5","packages/interface":"0.1.3","packages/interface-compliance-tests":"4.1.1","packages/interface-internal":"0.1.6","packages/kad-dht":"10.0.9","packages/keychain":"3.0.5","packages/libp2p":"0.46.14","packages/logger":"3.0.3","packages/metrics-prometheus":"2.0.8","packages/multistream-select":"4.0.3","packages/peer-collections":"4.0.5","packages/peer-discovery-bootstrap":"9.0.8","packages/peer-discovery-mdns":"9.0.10","packages/peer-id":"3.0.3","packages/peer-id-factory":"3.0.5","packages/peer-record":"6.0.6","packages/peer-store":"9.0.6","packages/protocol-perf":"1.1.11","packages/pubsub":"8.0.7","packages/pubsub-floodsub":"8.0.9","packages/stream-multiplexer-mplex":"9.0.8","packages/transport-tcp":"8.0.9","packages/transport-webrtc":"3.2.3","packages/transport-websockets":"7.0.9","packages/transport-webtransport":"3.1.3","packages/utils":"4.0.4"}
1+
{"interop":"1.0.8","packages/crypto":"2.0.6","packages/interface":"0.1.4","packages/interface-compliance-tests":"4.1.2","packages/interface-internal":"0.1.7","packages/kad-dht":"10.0.11","packages/keychain":"3.0.6","packages/libp2p":"0.46.16","packages/logger":"3.0.4","packages/metrics-prometheus":"2.0.9","packages/multistream-select":"4.0.4","packages/peer-collections":"4.0.6","packages/peer-discovery-bootstrap":"9.0.9","packages/peer-discovery-mdns":"9.0.11","packages/peer-id":"3.0.4","packages/peer-id-factory":"3.0.6","packages/peer-record":"6.0.7","packages/peer-store":"9.0.7","packages/protocol-perf":"1.1.13","packages/pubsub":"8.0.8","packages/pubsub-floodsub":"8.0.10","packages/stream-multiplexer-mplex":"9.0.9","packages/transport-tcp":"8.0.10","packages/transport-webrtc":"3.2.5","packages/transport-websockets":"7.0.10","packages/transport-webtransport":"3.1.5","packages/utils":"4.0.5"}

README.md

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ This project has been used in production for years in Ethereum, IPFS, and more.
4343
The documentation in the master branch may contain changes from a pre-release.
4444
If you are looking for the documentation of the latest release, you can view the latest release on [**npm**](https://www.npmjs.com/package/libp2p), or select the tag in github that matches the version you are looking for.
4545

46-
**Want to get started?** Check our [GETTING\_STARTED.md](./doc/GETTING_STARTED.md) guide and [examples folder](/examples).
46+
**Want to get started?** Check our [GETTING\_STARTED.md](./doc/GETTING_STARTED.md) guide and [examples](https://github.com/libp2p/js-libp2p-examples).
4747

4848
**Want to update libp2p in your project?** Check our [migrations folder](./doc/migrations).
4949

@@ -114,22 +114,11 @@ If you are starting your journey with `js-libp2p`, read the [GETTING\_STARTED.md
114114

115115
### Tutorials and Examples
116116

117-
You can find multiple examples on the [examples folder](./examples) that will guide you through using libp2p for several scenarios.
117+
You can find multiple examples on the [examples repo](https://github.com/libp2p/js-libp2p-examples) that will guide you through using libp2p for several scenarios.
118118

119119
## Structure
120120

121121
- [`/doc`](./doc) Docs for libp2p
122-
- [`/examples/auto-relay`](./examples/auto-relay) Shows how to configure relayed connections
123-
- [`/examples/chat`](./examples/chat) An example chat app using libp2p
124-
- [`/examples/connection-encryption`](./examples/connection-encryption) An example of how to configure connection encrypters
125-
- [`/examples/delegated-routing`](./examples/delegated-routing) How to configure libp2p delegated routers
126-
- [`/examples/discovery-mechanisms`](./examples/discovery-mechanisms) How to configure peer discovery mechanisms
127-
- [`/examples/echo`](./examples/echo) An example echo app
128-
- [`/examples/peer-and-content-routing`](./examples/peer-and-content-routing) How to use peer and content routing
129-
- [`/examples/pnet`](./examples/pnet) How to configure a libp2p private network
130-
- [`/examples/protocol-and-stream-muxing`](./examples/protocol-and-stream-muxing) How to use multiplex protocols streams
131-
- [`/examples/pubsub`](./examples/pubsub) An example using libp2p pubsub
132-
- [`/examples/transports`](./examples/transports) An example using different types of libp2p transport
133122
- [`/interop`](./interop) Multidimension Interop Test
134123
- [`/packages/crypto`](./packages/crypto) Crypto primitives for libp2p
135124
- [`/packages/interface`](./packages/interface) The interface implemented by a libp2p node

doc/CONFIGURATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,7 @@ As libp2p is designed to be a modular networking library, its usage will vary ba
10171017

10181018
If you have developed a project using `js-libp2p`, please consider submitting your configuration to this list so that it can be found easily by other users.
10191019

1020-
The [examples](../examples) are also a good source of help for finding a configuration that suits your needs.
1020+
The [examples repo](https://github.com/libp2p/js-libp2p-examples) is also a good source of help for finding a configuration that suits your needs.
10211021

10221022
## Limits
10231023

doc/GETTING_STARTED.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ localStorage.setItem('debug', 'libp2p:websockets,libp2p:webtransport,libp2p:kad-
276276

277277
## What is next
278278

279-
There are a lot of other concepts within `libp2p`, that are not covered in this guide. For additional configuration options we recommend checking out the [Configuration Readme](./CONFIGURATION.md) and the [examples folder](../examples). If you have any problems getting started, or if anything isn't clear, please let us know by submitting an issue!
279+
There are a lot of other concepts within `libp2p`, that are not covered in this guide. For additional configuration options we recommend checking out the [Configuration Readme](./CONFIGURATION.md) and the [examples repo](https://github.com/libp2p/js-libp2p-examples). If you have any problems getting started, or if anything isn't clear, please let us know by submitting an issue!
280280

281281

282282
[transport]: https://github.com/libp2p/js-interfaces/tree/master/src/transport

doc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"@libp2p/tcp": "^8.0.0",
3131
"aegir": "^41.0.2",
3232
"libp2p": "^0.46.0",
33-
"prom-client": "^14.2.0"
33+
"prom-client": "^15.0.0"
3434
},
3535
"private": true
3636
}

examples/README.md

Lines changed: 0 additions & 32 deletions
This file was deleted.

examples/auto-relay/LICENSE

Lines changed: 0 additions & 4 deletions
This file was deleted.

examples/auto-relay/LICENSE-APACHE

Lines changed: 0 additions & 5 deletions
This file was deleted.

examples/auto-relay/LICENSE-MIT

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)