-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: rewrite trin-bridge simulator increasing test accuracy + test …
…automation (#115)
- Loading branch information
Showing
7 changed files
with
179 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM portalnetwork/trin:latest-bridge | ||
|
||
ADD test_data_collection_of_forks_blocks.yaml /test_data_collection_of_forks_blocks.yaml | ||
ADD trin_bridge.sh /trin_bridge.sh | ||
RUN chmod +x /trin_bridge.sh | ||
|
||
ADD trin_bridge_version.sh /trin_bridge_version.sh | ||
RUN chmod +x /trin_bridge_version.sh | ||
|
||
RUN /trin_bridge_version.sh > /version.txt | ||
|
||
# Export the usual networking ports to allow outside access to the node | ||
EXPOSE 8545 9009/udp | ||
|
||
# add fake secrets for bridge activation | ||
ENV PANDAOPS_CLIENT_ID=xxx | ||
ENV PANDAOPS_CLIENT_SECRET=xxx | ||
|
||
ENTRYPOINT ["/trin_bridge.sh"] |
38 changes: 38 additions & 0 deletions
38
clients/trin-bridge/test_data_collection_of_forks_blocks.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
# Immediately abort the script on any error encountered | ||
set -e | ||
|
||
IP_ADDR=$(hostname -i | awk '{print $1}') | ||
FLAGS="" | ||
|
||
if [ "$HIVE_BOOTNODES" != "" ]; then | ||
FLAGS="$FLAGS --bootnodes=$HIVE_BOOTNODES" | ||
else | ||
echo "Warning: HIVE_BOOTNODES wasn't provided" | ||
exit 1 | ||
fi | ||
|
||
RUST_LOG=debug portal-bridge --node-count 1 $FLAGS --executable-path ./usr/bin/trin --mode test:/test_data_collection_of_forks_blocks.yaml --external-ip $IP_ADDR --epoch-accumulator-path . trin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# Immediately abort the script on any error encountered | ||
set -e | ||
|
||
#trin --version | tail -1 | sed "s/ /\//g" | ||
echo "latest" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Execution Layer hard forks https://ethereum.org/en/history/ | ||
pub const SHANGHAI_BLOCK_NUMBER: u64 = 17034870; | ||
pub const MERGE_BLOCK_NUMBER: u64 = 15537394; | ||
pub const LONDON_BLOCK_NUMBER: u64 = 12965000; | ||
pub const BERLIN_BLOCK_NUMBER: u64 = 12244000; | ||
pub const ISTANBUL_BLOCK_NUMBER: u64 = 9069000; | ||
pub const CONSTANTINOPLE_BLOCK_NUMBER: u64 = 7280000; | ||
pub const BYZANTIUM_BLOCK_NUMBER: u64 = 4370000; | ||
pub const HOMESTEAD_BLOCK_NUMBER: u64 = 1150000; | ||
|
||
pub const TRIN_BRIDGE_CLIENT_TYPE: &str = "trin-bridge"; | ||
pub const BOOTNODES_ENVIRONMENT_VARIABLE: &str = "HIVE_BOOTNODES"; | ||
pub const HIVE_CHECK_LIVE_PORT: &str = "HIVE_CHECK_LIVE_PORT"; | ||
pub const TEST_DATA_FILE_PATH: &str = "./test-data/test_data_collection_of_forks_blocks.yaml"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters