forked from ethereum/hive
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'eth/master'
- Loading branch information
Showing
93 changed files
with
4,242 additions
and
955 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 |
---|---|---|
@@ -1,79 +1,14 @@ | ||
version: 2.1 | ||
orbs: | ||
go: circleci/[email protected] | ||
|
||
jobs: | ||
# This job builds the hive executable and stores it in the workspace. | ||
build: | ||
docker: | ||
- image: cimg/go:1.21 | ||
steps: | ||
# Build it. | ||
- checkout | ||
- go/load-cache | ||
- go/mod-download | ||
- go/save-cache | ||
- run: {command: 'go build -ldflags="-s -extldflags=-static" -tags "osusergo netgo static_build" .'} | ||
# Store the executable. | ||
- persist_to_workspace: | ||
root: . | ||
paths: ["hive"] | ||
|
||
# This job runs the smoke test simulations. This requires a virtual | ||
# machine instead of the container-based build environment because | ||
# hive needs to be able to talk to the docker containers it creates. | ||
smoke-tests: | ||
machine: | ||
image: ubuntu-2004:202201-02 | ||
steps: | ||
- checkout | ||
- attach_workspace: {at: "/tmp/build"} | ||
- run: | ||
command: "/tmp/build/hive --sim=smoke/genesis --client=go-ethereum" | ||
- run: | ||
command: "/tmp/build/hive --sim=smoke/network --client=go-ethereum" | ||
setup: true | ||
|
||
# This job also runs the smoke test simulations, but against a remote dockerd. | ||
smoke-tests-remote-docker: | ||
docker: | ||
- image: cimg/base:2022.04 | ||
steps: | ||
- checkout | ||
- attach_workspace: {at: "/tmp/build"} | ||
- setup_remote_docker: {version: 20.10.14} | ||
- run: | ||
command: "/tmp/build/hive --sim=smoke/genesis --client=go-ethereum --loglevel 5" | ||
- run: | ||
command: "/tmp/build/hive --sim=smoke/network --client=go-ethereum --loglevel 5" | ||
|
||
# This job runs the go unit tests. | ||
go-test: | ||
docker: | ||
- image: cimg/go:1.21 | ||
steps: | ||
# Get the source. | ||
- checkout | ||
- go/load-cache | ||
- go/mod-download | ||
- go/save-cache | ||
# Run the tests. | ||
- run: | ||
name: "hive module tests" | ||
command: "go test -cover ./..." | ||
- run: | ||
name: "hiveproxy module tests" | ||
command: "go test -cover ./..." | ||
working_directory: "./hiveproxy" | ||
- run: | ||
name: "Compile Go simulators" | ||
command: ".circleci/compile-simulators.sh" | ||
orbs: | ||
path-filtering: circleci/[email protected] | ||
|
||
workflows: | ||
main: | ||
setup-workflow: | ||
jobs: | ||
- go-test | ||
- build | ||
- smoke-tests: | ||
requires: ["build"] | ||
- smoke-tests-remote-docker: | ||
requires: ["build"] | ||
- path-filtering/filter: | ||
mapping: | | ||
simulators/portal/.* rust-ci true | ||
base-revision: origin/master |
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,106 @@ | ||
version: 2.1 | ||
orbs: | ||
go: circleci/[email protected] | ||
|
||
parameters: | ||
rust-ci: | ||
type: boolean | ||
default: false | ||
|
||
jobs: | ||
# This job builds the hive executable and stores it in the workspace. | ||
build: | ||
docker: | ||
- image: cimg/go:1.21 | ||
steps: | ||
# Build it. | ||
- checkout | ||
- go/load-cache | ||
- go/mod-download | ||
- go/save-cache | ||
- run: {command: 'go build -ldflags="-s -extldflags=-static" -tags "osusergo netgo static_build" .'} | ||
# Store the executable. | ||
- persist_to_workspace: | ||
root: . | ||
paths: ["hive"] | ||
|
||
# This job runs the smoke test simulations. This requires a virtual | ||
# machine instead of the container-based build environment because | ||
# hive needs to be able to talk to the docker containers it creates. | ||
smoke-tests: | ||
machine: | ||
image: ubuntu-2004:202201-02 | ||
steps: | ||
- checkout | ||
- attach_workspace: {at: "/tmp/build"} | ||
- run: | ||
command: "/tmp/build/hive --sim=smoke/genesis --client=go-ethereum" | ||
- run: | ||
command: "/tmp/build/hive --sim=smoke/network --client=go-ethereum" | ||
|
||
# This job also runs the smoke test simulations, but against a remote dockerd. | ||
smoke-tests-remote-docker: | ||
docker: | ||
- image: cimg/base:2022.04 | ||
steps: | ||
- checkout | ||
- attach_workspace: {at: "/tmp/build"} | ||
- setup_remote_docker: {version: 20.10.14} | ||
- run: | ||
command: "/tmp/build/hive --sim=smoke/genesis --client=go-ethereum --loglevel 5" | ||
- run: | ||
command: "/tmp/build/hive --sim=smoke/network --client=go-ethereum --loglevel 5" | ||
|
||
# This job runs the go unit tests. | ||
go-test: | ||
docker: | ||
- image: cimg/go:1.21 | ||
steps: | ||
# Get the source. | ||
- checkout | ||
- go/load-cache | ||
- go/mod-download | ||
- go/save-cache | ||
# Run the tests. | ||
- run: | ||
name: "hive module tests" | ||
command: "go test -cover ./..." | ||
- run: | ||
name: "hiveproxy module tests" | ||
command: "go test -cover ./..." | ||
working_directory: "./hiveproxy" | ||
- run: | ||
name: "Compile Go simulators" | ||
command: ".circleci/compile-simulators.sh" | ||
# this makes sure the rust code is good | ||
rust-simulators: | ||
docker: | ||
- image: cimg/rust:1.75.0 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install rustfmt | ||
command: rustup component add rustfmt | ||
- run: | ||
name: Install Clippy | ||
command: rustup component add clippy | ||
- run: | ||
name: Install Clang | ||
command: sudo apt update && sudo apt-get install clang -y | ||
- run: | ||
name: "Lint, build, test Rust simulators" | ||
command: ".circleci/rust-simulators.sh" | ||
|
||
workflows: | ||
main: | ||
jobs: | ||
- go-test | ||
- build | ||
- smoke-tests: | ||
requires: ["build"] | ||
- smoke-tests-remote-docker: | ||
requires: ["build"] | ||
rust-jobs: | ||
when: << pipeline.parameters.rust-ci >> | ||
jobs: | ||
- rust-simulators |
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 | ||
|
||
# This causes the bash script to exit immediately if any commands errors out | ||
set -e | ||
|
||
failed="" | ||
sims=$(find simulators -name Cargo.toml) | ||
for d in $sims; do | ||
d="$(dirname "$d")" | ||
echo "Lint, build, test $d" | ||
( cd "$d" || exit 1; | ||
cargo fmt --all -- --check; | ||
cargo clippy --all --all-targets --all-features --no-deps -- --deny warnings; | ||
cargo test --workspace -- --nocapture; | ||
) | ||
done |
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
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
Empty file.
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
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,12 @@ | ||
ARG branch=amd64-master-latest | ||
|
||
FROM statusim/nimbus-fluffy:$branch | ||
|
||
ADD fluffy.sh /fluffy.sh | ||
RUN chmod +x /fluffy.sh | ||
|
||
RUN echo "latest" > /version.txt | ||
|
||
EXPOSE 8545 9009/udp | ||
|
||
ENTRYPOINT ["/fluffy.sh"] |
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,23 @@ | ||
#!/bin/bash | ||
|
||
# Immediately abort the script on any error encountered | ||
set -e | ||
|
||
IP_ADDR=$(hostname -i | awk '{print $1}') | ||
FLAGS="" | ||
|
||
if [ "$HIVE_PORTAL_NETWORKS_SELECTED" != "" ]; then | ||
if [[ $HIVE_PORTAL_NETWORKS_SELECTED =~ "beacon" ]]; then | ||
# Providing atrusted block root is required currently to enable the beacon network. | ||
# It can be a made up value for now as tests are not doing any sync. | ||
FLAGS="$FLAGS --trusted-block-root:0x0000000000000000000000000000000000000000000000000000000000000000" | ||
fi | ||
fi | ||
|
||
|
||
if [ "$HIVE_CLIENT_PRIVATE_KEY" != "" ]; then | ||
FLAGS="$FLAGS --netkey-unsafe=0x$HIVE_CLIENT_PRIVATE_KEY" | ||
fi | ||
|
||
# Fluffy runs all networks by default, so we can not configure to run networks individually | ||
fluffy --rpc --rpc-address="0.0.0.0" --nat:extip:"$IP_ADDR" --network=none --log-level="debug" $FLAGS |
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,2 @@ | ||
roles: | ||
- portal |
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
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
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
Oops, something went wrong.