How to set simulator API conditions
Set simulator request limits and response delay to test client behavior
Use simulator network conditions to test loading states, timeouts, and rate-limit handling. These controls affect API access, independently of virtual block time.
Prerequisites
- Acton 1.2 or later installed.
- An application or remote procedure call (RPC) client to connect to the simulator.
Configure conditions
- In Create environment, select Simulator and expand Network and mining.
- Set Rate limit to 2 requests per second and Response delay to 300 ms.
- Create the environment and connect the client.
- To change latency later, open sidebar settings → Network, adjust Response delay, and select Apply. Use 0 ms to disable the delay.
The running network's rate limit is displayed for reference. Create another environment to use a different startup rate limit.
acton simulator start --port 5411 --rate-limit 2 --response-delay-ms 300Change latency with the network conditions endpoint while the process runs:
curl --fail http://127.0.0.1:5411/acton_setNetworkConditions \
-H 'content-type: application/json' -d '{"response_delay_ms":600}'Use {"response_delay_ms":0} to disable latency. Startup defaults can be stored in Acton.toml:
[localnet]
rate-limit = 2
response-delay-ms = 300Verify client behavior
Send requests through the environment endpoint and inspect timings and statuses in API calls. Exceeding the configured rate should exercise the client's handling of HTTP 429 responses.
Rate limiting applies to /api/* routes. Response delay applies to TON Center v2/v3 and Emulate API responses. Control endpoints and UI assets are not delayed; streaming responses are not subject to the artificial latency setting.
Last updated on