@@ -30,29 +30,131 @@ KMS can be configured to two modes:
3030The test suite offers a unified CLI for all operations:
3131
3232``` sh
33-
3433cd test-suite/fhevm
34+
3535# Deploy the entire stack
3636./fhevm-cli deploy
37+ # WIP: Build images locally (when private registry not available)
38+ ./fhevm-cli deploy --build
3739
38- # Run specific tests
39- ./fhevm-cli test input-proof
40- # Trivial
41- ./fhevm-cli test user-decryption
42- # Trivial
43- ./fhevm-cli test public-decryption
44- ./fhevm-cli test erc20
45-
46- # Upgrade a specific service
40+ # Run blockchain integration tests
41+ ./fhevm-cli test input-proof # Test input proofs
42+ ./fhevm-cli test user-decryption # Test user decryptions
43+ ./fhevm-cli test public-decryption # Test public decryptions
44+ ./fhevm-cli test erc20 # Test ERC20 operations
45+ ./fhevm-cli test debug # Debug mode testing
46+
47+ # Database connector testing (runs gateway-stress via fhevm-cli wrapper)
48+ ./fhevm-cli db-test --track-responses # Test with all DB URLs from config
49+ ./fhevm-cli db-test --duration 60s -t mixed # Run for 60s with mixed requests
50+ ./fhevm-cli db-test -b 100 --clear-db # Batch size 100, clear DB first
51+
52+ # Upgrade specific services
53+ ./fhevm-cli upgrade host
54+ ./fhevm-cli upgrade gateway
55+ ./fhevm-cli upgrade connector
4756./fhevm-cli upgrade coprocessor
57+ ./fhevm-cli upgrade relayer
58+ ./fhevm-cli upgrade test-suite
4859
49- # View logs
50- ./fhevm-cli logs relayer
60+ # View logs for any service
61+ ./fhevm-cli logs [SERVICE]
5162
52- # Clean up
63+ # Clean up all containers and volumes
5364./fhevm-cli clean
5465```
5566
67+ ### Database Connector Testing
68+
69+ The ` fhevm-cli db-test ` command provides database-level stress testing:
70+
71+ ``` sh
72+ # Implemented options:
73+ -n, --num-connectors NUM # Number of DB URLs to use from config
74+ -t, --type TYPE # Request type: public, user, or mixed
75+ -b, --batch-size SIZE # Requests per batch
76+ --duration TIME # Test duration (e.g., 30s, 5m, 1h)
77+ -i, --interval TIME # Batch interval (e.g., 1s, 500ms, 2s)
78+ -c, --config FILE # Path to custom config file
79+ --track-responses # Enable response tracking
80+ --clear-db # Clear DB tables before test
81+
82+ # Examples:
83+ ./fhevm-cli db-test --clear-db --track-responses # Clear DB, then test with tracking
84+ ./fhevm-cli db-test -n 2 -t mixed # Test 2 DBs with mixed requests
85+ ./fhevm-cli db-test --duration 60s -i 500ms # 60s test, 500ms intervals
86+ ./fhevm-cli db-test -c custom.toml -b 100 --clear-db # Custom config, clear DB, batch 100
87+
88+ # Default config: test-suite/gateway-stress/config/config.toml
89+ ```
90+
91+ ### Advanced Gateway Stress Testing
92+
93+ For more control, use the standalone ` gateway-stress ` tool directly (in ` test-suite/gateway-stress ` ):
94+
95+ 1 . ** Blockchain-based testing** - Sends actual transactions through the blockchain
96+ 2 . ** Database-level testing** - Directly inserts requests into PostgreSQL for focused DB testing
97+
98+ #### Blockchain-based Testing
99+ Sends decryption requests through the blockchain (requires deployed contracts):
100+
101+ ``` sh
102+ cd test-suite/gateway-stress
103+
104+ # Build the tool first
105+ cargo build --release
106+
107+ # Send public decryption transactions
108+ ./target/release/gateway-stress public
109+
110+ # Send user decryption transactions
111+ ./target/release/gateway-stress user
112+
113+ # Note: 'mixed' mode is not yet implemented
114+ ```
115+
116+ #### Database-level Testing
117+ Bypasses blockchain and directly inserts into PostgreSQL databases:
118+
119+ ``` sh
120+ cd test-suite/gateway-stress
121+
122+ # Build the tool
123+ cargo build --release
124+
125+ # Basic database test with default settings from config
126+ ./target/release/gateway-stress db-connector
127+
128+ # Override test duration and request type
129+ ./target/release/gateway-stress db-connector --duration 60s --request-type public
130+
131+ # Enable response tracking to verify sync across databases
132+ ./target/release/gateway-stress db-connector --track-responses --batch-size 1000
133+
134+ # Use custom configuration
135+ ./target/release/gateway-stress --config custom-config.toml db-connector
136+ ```
137+
138+ #### Prerequisites
139+ - Rust toolchain (for building gateway-stress)
140+ - For blockchain testing: Deployed FHEVM contracts and configured ct_handles
141+ - For database testing: Running PostgreSQL with credentials in ` config/config.toml `
142+
143+ #### DB Connector Options
144+ - ` --request-type <TYPE> ` - Request type: ` public ` , ` user ` , or ` mixed `
145+ - ` --duration <TIME> ` - Test duration (e.g., ` 30s ` , ` 5m ` , ` 1h ` )
146+ - ` --batch-size <NUM> ` - Requests per batch (for load control)
147+ - ` --track-responses ` - Monitor response processing and sync status
148+
149+ #### Configuration File
150+ The tool reads from a TOML configuration file (default: ` config/config.toml ` ):
151+ - Database connection strings
152+ - Batch intervals and sizes
153+ - Connection pool settings
154+ - Request generation parameters
155+
156+ See ` gateway-stress/README.md ` for detailed configuration examples.
157+
56158### WIP - Forcing Local Builds (` --build ` )
57159
58160⚠️ ** IMPORTANT: THIS FEATURE IS STILL A WORK IN PROGRESS!** ⚠️
0 commit comments