Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
acb0f7a6
Unverified
Commit
acb0f7a6
authored
Dec 06, 2021
by
Arvid Hast
Committed by
GitHub
Dec 06, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
p2p/simulations: improve README language (#24051)
parent
a25906e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
README.md
p2p/simulations/README.md
+10
-10
No files found.
p2p/simulations/README.md
View file @
acb0f7a6
# devp2p Simulations
# devp2p Simulations
The
`p2p/simulations`
package implements a simulation framework
which
supports
The
`p2p/simulations`
package implements a simulation framework
that
supports
creating a collection of devp2p nodes, connecting them to
gether to
form a
creating a collection of devp2p nodes, connecting them to form a
simulation network, performing simulation actions in that network and then
simulation network, performing simulation actions in that network and then
extracting useful information.
extracting useful information.
...
@@ -65,10 +65,10 @@ localhost ports.
...
@@ -65,10 +65,10 @@ localhost ports.
## Network
## Network
A simulation network is created with an ID and default service
(which is used
A simulation network is created with an ID and default service
. The default
if a node is created without an explicit service), exposes methods for
service is used if a node is created without an explicit service. The
creating, starting, stopping, connecting and disconnecting nodes, and emits
network has exposed methods for creating, starting, stopping, connecting
events when certain actions occur.
and disconnecting nodes. It also emits
events when certain actions occur.
### Events
### Events
...
@@ -80,7 +80,7 @@ A simulation network emits the following events:
...
@@ -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
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
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,
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
which is the outcome of something happening in the network as a result of a
...
@@ -98,12 +98,12 @@ network and then wait for expectations to be met.
...
@@ -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 running simulation network, the
`Simulation.Run`
method can be called
with a
`Step`
which has the following fields:
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
*
`Expect`
- an expectation function which returns whether or not a
given node meets the expectation
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
of the expectation function to be performed against that node
As a concrete example, consider a simulated network of Ethereum nodes. An
As a concrete example, consider a simulated network of Ethereum nodes. An
...
@@ -116,7 +116,7 @@ the expectation and what network events were emitted during the step run.
...
@@ -116,7 +116,7 @@ the expectation and what network events were emitted during the step run.
## HTTP API
## 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.
simulation.
The API is initialised with a particular node adapter and has the following
The API is initialised with a particular node adapter and has the following
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment