Skip to content

Commit

Permalink
Merge branch 'master' into feat/track-dial-failures-per-address
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain authored Nov 2, 2023
2 parents 40dd225 + 16a8707 commit 3296f11
Show file tree
Hide file tree
Showing 379 changed files with 2,884 additions and 9,745 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Examples
on:
push:
branches:
- master
pull_request:
branches:
- '**'

jobs:

build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master

test-examples:
name: Test example ${{ matrix.example.name }}
runs-on: ubuntu-latest
needs: build
continue-on-error: true
strategy:
matrix:
example:
- name: js-libp2p-example-chat
repo: https://github.com/libp2p/js-libp2p-example-chat.git
deps:
- '@libp2p/peer-id-factory@$PWD/packages/peer-id-factory'
- '@libp2p/tcp@$PWD/packages/transport-tcp'
- '@libp2p/websockets@$PWD/packages/transport-websockets'
- 'libp2p@$PWD/packages/libp2p'
- name: js-libp2p-example-circuit-relay
repo: https://github.com/libp2p/js-libp2p-example-circuit-relay.git
deps:
- '@libp2p/websockets@$PWD/packages/transport-websockets'
- 'libp2p@$PWD/packages/libp2p'
- name: js-libp2p-example-connection-encryption
repo: https://github.com/libp2p/js-libp2p-example-connection-encryption.git
deps:
- '@libp2p/tcp@$PWD/packages/transport-tcp'
- 'libp2p@$PWD/packages/libp2p'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npx xvfb-maybe aegir test-dependant ${{ matrix.example.repo }} --deps ${{ join(matrix.example.deps, ',') }}
38 changes: 17 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ci
name: CI
on:
push:
branches:
Expand All @@ -17,6 +17,10 @@ jobs:
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
with:
directories: |
./interop/dist
./interop/node_modules
check:
needs: build
Expand Down Expand Up @@ -48,8 +52,8 @@ jobs:
- run: npm run --if-present test:node
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
with:
directory: ./.nyc_output
flags: node
files: .coverage/*,packages/*/.coverage/*

test-chrome:
needs: build
Expand All @@ -63,8 +67,8 @@ jobs:
- run: npm run --if-present test:chrome
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
with:
directory: ./.nyc_output
flags: chrome
files: .coverage/*,packages/*/.coverage/*

test-chrome-webworker:
needs: build
Expand All @@ -78,8 +82,8 @@ jobs:
- run: npm run --if-present test:chrome-webworker
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
with:
directory: ./.nyc_output
flags: chrome-webworker
files: .coverage/*,packages/*/.coverage/*

test-firefox:
needs: build
Expand All @@ -93,8 +97,8 @@ jobs:
- run: npm run --if-present test:firefox
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
with:
directory: ./.nyc_output
flags: firefox
files: .coverage/*,packages/*/.coverage/*

test-firefox-webworker:
needs: build
Expand All @@ -108,8 +112,8 @@ jobs:
- run: npm run --if-present test:firefox-webworker
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
with:
directory: ./.nyc_output
flags: firefox-webworker
files: .coverage/*,packages/*/.coverage/*

test-webkit:
needs: build
Expand All @@ -124,8 +128,8 @@ jobs:
- run: npm run --if-present test:webkit
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
with:
directory: ./.nyc_output
flags: webkit
files: .coverage/*,packages/*/.coverage/*

test-electron-main:
needs: build
Expand All @@ -139,8 +143,8 @@ jobs:
- run: npx xvfb-maybe npm run --if-present test:electron-main
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
with:
directory: ./.nyc_output
flags: electron-main
files: .coverage/*,packages/*/.coverage/*

test-electron-renderer:
needs: build
Expand All @@ -154,8 +158,8 @@ jobs:
- run: npx xvfb-maybe npm run --if-present test:electron-renderer
- uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
with:
directory: ./.nyc_output
flags: electron-renderer
files: .coverage/*,packages/*/.coverage/*

test-interop:
needs: build
Expand All @@ -168,17 +172,6 @@ jobs:
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run test:interop -- --bail

test-examples:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present test:example

transport-interop:
needs: build
runs-on: ${{ fromJSON(github.repository == 'libp2p/js-libp2p' && '["self-hosted", "linux", "x64", "4xlarge"]' || '"ubuntu-latest"') }}
Expand All @@ -188,6 +181,10 @@ jobs:
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
with:
directories: |
./interop/dist
./interop/node_modules
- name: Build images
run: (cd interop && make -j 4)
- name: Save package-lock.json as artifact
Expand Down Expand Up @@ -218,7 +215,6 @@ jobs:
test-electron-main,
test-electron-renderer,
test-interop,
test-examples,
transport-interop
]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -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"}
{"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"}
15 changes: 2 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ This project has been used in production for years in Ethereum, IPFS, and more.
The documentation in the master branch may contain changes from a pre-release.
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.

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

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

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

### Tutorials and Examples

You can find multiple examples on the [examples folder](./examples) that will guide you through using libp2p for several scenarios.
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.

## Structure

- [`/doc`](./doc) Docs for libp2p
- [`/examples/auto-relay`](./examples/auto-relay) Shows how to configure relayed connections
- [`/examples/chat`](./examples/chat) An example chat app using libp2p
- [`/examples/connection-encryption`](./examples/connection-encryption) An example of how to configure connection encrypters
- [`/examples/delegated-routing`](./examples/delegated-routing) How to configure libp2p delegated routers
- [`/examples/discovery-mechanisms`](./examples/discovery-mechanisms) How to configure peer discovery mechanisms
- [`/examples/echo`](./examples/echo) An example echo app
- [`/examples/peer-and-content-routing`](./examples/peer-and-content-routing) How to use peer and content routing
- [`/examples/pnet`](./examples/pnet) How to configure a libp2p private network
- [`/examples/protocol-and-stream-muxing`](./examples/protocol-and-stream-muxing) How to use multiplex protocols streams
- [`/examples/pubsub`](./examples/pubsub) An example using libp2p pubsub
- [`/examples/transports`](./examples/transports) An example using different types of libp2p transport
- [`/interop`](./interop) Multidimension Interop Test
- [`/packages/crypto`](./packages/crypto) Crypto primitives for libp2p
- [`/packages/interface`](./packages/interface) The interface implemented by a libp2p node
Expand Down
2 changes: 1 addition & 1 deletion doc/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ As libp2p is designed to be a modular networking library, its usage will vary ba

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.

The [examples](../examples) are also a good source of help for finding a configuration that suits your needs.
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.

## Limits

Expand Down
2 changes: 1 addition & 1 deletion doc/GETTING_STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ localStorage.setItem('debug', 'libp2p:websockets,libp2p:webtransport,libp2p:kad-

## What is next

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!
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!


[transport]: https://github.com/libp2p/js-interfaces/tree/master/src/transport
Expand Down
2 changes: 1 addition & 1 deletion doc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@libp2p/tcp": "^8.0.0",
"aegir": "^41.0.2",
"libp2p": "^0.46.0",
"prom-client": "^14.2.0"
"prom-client": "^15.0.0"
},
"private": true
}
32 changes: 0 additions & 32 deletions examples/README.md

This file was deleted.

4 changes: 0 additions & 4 deletions examples/auto-relay/LICENSE

This file was deleted.

5 changes: 0 additions & 5 deletions examples/auto-relay/LICENSE-APACHE

This file was deleted.

19 changes: 0 additions & 19 deletions examples/auto-relay/LICENSE-MIT

This file was deleted.

Loading

0 comments on commit 3296f11

Please sign in to comment.