Skip to content

Commit

Permalink
chore: remove examples from repo (#2171)
Browse files Browse the repository at this point in the history
js-libp2p examples now live in their own repo - https://github.com/libp2p/js-libp2p-examples

They are each replicated into their own repos, e.g. https://github.com/libp2p/js-libp2p-example-circuit-relay
to make them easier to consume a la ipfs-examples/helia-examples.
  • Loading branch information
achingbrain authored Oct 27, 2023
1 parent c6db210 commit 7903d7a
Show file tree
Hide file tree
Showing 169 changed files with 64 additions and 7,543 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, ',') }}
14 changes: 1 addition & 13 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 Down Expand Up @@ -168,17 +168,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 Down Expand Up @@ -218,7 +207,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
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
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 7903d7a

Please sign in to comment.