Skip to content

Commit 09c0bea

Browse files
authored
simulators/portal/history/portal-interop: add portal network history simulator (#987)
1 parent 940f617 commit 09c0bea

File tree

4 files changed

+741
-0
lines changed

4 files changed

+741
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[package]
2+
name = "portal-interop"
3+
version = "0.1.0"
4+
authors = ["Ognyan Genev <ognian.genev@gmail.com>", "Kolby ML (Moroz Liebl) <kolbydml@gmail.com>"]
5+
edition = "2021"
6+
7+
[dependencies]
8+
ethportal-api = { git = "https://github.com/ethereum/trin", rev = "2a32224e3c2b0b80bc37c1b692c33016371f197a" }
9+
portal-spec-test-utils-rs = { git = "https://github.com/ethereum/portal-spec-tests", rev = "d1e996d0d4dc2136b3cd38d9e25cdc3a6b74dcd9" }
10+
hivesim = { git = "https://github.com/ethereum/portal-hive", rev = "8ff1e3d3c941dd00d56dacd777a5dfb71edf402f" }
11+
itertools = "0.10.5"
12+
serde_json = "1.0.87"
13+
serde_yaml = "0.9"
14+
tokio = { version = "1", features = ["full"] }
15+
tracing = "0.1.37"
16+
tracing-subscriber = "0.3.16"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM rust:1.71.1 AS builder
2+
3+
# create a new empty shell project
4+
RUN USER=root cargo new --bin portal-interop
5+
WORKDIR /portal-interop
6+
7+
# copy over manifests and source to build image
8+
COPY Cargo.toml ./Cargo.toml
9+
COPY src ./src
10+
11+
# build for release
12+
RUN cargo build --release
13+
14+
# final base
15+
FROM ubuntu:22.04
16+
17+
RUN apt update && apt install wget -y
18+
19+
# copy build artifacts from build stage
20+
COPY --from=builder /portal-interop/target/release/portal-interop .
21+
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
22+
23+
ENV RUST_LOG=debug
24+
25+
ENTRYPOINT ["./portal-interop"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub const TEST_DATA_FILE_PATH: &str = "./test-data/test_data_collection_of_forks_blocks.yaml";

0 commit comments

Comments
 (0)