Skip to content

Commit

Permalink
Merge branch 'master' into server-dedup-listen
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaseizinger committed Sep 11, 2023
2 parents ba00657 + 240019f commit 295146c
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 16 deletions.
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion misc/keygen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ publish = false
clap = { version = "4.3.23", features = ["derive"] }
zeroize = "1"
serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0.105"
serde_json = "1.0.106"
libp2p-core = { workspace = true }
base64 = "0.21.3"
libp2p-identity = { workspace = true }
3 changes: 3 additions & 0 deletions misc/server/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.12.3] - unreleased
### Changed
- Add libp2p-lookup to Dockerfile to enable healthchecks.

### Fixed

- Disable QUIC `draft-29` support.
Expand Down
8 changes: 6 additions & 2 deletions misc/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
FROM rust:1.66-bullseye as builder
FROM rust:1.72-bullseye as builder
WORKDIR /usr/src/rust-libp2p-server

# Run with access to the target cache to speed up builds
WORKDIR /workspace

RUN --mount=type=cache,target=/usr/local/cargo/registry \
cargo install --locked --root /usr/local libp2p-lookup --version 0.6.4

ADD . .
RUN --mount=type=cache,target=./target \
--mount=type=cache,target=/usr/local/cargo/registry \
Expand All @@ -12,5 +16,5 @@ RUN --mount=type=cache,target=./target \
mv ./target/release/libp2p-server /usr/local/bin/libp2p-server

FROM gcr.io/distroless/cc
COPY --from=builder /usr/local/bin/libp2p-server /usr/local/bin/libp2p-server
COPY --from=builder /usr/local/bin/libp2p-server /usr/local/bin/libp2p-lookup /usr/local/bin/
CMD ["libp2p-server"]
6 changes: 6 additions & 0 deletions misc/server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@ Local peer id: PeerId("12D3KooWSa1YEeQVSwvoqAMhwjKQ6kqZQckhWPb3RWEGV3sZGU6Z")
Listening on "/ip4/127.0.0.1/udp/4001/quic"
[...]
```

The Docker container includes [libp2-lookup](https://github.com/mxinden/libp2p-lookup/) to enable adding a proper healthcheck for container startup, e.g.

``` shell
docker run --health-cmd 'libp2p-lookup direct --address /ip4/127.0.0.1/tcp/4001/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa' /home/ipfs/.ipfs:/ipfs ghcr.io/libp2p/rust-libp2p-server --config /ipfs/config
```
2 changes: 1 addition & 1 deletion protocols/gossipsub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ regex = "1.9.5"
serde = { version = "1", optional = true, features = ["derive"] }
sha2 = "0.10.7"
smallvec = "1.11.0"
unsigned-varint = { version = "0.7.0", features = ["asynchronous_codec"] }
unsigned-varint = { version = "0.7.2", features = ["asynchronous_codec"] }
void = "1.0.2"

# Metrics dependencies
Expand Down
2 changes: 1 addition & 1 deletion protocols/request-response/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ libp2p-swarm = { workspace = true }
libp2p-identity = { workspace = true }
rand = "0.8"
serde = { version = "1.0", optional = true}
serde_json = { version = "1.0.105", optional = true }
serde_json = { version = "1.0.106", optional = true }
smallvec = "1.11.0"
void = "1.0.2"
log = "0.4.20"
Expand Down
2 changes: 1 addition & 1 deletion swarm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ libp2p-yamux = { path = "../muxers/yamux" } # Using `path` here because this is
quickcheck = { workspace = true }
void = "1"
once_cell = "1.18.0"
trybuild = "1.0.83"
trybuild = "1.0.84"

[[test]]
name = "swarm_derive"
Expand Down

0 comments on commit 295146c

Please sign in to comment.