Commit Graph

26 Commits

Author SHA1 Message Date
d605255fec feat(libp2p): add SwarmBuilder
Introduce the new `libp2p::SwarmBuilder`. Users should use the new `libp2p::SwarmBuilder` instead of the now deprecated `libp2p::swarm::SwarmBuilder`. See `libp2p::SwarmBuilder` docs on how to use the new builder.

Fixes #3657.
Fixes #3563.
Fixes #3179.

Pull-Request: #4120.
2023-10-10 06:55:14 +00:00
0e9d339bd2 ci: use workspace inheritance to enforce lints in all crates
Starting with nightly-2023-09-10, the `[lints]` section in `Cargo.toml` files is stable. Together with workspace inheritance, this can be used to declare all lints we want to enforce in a single place.

Resolves: #4484.

Pull-Request: #4575.
2023-10-09 02:20:46 +00:00
b0c3da7f87 feat(swarm): log local peer id on swarm creation
Closes https://github.com/libp2p/rust-libp2p/issues/4394.

Pull-Request: #4439.
2023-09-12 10:09:27 +00:00
eb83367430 deps: bump clap from 4.3.21 to 4.3.23
Pull-Request: #4359.
2023-08-21 09:37:15 +00:00
cbdbaa836e feat(quic): promote to stable release
- Cut a stable release of `libp2p-quic`.
- Export `libp2p-quic` as `libp2p::quic`.
- Update examples to use `libp2p-quic` through `libp2p`.

Pull-Request: #4325.
2023-08-17 07:54:29 +00:00
8022769daf deps: bump clap from 4.3.19 to 4.3.21
Pull-Request: #4319.
2023-08-14 09:20:07 +00:00
132688961f deps: bump clap from 4.3.11 to 4.3.12
Pull-Request: #4206.
2023-07-19 13:10:14 +00:00
2f288523b0 deps: bump clap from 4.3.10 to 4.3.11
Pull-Request: #4178.
2023-07-11 11:44:04 +00:00
62ab42aecb deps: bump clap from 4.3.8 to 4.3.10
Pull-Request: #4144.
2023-07-03 16:46:28 +00:00
6241b92fe4 deps: bump clap from 4.3.3 to 4.3.8
Pull-Request: #4118.
2023-06-26 10:43:20 +00:00
e28f0326c7 deps: bump clap from 4.3.2 to 4.3.3
Pull-Request: #4061.
2023-06-20 15:23:15 +00:00
cf3e4c6860 feat(quic): implement hole punching
Implement `Transport::dial_as_listener` for QUIC as specified by the [DCUtR spec](https://github.com/libp2p/specs/blob/master/relay/DCUtR.md).

To facilitate hole punching in QUIC, one side needs to send random UDP packets to establish a mapping in the routing table of the NAT device. If successful, our listener will emit a new inbound connection. This connection needs to then be sent to the dialing task. We achieve this by storing a `HashMap` of hole punch attempts indexed by the remote's `SocketAddr`. A matching incoming connection is then sent via a oneshot channel to the dialing task which continues with upgrading the connection.

Related #2883.

Pull-Request: #3964.
2023-06-13 11:42:18 +00:00
2910c985e8 fix(examples): call Swarm::add_external_address in dcutr and relay
> Observed addresses (aka. external address candidates) of the local node, reported by a remote node
> via `libp2p-identify`, are no longer automatically considered confirmed external addresses, in
> other words they are no longer trusted by default. Instead users need to confirm the reported
> observed address either manually, or by using `libp2p-autonat`. In trusted environments users can
> simply extract observed addresses from a `libp2p-identify::Event::Received { info:
> libp2p_identify::Info { observed_addr }}` and confirm them via `Swarm::add_external_address`.

Follow-up to https://github.com/libp2p/rust-libp2p/pull/3954.

Pull-Request: #4052.
2023-06-09 03:26:24 +00:00
c723df461f deps: bump clap from 4.3.0 to 4.3.1
Pull-Request: #4027.
2023-06-05 10:59:28 +00:00
75edcfcdb0 docs(examples): add a README to each example
Resolves #3853.

Pull-Request: #3974.
2023-06-01 07:40:22 +00:00
d090b58881 deps: bump clap from 4.2.7 to 4.3.0
Pull-Request: #3970.
2023-05-22 18:48:38 +00:00
8acbabdaf6 deps: bump clap from 4.2.6 to 4.2.7
Pull-Request: #3870.
2023-05-02 19:57:44 +00:00
6a22bd3df0 deps: bump clap from 4.2.5 to 4.2.6
Pull-Request: #3869.
2023-05-02 19:38:16 +00:00
b1cdf8d4bb feat(yamux): rename symbols to follow module-based naming convention
Implements our naming convention for the `libp2p-yamux` crate.

Related: #2217.

Pull-Request: #3852.
2023-05-01 02:25:52 +00:00
cfdf5c3345 deps: bump clap from 4.2.4 to 4.2.5
Pull-Request: #3849.
2023-04-28 14:21:17 +00:00
2f5270ba76 feat(noise): deprecate all handshake patterns apart from XX
In the libp2p specs, the only handshake pattern that is specified is the XX handshake. Support for other handshake patterns can be added through external modules. While we are at it, we rename the remaining types to following the laid out naming convention.

The tests for handshakes other than XX are removed. The handshakes still work as we don't touch them in this patch.

Related #2217.

Pull-Request: #3768.
2023-04-28 13:50:31 +00:00
a836bb471f deps: bump clap from 4.2.1 to 4.2.4
Pull-Request: #3808.
2023-04-28 11:19:43 +00:00
28da3d4180 fix(ci): ensure all examples compile with the specified feature-set
Due to cargo's feature unification, a full build of our workspace doesn't actually check whether the examples compile as standalone projects.

We add a new CI check that iterates through all crates in the `examples/` directory and runs a plain `cargo check` on them. Any failure is bubbled up via `set -e`, thus failing CI in case one of the `cargo check` commands fails.

To fix the current failures, we construct a simple TCP transport everywhere where we were previously using `development_transport`. That is because `development_transport` requires `mplex` which is now deprecated.

Related #3657.
Related #3809.

Pull-Request: #3811.
2023-04-21 09:58:08 +00:00
389e519e7f deps: bump clap from 4.1.11 to 4.2.1
Pull-Request: #3731.
2023-04-03 19:02:18 +00:00
0ff0ef7a35 deps: bump futures from 0.3.27 to 0.3.28
Pull-Request: #3725.
2023-04-03 14:43:42 +00:00
fd0983567c chore(relay): move server example to examples/
Related: #3111.

Pull-Request: #3663.
2023-03-23 21:38:56 +00:00