Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "prototype"
edition = "2021"
edition = "2024"
authors = ["Lola Rigaut-Luczak <me@laflemme.lol>"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand All @@ -15,3 +15,10 @@ serde = { version = "1.0", features = ["derive"] }
toml = "0.8"
sha2 = "0.10.9"
varint = {package = "bitcoin-varint", version = "0.1.0"}

[profile.release]
opt-level = 3
lto = "fat"
codegen-units = 1
strip = true
panic = "abort"
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@ FROM rustlang/rust:nightly AS builder

WORKDIR /usr/src/prototype
COPY . .
RUN cargo install --path .
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/src/eth-prototype/target \
cargo install --path .

##### RUNNER #####
FROM debian:bookworm
FROM debian:trixie-slim

LABEL author="Lola Rigaut-Luczak <me@laflemme.lol>"
LABEL description="Custom node that allow indexing blocks and transactions from block chains."

COPY --from=builder /usr/local/cargo/bin/prototype /usr/local/bin/prototype

RUN apt-get update && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*

# default env
ENV NETWORK "dogecoin_testnet"
ENV RUST_LOG "prototype=info"

CMD prototype ${NETWORK}
ENTRYPOINT ["/bin/sh", "-c", "exec prototype ${NETWORK}"]
2 changes: 2 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
[toolchain]
channel = "nightly"
components = ["rustfmt", "clippy"]
profile = "minimal"
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ fn main() {
// Verify if inventory is what we asked for
let verified = utils::verify_inv_identifier(blocks_inv.inventory);
if !verified {
warn!("One of the inventory record is not a block message. We might have a problem.")
warn!(
"One of the inventory record is not a block message. We might have a problem."
);
}

trace!("inv block count {}", blocks_inv.count);
Expand Down
2 changes: 1 addition & 1 deletion src/p2p/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl Version {
_ => {
return Err(DeserializeError(
"Failed to deserialize relay value".to_owned(),
))
));
}
};

Expand Down
Loading