1- # 🚀 Run Artillery tests
1+ # @lit-protocol/artillery
2+
3+ Standalone Artillery load-testing package for Lit Protocol. Moved from ` packages/e2e/artillery ` .
4+
5+ Usage via root scripts remains the same, now pointing to ` packages/artillery ` .
6+
7+ # Run Artillery tests
28
39- LOG_LEVEL= ` debug ` | ` info ` | ` silent ` | ` debug2 ` (raw console.log)
410- NETWORK= ` naga-dev ` | ` naga-staging `
511
6- ### Basic functionality verification
12+ ## Setup Commands
713
8- ** ⭐️ Purpose ** : Basic sanity check
14+ ### Initialise Artillery
915
10- - ** Users** : 3 people max, 1 new user every minute
11- - ** Duration** : 30 seconds
12- - ** Tests** : All main functions once
13- - ** When to use** : Before releasing code, quick health check, "did I break anything?"
16+ ** ⭐️ Purpose** : Sets up accounts, balances, and authentication for testing
1417
15- ``` jsx
16- LOG_LEVEL = silent NETWORK = naga - dev bun run artillery: smoke
18+ ``` bash
19+ nx run artillery:init
1720```
1821
19- ### Normal traffic simulation
20-
21- ** ⭐️ Purpose** : Simulates typical everyday usage
22+ ### Check Balance Status
2223
23- - ** Users** : 30 people max, 10 new users per second during peak
24- - ** Duration** : 5 minutes total (1min ramp up, 3min steady, 1min ramp down)
25- - ** Tests** : All functions with realistic ratios (40% signing, 30% encryption, 20% JS execution, 10% viewing)
26- - ** When to use** : "Will this handle our normal traffic?"
24+ ** ⭐️ Purpose** : Check account balances before running tests
2725
28- ``` jsx
29- LOG_LEVEL = silent NETWORK = naga - dev bun run artillery: load
26+ ``` bash
27+ nx run artillery:balance-status
3028```
3129
32- ### Find breaking points
30+ ## Load Testing Commands
3331
34- ** ⭐️ Purpose ** : Pushes system beyond normal limits to find where it breaks
32+ ### PKP Sign Focused
3533
36- - ** Users** : 200 people max, up to 50 new users per second
37- - ** Duration** : 11 minutes of gradually increasing pressure
38- - ** Tests** : Same mix as load test but much more intense
39- - ** When to use** : "How much traffic can we handle before things go wrong?"
34+ ** ⭐️ Purpose** : Tests PKP signing functionality specifically
4035
41- ``` jsx
42- LOG_LEVEL = silent NETWORK = naga - dev bun run artillery: stress
36+ ``` bash
37+ nx run artillery:pkp-sign
4338```
4439
45- ### Test traffic spikes
46-
47- ** ⭐️ Purpose** : Sudden traffic bursts (like when your app goes viral)
40+ ### Encrypt-Decrypt Focused
4841
49- - ** Users** : 400 people max during spikes, jumps from 2 to 150 users/second instantly
50- - ** Duration** : 6 minutes with two sudden traffic spikes
51- - ** Tests** : Focuses on signing and encryption (most critical functions)
52- - ** When to use** : "What happens if we suddenly get 100x more traffic?"
42+ ** ⭐️ Purpose** : Tests encryption/decryption functionality
5343
54- ``` jsx
55- LOG_LEVEL = silent NETWORK = naga - dev bun run artillery: spike
44+ ``` bash
45+ nx run artillery:encrypt-decrypt
5646```
5747
58- ### PKP Sign Focused
59-
60- ** ⭐️ Purpose** : Hammers the PKP signing functionality specifically
48+ ### Execute Actions
6149
62- - ** Users** : 50 people max, 15 new users per second during peak
63- - ** Duration** : 7 minutes with sustained high signing load
64- - ** Tests** : ONLY PKP signing with different authentication methods
65- - ** When to use** : "Is our signing service robust enough for heavy use?"
50+ ** ⭐️ Purpose** : Tests Lit Action execution functionality
6651
67- ``` jsx
68- LOG_LEVEL = silent NETWORK = naga - dev bun run artillery: pkp - sign
52+ ``` bash
53+ nx run artillery:execute
6954```
7055
71- ### Encrypt-Decrypt Focused
56+ ### Mixed Workload
7257
73- ** ⭐️ Purpose** : Hammers encryption/decryption functionality specifically
58+ ** ⭐️ Purpose** : Tests a combination of different Lit Protocol operations
7459
75- - ** Users** : 30 people max, 8 new users per second during peak
76- - ** Duration** : 6 minutes of sustained encryption/decryption
77- - ** Tests** : ONLY encryption and decryption functions
78- - ** When to use** : "Can our encryption handle lots of data processing?"
60+ ``` bash
61+ nx run artillery:mix
62+ ```
7963
80- ``` jsx
81- LOG_LEVEL = silent NETWORK = naga- dev bun run artillery: encrypt- decrypt
64+ ### Sign Session Key
65+
66+ ** ⭐️ Purpose** : Tests session key signing functionality
67+
68+ ``` bash
69+ nx run artillery:sign-session-key
8270```
8371
8472## (Optional) Generating a report
@@ -87,4 +75,4 @@ Generating a report required an API key, you can add that to the root `.env` fil
8775
8876``` jsx
8977ARTILLERY_KEY = xxx;
90- ```
78+ ```
0 commit comments