1+ # #######################################
2+ # ## pocketd relayminer relay Helpers ###
3+ # #######################################
4+
5+ .PHONY : pocketd_relayminer_relay_JSONRPC
6+ pocketd_relayminer_relay_JSONRPC : test_e2e_env # # Send a JSONRPC relay through relayminer to a local anvil (test ETH) node
7+ pocketd relayminer relay \
8+ --app=pokt1mrqt5f7qh8uxs27cjm9t7v9e74a9vvdnq5jva4 \
9+ --payload=' {"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []}' \
10+ --home=./localnet/pocketd \
11+ --network=local \
12+ --supplier-public-endpoint-override=http://localhost:8085
13+
14+
15+ .PHONY : pocketd_relayminer_relay_NDJSONRPC
16+ pocketd_relayminer_relay_NDJSONRPC : test_e2e_env # # Send a NDJSONRPC relay through relayminer to a local OpenAI compatible API served by Ollama
17+ pocketd relayminer relay \
18+ --app=pokt1pn64d94e6u5g8cllsnhgrl6t96ysnjw59j5gst \
19+ --payload=' {"messages":[{"role": "user", "content": "Count down from 10 to 0: ", "type": "text"}],"max_tokens":25, "model":"qwen:0.5b","stream":true}' \
20+ --home=./localnet/pocketd \
21+ --network=local \
22+ --supplier-public-endpoint-override=http://localhost:8085/v1/chat/completions
23+
24+
125# ####################
2- # ## Relay Helpers ###
26+ # ## Curl Helpers ###
327# ####################
428
529# TODO_MAINNET(@olshansk): Add all the permissionless/delegated/centralized variations once
@@ -23,18 +47,13 @@ send_relay_path_WEBSOCKET: check_path_up test_e2e_env ## Send a WEBSOCKET relay
2347 -H " App-Address: pokt1lqyu4v88vp8tzc86eaqr4lq8rwhssyn6rfwzex" \
2448 -H " Target-Service-Id: anvilws"
2549
26-
27- # TODO_POST_MAINNET(@red-0ne): Re-enable this once PATH Gateway supports REST.
28- # See https://github.com/buildwithgrove/path/issues/87
2950.PHONY : send_relay_path_REST
30- send_relay_path_REST : acc_initialize_pubkeys # # Send a REST relay through PATH to a local ollama (LLM) service
31- @echo " Not implemented yet. Check if PATH supports REST relays yet: https://github.com/buildwithgrove/path/issues/87"
32- # curl http://localhost:3070/v1/api/chat \
33- # -H "Authorization: test_api_key" \
34- # -H "Target-Service-Id: ollama" \
35- # -H "App-Address: pokt1mrqt5f7qh8uxs27cjm9t7v9e74a9vvdnq5jva4" \
36- # -d '{"model": "qwen:0.5b", "stream": false, "messages": [{"role": "user", "content":"count from 1 to 10"}]}'
37-
51+ send_relay_path_REST : check_path_up test_e2e_env # # Send a REST relay through PATH to a local ollama (LLM) service
52+ curl http://localhost:3069/v1/api/chat \
53+ -H " Authorization: test_api_key" \
54+ -H " Target-Service-Id: ollama" \
55+ -H " App-Address: pokt1pn64d94e6u5g8cllsnhgrl6t96ysnjw59j5gst" \
56+ -d ' {"model": "qwen:0.5b", "stream": false, "messages": [{"role": "user", "content":"count from 1 to 10"}]}'
3857
3958# #################################
4059# ### Relay Util Test Requests ####
@@ -49,48 +68,4 @@ test_relay_util_100: check_path_up check_relay_util ## Test anvil PATH behind G
4968 -H " App-Address: pokt1mrqt5f7qh8uxs27cjm9t7v9e74a9vvdnq5jva4" \
5069 -d ' {"jsonrpc":"2.0","method":"eth_blockNumber","id":1}' \
5170 -x 100 \
52- -b
53-
54- .PHONY : test_baseline_static_server_load
55- test_baseline_static_server_load : # # Establish baseline load test performance against static nginx chainid server (default: R=100000 T=16 C=5000 D=30s)
56- @echo " === Load Testing Options ==="
57- @echo " Parameters:"
58- @echo " R: Requests per second rate (default: 100,000)"
59- @echo " T: Number of threads (default: 16)"
60- @echo " C: Concurrent connections (default: 5,000)"
61- @echo " D: Test duration (default: 30s)"
62- @echo " "
63- @echo " Examples:"
64- @echo " make test_baseline_static_server_load # Default test"
65- @echo " make test_baseline_static_server_load R=10000 C=1000 # Light load"
66- @echo " make test_baseline_static_server_load R=5000 C=500 D=10s # Quick test"
67- @echo " make test_baseline_static_server_load R=200000 T=32 C=15000 D=45s # Maximum load"
68- @echo " "
69- @echo " Running test with: R=$( or $( R) ,100000) T=$( or $( T) ,16) C=$( or $( C) ,5000) D=$( or $( D) ,30s) "
70- @echo " =========================="
71- kubectl exec -it deployment/wrk2 -- wrk -R $(or $(R ) ,100000) -L -d $(or $(D ) ,30s) -t $(or $(T ) ,16) -c $(or $(C ) ,5000) http://nginx-chainid/
72-
73- .PHONY : test_relayminer_only_load
74- test_relayminer_only_load : # # Generate and run load test against RelayMiner using real RelayRequest data (default: R=512 t=16 c=256 d=300s)
75- @echo " === RelayRequest Load Testing ==="
76- @echo " This tool generates proper RelayRequest data and runs load tests against RelayMiner endpoints"
77- @echo " "
78- @echo " Parameters:"
79- @echo " R: Requests per second rate (default: 512)"
80- @echo " d: Test duration (default: 300s)"
81- @echo " t: Number of threads (default: 16)"
82- @echo " c: Concurrent connections (default: 256)"
83- @echo " "
84- @echo " Examples:"
85- @echo " make test_relayminer_only_load # Default test"
86- @echo " make test_relayminer_only_load R=1000 d=60s # Higher rate, shorter duration"
87- @echo " make test_relayminer_only_load R=100 t=4 c=50 d=30s # Light load test"
88- @echo " make test_relayminer_only_load R=2000 t=32 c=1000 # Heavy load test"
89- @echo " "
90- @echo " Running with: R=$( or $( R) ,512) d=$( or $( d) ,300s) t=$( or $( t) ,16) c=$( or $( c) ,256) "
91- @echo " ================================"
92- go run tools/scripts/wrk2_relays/main.go \
93- -R $(or $(R ) ,512) \
94- -d $(or $(d ) ,300s) \
95- -t $(or $(t ) ,16) \
96- -c $(or $(c ) ,256)
71+ -b
0 commit comments