Eth2 clients packaged for networking tests
Project description
stethoscope-clients
A process runner in python for Eth 2.0 clients. Designed for use with stethoscope.
Background
For both simulation and testing, it's valuable to be able to programmatically start and stop each Eth 2.0 client. This repo provides a python interface for doing just that.
To be platform independent, clients are run via Docker.
To connect with and drive clients, we use rumor, specifically the python interface.
Installation
pip install stethoscope-clients
Usage
The key methods in this library are start_instance
, stop_instance
, and connect_rumor
. See below for a full sample usage:
import trio
from pyrum import SubprocessConn, Rumor
from sclients import start_instance, stop_instance, connect_rumor, InstanceConfig, ENR
enr_str = ...
client_config = InstanceConfig(
client='lighthouse',
beacon_state_path='./genesis.ssz',
enr= ENR(
private_key=...,
tcp=9001,
udp=9002,
id='v4'
ip: '127.0.0.1'
enr: enr_str,
attnets: ...
eth2: ...
)
)
try:
start_instance(client_config)
# This block will eventually be encapsulated in `connect_rumor`
async with SubprocessConn(cmd='rumor bare') as conn:
async with trio.open_nursery() as nursery:
rumor = Rumor(conn, nursery)
client_peer_id = await connect_rumor(rumor, enr_str)
# Insert your rumor interactions with client_peer_id
nursery.cancel_scope.cancel()
finally:
stop_instance(client_config)
Client progress
client | status |
---|---|
lighthouse | done |
prysm | done |
teku | in progress |
nimbus | TODO |
lodestar | TODO |
cortex | TODO |
trinity | TODO |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for stethoscope-clients-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d68c7414e5e2e10da27609e4d75ba62ce557c81da7216967fb136b8f8887f82 |
|
MD5 | df2ad1d212e9c6c4d33ccc46d6370299 |
|
BLAKE2b-256 | 35402e3de6222ee141bee838e20337588f9923d5f4d3a7b72f034a5c76187bfa |
Close
Hashes for stethoscope_clients-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f6f53e5c744452639b58c3fee4161926bcae5c1b1af5c73470c1f0158c31745 |
|
MD5 | 307f0230d3225428634dfcff58ef851b |
|
BLAKE2b-256 | c65623882976e59f483c57cf8459601bf4a4549e8cd8577c4db1a326b4aa3702 |