Crates.io | commonware-flood |
lib.rs | commonware-flood |
version | 0.0.62 |
created_at | 2025-02-21 17:12:32.884219+00 |
updated_at | 2025-09-10 18:50:16.862123+00 |
description | Spam peers deployed to AWS EC2 with random messages. |
homepage | https://commonware.xyz |
repository | https://github.com/commonwarexyz/monorepo/tree/main/examples/flood |
max_upload_size | |
id | 1564483 |
size | 154,853 |
Flood peers deployed to AWS EC2 with random messages.
To run this example, you must first install Rust and Docker.
commonware-deployer
cargo install commonware-deployer
cargo run --bin setup -- --peers 3 --bootstrappers 1 --regions us-west-2,us-east-1,eu-west-1 --instance-type c7g.xlarge --storage-size 10 --storage-class gp3 --worker-threads 4 --message-size 1024 --message-backlog 16384 --mailbox-size 16384 --dashboard dashboard.json --instrument true --output assets
We use 3 peers (instead of the 2 required to test connection performance) to demonstrate that peer discovery works.
docker build -t flood-builder .
docker run -it -v ${PWD}/../..:/monorepo flood-builder
Emitted binary flood
is placed in assets
.
cd assets
deployer ec2 create --config config.yaml
Visit http://<monitoring-ip>:3000/d/flood
This dashboard is only accessible from the IP used to deploy the infrastructure.
docker run -it -v ${PWD}/../..:/monorepo flood-builder
deployer ec2 update --config config.yaml
deployer ec2 destroy --config config.yaml
If commonware-deployer
can't detect your AWS credentials, you'll see a "Request has expired." error:
2025-03-05T01:36:47.550105Z INFO deployer::ec2::create: created EC2 client region="eu-west-1"
2025-03-05T01:36:48.268330Z ERROR deployer: failed to create EC2 deployment error=AwsEc2(Unhandled(Unhandled { source: ErrorMetadata { code: Some("RequestExpired"), message: Some("Request has expired."), extras: Some({"aws_request_id": "006f6b92-4965-470d-8eac-7c9644744bdf"}) }, meta: ErrorMetadata { code: Some("RequestExpired"), message: Some("Request has expired."), extras: Some({"aws_request_id": "006f6b92-4965-470d-8eac-7c9644744bdf"}) } }))
EC2 instances may throttle network traffic if a workload exceeds the allocation for a particular instance type. To check if an instance is throttled, SSH into the instance and run:
ethtool -S ens5 | grep "allowance"
If throttled, you'll see a non-zero value for some "allowance" item:
bw_in_allowance_exceeded: 0
bw_out_allowance_exceeded: 14368
pps_allowance_exceeded: 0
conntrack_allowance_exceeded: 0
linklocal_allowance_exceeded: 0