-
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.
- Loading branch information
Showing
24 changed files
with
307 additions
and
151 deletions.
There are no files selected for viewing
This file was deleted.
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,62 @@ | ||
# Sample workflow for building and deploying a mdBook site to GitHub Pages | ||
# | ||
# To get started with mdBook see: https://rust-lang.github.io/mdBook/index.html | ||
# | ||
name: Deploy mdBook site to Pages | ||
|
||
on: | ||
# Runs on pushes targeting the default branch | ||
push: | ||
branches: ["main"] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
# Build job | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
MDBOOK_VERSION: 0.4.36 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install mdBook | ||
run: | | ||
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh | ||
rustup update | ||
cargo install --version ${MDBOOK_VERSION} mdbook | ||
- name: Setup Pages | ||
id: pages | ||
uses: actions/configure-pages@v5 | ||
- name: Build with mdBook | ||
run: | | ||
cd mdbook | ||
mdbook build | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: ./mdbook/book | ||
|
||
# Deployment job | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
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,7 +1,125 @@ | ||
# `ethshadow`: Discrete-event Ethereum network simulations | ||
# Ethshadow: Discrete-event Ethereum network simulations | ||
|
||
`ethshadow` is a tool to easily configure and run simulated Ethereum networks. Under the hood, it uses | ||
<!--- ANCHOR: overview (for mdbook) --> | ||
|
||
Ethshadow is a tool to easily configure and run simulated Ethereum networks. Under the hood, it uses | ||
[Shadow](https://shadow.github.io/), a discrete-event network simulator that enables us to run simulations with actual | ||
Ethereum clients instead of specifically written simulation code. | ||
|
||
Check out the [guide](https://ethereum.github.io/ethshadow) to get started! | ||
The advantages of using Ethshadow are as follows. | ||
|
||
1. It already includes everything in the simulation (e.g. libp2p, discv5, etc). | ||
2. It uses the same software as the mainnet and the public testnets. | ||
3. If there is any upgades in lighthouse, we can integrate those upgrades easily in the simulation. | ||
|
||
If you want to simulate a new Ethereum protocol, what you need to do is just to implement it in lighthouse or geth or | ||
any other supported EL and CL clients and run it using this simulator. | ||
|
||
<!--- ANCHOR_END: overview (for mdbook) --> | ||
|
||
## Quickstart | ||
|
||
We assume that you already have Go, Rust, and Docker installed. | ||
|
||
Install Lighthouse and Geth. | ||
```sh | ||
# Lighthouse | ||
sudo apt update && sudo apt install -y git gcc g++ make cmake pkg-config llvm-dev libclang-dev clang | ||
git clone https://github.com/sigp/lighthouse.git | ||
cd lighthouse | ||
git checkout v5.3.0 # The latest tested version | ||
make | ||
make install-lcli | ||
|
||
# Geth | ||
git clone https://github.com/ethereum/go-ethereum.git | ||
cd go-ethereum | ||
git checkout v1.14.11 # The latest tested version | ||
make all | ||
sudo cp build/bin/geth /usr/local/bin/geth # Make it globally accessible | ||
sudo cp build/bin/bootnode /usr/local/bin/bootnode # Make it globally accessible | ||
``` | ||
|
||
Install Shadow | ||
```sh | ||
sudo apt-get install -y cmake findutils libclang-dev libc-dbg libglib2.0-0 libglib2.0-dev make netbase python3 python3-networkx xz-utils util-linux gcc g++ | ||
git clone https://github.com/shadow/shadow.git | ||
cd shadow | ||
./setup build --clean | ||
./setup install | ||
echo 'export PATH="${PATH}:/home/${USER}/.local/bin"' >> ~/.bashrc && source ~/.bashrc | ||
``` | ||
|
||
Install Ethshadow. | ||
```sh | ||
cargo install --path . | ||
``` | ||
|
||
Save the following file to a config file `myfirstsim.yaml`. | ||
|
||
```yaml | ||
general: | ||
# How much time should we simulate? | ||
stop_time: 10 min | ||
# Display a progress indicator? | ||
progress: true | ||
|
||
ethereum: | ||
# Distribute this many validators evenly across all nodes | ||
validators: 30 | ||
# Create this many nodes with Geth, Lighthouse and a Validator client. | ||
# Additionally, a host with one boot node for CL and EL each is added. | ||
nodes: 10 | ||
``` | ||
Run the simulation. | ||
```sh | ||
ethshadow myfirstsim.yaml | ||
``` | ||
|
||
Check out `./data/shadow/hosts` which contais the stdout and stderr of every process (including geth and lighthouse) | ||
of every node. | ||
|
||
## Supported clients | ||
|
||
<!--- ANCHOR: supported-clients (for mdbook) --> | ||
|
||
✅ = Available, works out-of-the-box with latest release | ||
|
||
🚧 = Available, works with modifications (see subpage for details) | ||
|
||
❌ = Unavailable, does not currently work | ||
|
||
❔ = Unavailable, not yet tested | ||
|
||
A client is considered to work if it can follow the chain and perform the necessary duties for validating. Other | ||
features might not work. | ||
|
||
### Execution Layer | ||
|
||
| Name | Node | Boot Node | Latest tested version | | ||
|------------------------------|:----:|:---------:|:---------------------:| | ||
| Besu | ❔ | ❔ | | | ||
| Erigon | ❔ | ❔ | | | ||
| EthereumJS | ❔ | ❔ | | | ||
| [Geth](docs/clients/geth.md) | ✅ | ✅ | v1.14.11 | | ||
| Nethermind | ❔ | ❔ | | | ||
| Reth | 🚧 | ❔ | | | ||
|
||
|
||
### Consensus Layer | ||
|
||
| Name | Node | Boot Node | Validator Client | Latest tested version | | ||
|------------------------------------------|:----:|:---------:|:----------------:|:---------------------:| | ||
| Grandine | ❔ | ❔ | ❔ | | | ||
| [Lighthouse](docs/clients/lighthouse.md) | ✅ | ✅ | ✅ | v5.3.0 | | ||
| Lodestar | ❔ | ❔ | ❔ | | | ||
| Nimbus | ❔ | ❔ | ❔ | | | ||
| Prysm | ❔ | ❔ | ❔ | | | ||
| Teku | ❔ | ❔ | ❔ | | | ||
|
||
<!--- ANCHOR_END: supported-clients (for mdbook) --> | ||
|
||
## More Information | ||
|
||
See https://ppopth.github.io/ethshadow for the documentation |
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,11 @@ | ||
# The Ethshadow Documentation | ||
|
||
[The Ethshadow Simulator](ethshadow.md) | ||
|
||
- [Installation](installation.md) | ||
- [Supported Clients](supported-clients.md) | ||
- [Geth](clients/geth.md) | ||
- [Lighthouse](clients/lighthouse.md) | ||
- [Getting Started](getting-started.md) | ||
- [Advanced Usage]() | ||
- [Limitations]() |
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 @@ | ||
# Geth | ||
|
||
## Installation | ||
|
||
Install both `geth` and `bootnode. | ||
|
||
```sh | ||
git clone https://github.com/ethereum/go-ethereum.git | ||
cd go-ethereum | ||
git checkout v1.14.11 # The latest tested version | ||
make all | ||
sudo cp build/bin/geth /usr/local/bin/geth # Make it globally accessible | ||
sudo cp build/bin/bootnode /usr/local/bin/bootnode # Make it globally accessible | ||
``` | ||
|
||
Or consult the [official page](https://geth.ethereum.org/docs/getting-started/installing-geth) for the installation. |
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 @@ | ||
# Lighthouse | ||
|
||
## Installation | ||
|
||
You need to install both the `lighthouse` and `lcli` commands, so it's recommended to install them from source. | ||
|
||
```sh | ||
sudo apt update && sudo apt install -y git gcc g++ make cmake pkg-config llvm-dev libclang-dev clang | ||
git clone https://github.com/sigp/lighthouse.git | ||
cd lighthouse | ||
git checkout v5.3.0 # The latest tested version | ||
make | ||
make install-lcli | ||
``` | ||
|
||
Or consult the [official page](https://lighthouse-book.sigmaprime.io/installation-source.html) for the installation. |
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,3 @@ | ||
# The Shadow Simulator | ||
|
||
{{ #include ../README.md:overview }} |
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.