Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simulators/portal/history/portal-interop: add portal network history portal-interop simulator #987

Merged
merged 2 commits into from
Feb 5, 2024
Merged
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
Empty file modified .circleci/rust-simulators.sh
100644 → 100755
Empty file.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ workspace
.idea/
# build output
/hive

# build output for rust simulators files
simulators/**/Cargo.lock
simulators/**/target
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