Skip to content

Commit

Permalink
simulators/portal/history/portal-interop: add portal network history …
Browse files Browse the repository at this point in the history
…simulator (#987)
  • Loading branch information
KolbyML committed Feb 5, 2024
1 parent 940f617 commit 09c0bea
Show file tree
Hide file tree
Showing 4 changed files with 741 additions and 0 deletions.
16 changes: 16 additions & 0 deletions simulators/portal/history/portal-interop/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "portal-interop"
version = "0.1.0"
authors = ["Ognyan Genev <[email protected]>", "Kolby ML (Moroz Liebl) <[email protected]>"]
edition = "2021"

[dependencies]
ethportal-api = { git = "https://github.com/ethereum/trin", rev = "2a32224e3c2b0b80bc37c1b692c33016371f197a" }
portal-spec-test-utils-rs = { git = "https://github.com/ethereum/portal-spec-tests", rev = "d1e996d0d4dc2136b3cd38d9e25cdc3a6b74dcd9" }
hivesim = { git = "https://github.com/ethereum/portal-hive", rev = "8ff1e3d3c941dd00d56dacd777a5dfb71edf402f" }
itertools = "0.10.5"
serde_json = "1.0.87"
serde_yaml = "0.9"
tokio = { version = "1", features = ["full"] }
tracing = "0.1.37"
tracing-subscriber = "0.3.16"
25 changes: 25 additions & 0 deletions simulators/portal/history/portal-interop/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM rust:1.71.1 AS builder

# create a new empty shell project
RUN USER=root cargo new --bin portal-interop
WORKDIR /portal-interop

# copy over manifests and source to build image
COPY Cargo.toml ./Cargo.toml
COPY src ./src

# build for release
RUN cargo build --release

# final base
FROM ubuntu:22.04

RUN apt update && apt install wget -y

# copy build artifacts from build stage
COPY --from=builder /portal-interop/target/release/portal-interop .
ADD https://raw.githubusercontent.com/ethereum/portal-spec-tests/master/tests/mainnet/history/hive/test_data_collection_of_forks_blocks.yaml ./test-data/test_data_collection_of_forks_blocks.yaml

ENV RUST_LOG=debug

ENTRYPOINT ["./portal-interop"]
1 change: 1 addition & 0 deletions simulators/portal/history/portal-interop/src/constants.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub const TEST_DATA_FILE_PATH: &str = "./test-data/test_data_collection_of_forks_blocks.yaml";
Loading

0 comments on commit 09c0bea

Please sign in to comment.