
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Write ethereum/hive simulators using Python.
This library provides a Python API for creating and running Ethereum Hive simulation tests, allowing you to test Ethereum clients against various scenarios and network conditions.
pip install ethereum-hive
./hive --dev --client go-ethereum
Here's a basic example of how to use the Hive Python API with Hive running in developer mode. It requires a genesis file; please modify the path as required.
from pathlib import Path
from hive.simulation import Simulation
from hive.testing import HiveTestResult
# Create a simulation on a development hive server
simulator = Simulation(url="http://127.0.0.1:3000")
# Get information about the hive instance cli args and clients
hive_info = simulator.hive_instance()
# Start a test suite
suite = simulator.start_suite("my_test_suite", "my test suite description")
# Start a test
test = suite.start_test("my_test", "my test description")
# Start a client for the test
all_clients = simulator.client_types()
print(all_clients[0].version)
# Specify the genesis file; here we use the genesis from the unit test
files = {"genesis.json": Path("src/hive/tests/genesis.json").as_posix()}
env = {"HIVE_CHAIN_ID": "1"}
client = test.start_client(client_type=all_clients[0], environment=env, files=files)
# Run your test logic
# ...
# Stop the test and the suite (will clean-up clients)
test.end(result=HiveTestResult(test_pass=True, details="test details"))
suite.end()
For more detailed examples, check out the unit tests or explore the simulators in the execution-spec-tests repository.
Install uv
:
curl -LsSf https://astral.sh/uv/install.sh | sh
Clone and setup the project:
git clone https://github.com/marioevz/hive.py.git
cd hive.py
uv sync --all-extras
Fetch and build hive:
git clone https://github.com/ethereum/hive.git
cd hive
go build -v .
Run hive in dev mode:
./hive --dev --client go-ethereum,lighthouse-bn,lighthouse-vc
Run the test suite:
uv run pytest
uv run black src/
uv run mypy src/
uv run isort src/
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
FAQs
Ethereum Hive Simulator Python API
We found that ethereum-hive demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.