Skip to content

Commit

Permalink
p2p/simulations: improve README language (ethereum#24051)
Browse files Browse the repository at this point in the history
  • Loading branch information
uwatm8 authored Dec 6, 2021
1 parent a25906e commit acb0f7a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions p2p/simulations/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# devp2p Simulations

The `p2p/simulations` package implements a simulation framework which supports
creating a collection of devp2p nodes, connecting them together to form a
The `p2p/simulations` package implements a simulation framework that supports
creating a collection of devp2p nodes, connecting them to form a
simulation network, performing simulation actions in that network and then
extracting useful information.

Expand Down Expand Up @@ -65,10 +65,10 @@ localhost ports.

## Network

A simulation network is created with an ID and default service (which is used
if a node is created without an explicit service), exposes methods for
creating, starting, stopping, connecting and disconnecting nodes, and emits
events when certain actions occur.
A simulation network is created with an ID and default service. The default
service is used if a node is created without an explicit service. The
network has exposed methods for creating, starting, stopping, connecting
and disconnecting nodes. It also emits events when certain actions occur.

### Events

Expand All @@ -80,7 +80,7 @@ A simulation network emits the following events:

The events have a "control" flag which when set indicates that the event is the
outcome of a controlled simulation action (e.g. creating a node or explicitly
connecting two nodes together).
connecting two nodes).

This is in contrast to a non-control event, otherwise called a "live" event,
which is the outcome of something happening in the network as a result of a
Expand All @@ -98,12 +98,12 @@ network and then wait for expectations to be met.
With a running simulation network, the `Simulation.Run` method can be called
with a `Step` which has the following fields:

* `Action` - a function which performs some action in the network
* `Action` - a function that performs some action in the network

* `Expect` - an expectation function which returns whether or not a
given node meets the expectation

* `Trigger` - a channel which receives node IDs which then trigger a check
* `Trigger` - a channel that receives node IDs which then trigger a check
of the expectation function to be performed against that node

As a concrete example, consider a simulated network of Ethereum nodes. An
Expand All @@ -116,7 +116,7 @@ the expectation and what network events were emitted during the step run.

## HTTP API

The simulation framework includes a HTTP API which can be used to control the
The simulation framework includes a HTTP API that can be used to control the
simulation.

The API is initialised with a particular node adapter and has the following
Expand Down

0 comments on commit acb0f7a

Please sign in to comment.