# Import test plans
git clone https://github.com/sigp/gossipsub-testground.git
testground plan import --from ./gossipsub-testground/
# Run `emulation` test plan
cd gossipsub-testground
testground run composition -f emulation/compositions/emulation.toml --wait
Note: Attackers connect to a single publisher (victim). Publisher1
is the victim in this test plan.
sequenceDiagram
participant Publishers
participant Lukers
participant Attackers
%% Discovery
Note over Publishers,Lukers: Setup discovery<br />Connect to some of the honest nodes (publishers + lukers)<br />randomly selected
Note over Attackers: Setup discovery<br />Connect to a single publisher
Publishers->>Lukers: Connect
Lukers->>Publishers: Connect
Attackers->>Publishers: Connect to a single publisher (victim)
%% Subscribe topics
Note over Publishers,Lukers: Subscribe topic(s)
Publishers->>Lukers: Subscribe/GRAFT
Lukers->>Publishers: Subscribe/GRAFT
Publishers->>Attackers: Subscribe/GRAFT
Note over Attackers: Subscribe to the topic in the message from the publisher, <br/>and send back Subscribe/GRAFT.
Attackers->>Publishers: Subscribe/GRAFT
%% Publish messages
Note over Publishers: Periodically publish messages on all topics subscribing.
loop Publish messages
Publishers->>Lukers: Message
Publishers->>Attackers: Message
Note over Attackers: **Don't propagate messages**
end
%% Record metrics
Note over Publishers,Lukers: Record metrics.
Please see the root README for how to run Grafana.
The metrics of gossipsub are recorded once the emulation has been completed. All of the metrics on libp2p-gossipsub are available in this dashboard.
Variables for this dashboard:
run_id
: The run_id for the test run you want to see.topic
: The gossipsub topic, currently it's fixed toemulate
.instance_name
: Some panels in this dashboard need an instance name to be specified. (e.g. score_per_mesh histogram)
The peer scores are recorded periodically (every second) while the emulation is running.
Variables for this dashboard:
run_id
: The run_id for the test run you want to see.instance_name
: It's default toAll
, you can select specific instances.