Skip to content

Commit d1998f1

Browse files
docs(consume,execute): add hive dev mode macOS workaround (ethereum#1786)
* docs: add hive dev mode macos workaround. * chore(docs): changelog. * Update docs/running_tests/hive/dev_mode.md Co-authored-by: danceratopz <[email protected]> --------- Co-authored-by: danceratopz <[email protected]>
1 parent bb2992c commit d1998f1

File tree

2 files changed

+84
-1
lines changed

2 files changed

+84
-1
lines changed

docs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Users can select any of the artifacts depending on their testing needs for their
6161
- 🔀 Split `src/ethereum_test_types/types.py` into several files to improve code organization ([#1665](https://github.com/ethereum/execution-spec-tests/pull/1665)).
6262
- ✨ Added `extract_config` command to extract genesis files used to launch clients in hive ([#1740](https://github.com/ethereum/execution-spec-tests/pull/1740)).
6363
- ✨ Added automatic checklist generation for every EIP inside of the `tests` folder. The checklist is appended to each EIP in the documentation in the "Test Case Reference" section ([#1679](https://github.com/ethereum/execution-spec-tests/pull/1679), [#1718](https://github.com/ethereum/execution-spec-tests/pull/1718)).
64+
- 🔀 Add macOS hive development mode workaround to the docs [#1786](https://github.com/ethereum/execution-spec-tests/pull/1786).
6465

6566
### 🧪 Test Cases
6667

docs/running_tests/hive/dev_mode.md

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,19 @@ This avoids running the simulator in a dockerized environment and has several ad
99
3. Provides access to a larger set of the simulator's command-line options,
1010
4. Runs are faster; there are no docker image rebuilds in between runs. In particular, modifications to the simulator do not require a an image rebuild.
1111

12+
## Platform Support
13+
14+
- Linux: Direct development mode supported.
15+
- macOS: Must be ran from a Linux environment or use a Docker-based workaround (see macOS Setup).
16+
1217
## Quick Start
1318

1419
### Prerequisites
1520

1621
- EEST is installed, see [Installation](../../getting_started/installation.md)
1722
- Hive is built, see [Hive](../hive/index.md#quick-start).
1823

19-
## Hive Dev Setup
24+
## Hive Dev Setup (Linux)
2025

2126
1. Start Hive in development mode, e.g.:
2227

@@ -45,6 +50,83 @@ This avoids running the simulator in a dockerized environment and has several ad
4550
uv run consume rlp --input stable@latest
4651
```
4752

53+
## macOS Setup
54+
55+
Due to Docker running within a VM on macOS, the host machine and Docker containers don't share the same network namespace, preventing direct communication with Hive's development server. To run development mode on macOS, you have the following options:
56+
57+
1. Linux VM: Run a Linux virtual machine on your macOS and execute the standard development workflow above from within the VM.
58+
2. Remote Linux: SSH into a remote Linux environment (server or cloud instance) and run development mode there.
59+
3. **Docker Development Image**: Create a containerized EEST environment that runs within Docker's network namespace (recommended).
60+
61+
The following section details the setup and usage of option 3.
62+
63+
### EEST Docker Development Image
64+
65+
Within the [`eest/`](https://github.com/ethereum/hive/tree/master/simulators/ethereum/eest) directory of hive, a new dockerfile must be created: `Dockerfile.dev`, with the following contents:
66+
67+
```docker
68+
FROM ghcr.io/astral-sh/uv:python3.10-bookworm-slim
69+
ARG branch=main
70+
ENV GIT_REF=${branch}
71+
72+
RUN apt-get update && apt-get install -y git
73+
RUN git init execution-spec-tests && \
74+
cd execution-spec-tests && \
75+
git remote add origin https://github.com/ethereum/execution-spec-tests.git && \
76+
git fetch --depth 1 origin $GIT_REF && \
77+
git checkout FETCH_HEAD;
78+
79+
WORKDIR /execution-spec-tests
80+
RUN uv sync
81+
ENTRYPOINT ["/bin/bash"]
82+
```
83+
84+
This dockerfile will be our entry point for running EEST commands.
85+
86+
### `eest/` Hive Directory Structure
87+
88+
```tree
89+
├── eest
90+
│ ├── Dockerfile.dev
91+
│ ├── consume-block-rlp
92+
│ │ └── Dockerfile
93+
│ └── consume-engine
94+
│ └── Dockerfile
95+
```
96+
97+
### Running Consume
98+
99+
1. Get your local IP address:
100+
101+
```bash
102+
ipconfig getifaddr en0
103+
```
104+
105+
2. Start Hive in development mode with your local IP:
106+
107+
```bash
108+
./hive --dev --dev.addr <LOCAL_IP>:3000 --client go-ethereum --client-file clients.yaml
109+
```
110+
111+
3. In a separate terminal session, build the EEST development image:
112+
113+
```bash
114+
cd simulators/ethereum/eest/
115+
docker build -t macos-consume-dev -f Dockerfile.dev .
116+
```
117+
118+
4. Run the container with the Hive simulator environment:
119+
120+
```bash
121+
docker run -it -e HIVE_SIMULATOR=http://<LOCAL_IP>:3000 macos-consume-dev
122+
```
123+
124+
5. Inside the Docker container, run consume commands:
125+
126+
```bash
127+
uv run consume engine -v
128+
```
129+
48130
## How Development Mode Works
49131
50132
When Hive runs in dev mode:

0 commit comments

Comments
 (0)