How to generate localnet test traffic
Generate bounded transfers, jetton operations, and NFT operations to test localnet behavior
Generate transfers, jetton operations, and non-fungible token (NFT) operations to test localnet nodes and indexers under load. The localnet service owns the run, so closing the Studio page does not stop it.
Activity submits transactions and increases load on the selected localnet. Save a snapshot first to restore the initial state. Stopping activity does not undo submitted transactions.
Prerequisites
- A running localnet.
- Ready nodes, APIs, and indexers under Network → Health.
Configure and run traffic
- Open Network → Activity.
- Choose the mix of Transfers, Batch transfers, Jettons, and NFTs. A weight of 0 disables that scenario family.
- Set a bounded duration, interval, and concurrency. Adjust amounts and batch size under Scenario settings when needed.
- Select Start activity. Inspect completed and failed scenarios and confirmed messages.
- Select Stop activity to finish early. Wait for in-flight work to settle.
Transfers use fresh wallets; jetton and NFT scenarios include deployment and subsequent actions. Scenario weights control scenario starts, not exact transaction counts.
Use the control API connection, replacing <CONTROL_URL> with the service URL and <CONTROL_TOKEN> with its token. Save this bounded workload as activity.json:
{
"intervalSeconds": 10,
"scenariosPerLaunch": 1,
"concurrency": 2,
"durationSeconds": 60,
"maxBatchSize": 16,
"randomizeBatchSize": false,
"transferAmount": 100000000,
"walletVersions": ["v5r1"],
"scenarios": {"transfers": 50, "batches": 20, "jettons": 20, "nfts": 10}
}transferAmount is in nanograms; this example uses 0.1 GRAM. Start and inspect the run:
curl --fail '<CONTROL_URL>/v1/network/activity/start' \
-H 'Authorization: Bearer <CONTROL_TOKEN>' \
-H 'content-type: application/json' --data-binary @activity.json
curl --fail '<CONTROL_URL>/v1/network/activity' \
-H 'Authorization: Bearer <CONTROL_TOKEN>'Stop before the configured duration when needed:
curl --fail -X POST '<CONTROL_URL>/v1/network/activity/stop' \
-H 'Authorization: Bearer <CONTROL_TOKEN>'Verify the workload
Inspect the recent scenario results and open the associated addresses in Explorer. Compare node statistics and indexer lag under Network. A stopped run can still have submitted transactions on-chain. Interrupted runs are not automatically replayed after a service restart.
Last updated on