Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,19 @@ node examples/get-ada-submit-tx.js

```

Also you can run your own Genesis SPO node with ogmios-kupo-faucet-share_config and simulate congestion using spammer:
You can also run your own Genesis SPO node with Ogmios, Kupo, Faucet, Share Config, and Prometheus Metrics, and simulate congestion using Spammer. It is worth mentioning that we can regulate congestion using the MEMPOOL_PAUSE_LIMIT (max 1_000_000 bytes). This means, the Spammer will run until the mempool reaches the target value.

It is possible that the cardano-node on your machine outpaces the Spammer, and you want to simulate higher congestion. In this case, we can reduce the block size, increase the slotLength, or both.

```bash
git clone https://github.com/mlabs-haskell/congested-testnet
cd congested-testnet
SPAMMER_ON=true FAUCET_ON=true docker-compose --profile genesis_spo up -d
MEMPOOL_PAUSE_LIMIT=200000 \
SLOT_LENGTH=1 \
MAX_BLOCK_BODY_SIZE=65000 \
SPAMMER_ON=true \
FAUCET_ON=true \
docker-compose --profile genesis_spo up -d
```
If you only need to run a relay node connected to the Genesis SPO, use the following command:
```bash
Expand Down
12 changes: 8 additions & 4 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ services:
- PORT=3000
- BYRON_GENESIS_SPEC_JSON=/scripts/byron.genesis.spec.json
- CONFIGURATION_YAML=/scripts/configuration.yaml
# maxBlockBodySize and slotLength influence on cardano-node throughput
- MAX_BLOCK_BODY_SIZE=${MAX_BLOCK_BODY_SIZE:-65536}
- SLOT_LENGTH=${SLOT_LENGTH:-1}

ports:
- "3000:3000"
- "12789:12789"
Expand Down Expand Up @@ -98,10 +102,10 @@ services:
- N_WORKERS=2
- OGMIOS_URL=ogmios.local
- KUPO_URL=kupo.local
- MEMPOOL_PAUSE_LIMIT=80000
# off if you don't need spammer or faucet
- SPAMMER_ON=true
- FAUCET_ON=true
# mempool pause limit affects congestion
- MEMPOOL_PAUSE_LIMIT=${MEMPOOL_PAUSE_LIMIT:-80000}
- SPAMMER_ON=${SPAMMER_ON:-true}
- FAUCET_ON=${FAUCET_ON:-true}

ports:
# await tx time metric
Expand Down
2 changes: 2 additions & 0 deletions nix/services.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ in
export PORT=3000
export SHARE=${share-config}
export ROOT=${root}
export SLOT_LENGTH=2
export MAX_BLOCK_BODY_SIZE=18000
rm -rf "$ROOT"
rm -rf "$SHARE"
mkdir -p "$ROOT"
Expand Down
24 changes: 22 additions & 2 deletions scripts/gen_testnet_conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
# export CONFIGURATION_YAML
# export ROOT
# export SHARE
#
# export MAX_BLOCK_BODY_SIZE
# export SLOT_LENGTH

mkdir -p $ROOT

Expand Down Expand Up @@ -49,7 +50,26 @@ cardano-cli conway genesis create-testnet-data \

# change some parameters in shelley genesis

jq --argjson maxSupply "$MAX_SUPPLY" --argjson secParam "$SECURITY_PARAM" '.maxLovelaceSupply = $maxSupply | .slotLength = 2 | .securityParam = $secParam | .activeSlotsCoeff = 0.05 | .epochLength = 432000 | .updateQuorum = 2 | .protocolParams.protocolVersion.major = 9 | .protocolParams.minFeeA = 44 | .protocolParams.minFeeB = 155381 | .protocolParams.minUTxOValue = 1000000 | .protocolParams.decentralisationParam = 1 | .protocolParams.rho = 0.003 | .protocolParams.tau = 0.2 | .protocolParams.a0 = 0.3 | .protocolParams.maxBlockBodySize = 17000 | .protocolParams.maxBlockHeaderSize = 1100' "$ROOT/shelley-genesis.json" > "$ROOT/temp.json" && mv "$ROOT/temp.json" "$ROOT/shelley-genesis.json"
jq --argjson maxSupply "$MAX_SUPPLY" \
--argjson secParam "$SECURITY_PARAM" \
--argjson maxBody "$MAX_BLOCK_BODY_SIZE" \
--argjson slotLength "$SLOT_LENGTH" \
'.maxLovelaceSupply = $maxSupply
| .slotLength = $slotLength
| .securityParam = $secParam
| .activeSlotsCoeff = 0.05
| .epochLength = 432000
| .updateQuorum = 2
| .protocolParams.protocolVersion.major = 9
| .protocolParams.minFeeA = 44
| .protocolParams.minFeeB = 155381
| .protocolParams.minUTxOValue = 1000000
| .protocolParams.decentralisationParam = 1
| .protocolParams.rho = 0.003
| .protocolParams.tau = 0.2
| .protocolParams.a0 = 0.3
| .protocolParams.maxBlockBodySize = $maxBody
| .protocolParams.maxBlockHeaderSize = 1100' "$ROOT/shelley-genesis.json" > "$ROOT/temp.json" && mv "$ROOT/temp.json" "$ROOT/shelley-genesis.json"



Expand Down