Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,31 @@ PNF_ADDRESS = pokt1eeeksh2tvkh7wzmfrljnhw4wrhs55lcuvmekkw

MODULES := application gateway pocket service session supplier proof tokenomics

# Patterns for classified help categories
HELP_PATTERNS := \
'^(help|help-params|help-unclassified|list):' \
'^(ignite_build|ignite_pocketd_build|ignite_serve|ignite_serve_reset|ignite_release.*|cosmovisor_start_node):' \
'^(go_develop|go_develop_and_test|proto_regen|go_mockgen|go_testgen_fixtures|go_testgen_accounts|go_imports):' \
'^(test_all|test_unit|test_e2e|test_integration|test_timing|test_govupgrade|test_e2e_relay|go_test_verbose|go_test):' \
'^(go_lint|go_vet|go_sec|gosec_version_fix|check_todos):' \
'^(localnet_up|localnet_up_quick|localnet_down|localnet_regenesis|localnet_cancel_upgrade|localnet_show_upgrade_plan):' \
'^testnet_.*:' \
'^(acc_.*|pocketd_addr|pocketd_key):' \
'^query_.*:' \
'^app_.*:' \
'^supplier_.*:' \
'^gateway_.*:' \
'^(relay_.*|claim_.*|ping_.*):' \
'^session_.*:' \
'^ibc_.*:' \
'^release_.*:' \
'^docker_test_.*:' \
'^(go_docs|docusaurus_.*|gen_.*_docs):' \
'^(install_.*|check_.*|grove_.*|act_.*|trigger_ci|docker_wipe):' \
'^telegram_.*:' \
'^claudesync_.*:' \
'^params_.*:'

BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
COMMIT := $(shell git log -1 --format='%H')

Expand Down Expand Up @@ -439,3 +464,53 @@ include ./makefiles/ignite.mk
include ./makefiles/release.mk
include ./makefiles/tools.mk
include ./makefiles/ibc.mk

###############################
### Global Error Handling ###
###############################

# Catch-all rule for undefined targets
# This must be defined AFTER includes so color variables are available
# and it acts as a fallback for any undefined target
%:
@echo ""
@echo "$(RED)❌ Error: Unknown target '$(BOLD)$@$(RESET)$(RED)'$(RESET)"
@echo ""
@if echo "$@" | grep -q "^localnet"; then \
echo "$(YELLOW)💡 Hint: LocalNet targets available:$(RESET)"; \
echo " Run: $(CYAN)make help$(RESET) and check the '🌐 LocalNet Operations' section"; \
elif echo "$@" | grep -q "^testnet"; then \
echo "$(YELLOW)💡 Hint: TestNet targets available:$(RESET)"; \
echo " Run: $(CYAN)make help$(RESET) and check the '🔗 TestNet Operations' section"; \
elif echo "$@" | grep -q "^app"; then \
echo "$(YELLOW)💡 Hint: Application targets available:$(RESET)"; \
echo " Run: $(CYAN)make help$(RESET) and check the '🛡️ Applications' section"; \
elif echo "$@" | grep -q "^supplier"; then \
echo "$(YELLOW)💡 Hint: Supplier targets available:$(RESET)"; \
echo " Run: $(CYAN)make help$(RESET) and check the '🏭 Suppliers' section"; \
elif echo "$@" | grep -q "^gateway"; then \
echo "$(YELLOW)💡 Hint: Gateway targets available:$(RESET)"; \
echo " Run: $(CYAN)make help$(RESET) and check the '🌉 Gateways' section"; \
elif echo "$@" | grep -q "^test"; then \
echo "$(YELLOW)💡 Hint: Testing targets available:$(RESET)"; \
echo " Run: $(CYAN)make help$(RESET) and check the '🧪 Testing' section"; \
elif echo "$@" | grep -q "^params"; then \
echo "$(YELLOW)💡 Hint: Parameter management targets available:$(RESET)"; \
echo " Run: $(CYAN)make help-params$(RESET) to see all parameter commands"; \
elif echo "$@" | grep -q "^ignite"; then \
echo "$(YELLOW)💡 Hint: Ignite/build targets available:$(RESET)"; \
echo " Run: $(CYAN)make help$(RESET) and check the '🔨 Build & Run' section"; \
elif echo "$@" | grep -q "^go_"; then \
echo "$(YELLOW)💡 Hint: Go development targets available:$(RESET)"; \
echo " Run: $(CYAN)make help$(RESET) and check the '⚙️ Development' or '✅ Linting & Quality' sections"; \
elif echo "$@" | grep -q "^docker"; then \
echo "$(YELLOW)💡 Hint: Docker targets available:$(RESET)"; \
echo " Run: $(CYAN)make help$(RESET) and check the '🐳 Docker Testing' section"; \
else \
echo "$(YELLOW)💡 Available help commands:$(RESET)"; \
echo " $(CYAN)make help$(RESET) - See all available targets"; \
echo " $(CYAN)make help-params$(RESET) - See parameter management commands"; \
echo " $(CYAN)make help-unclassified$(RESET) - See uncategorized targets"; \
fi
@echo ""
@exit 1
51 changes: 31 additions & 20 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -263,44 +263,41 @@ genesis:
service_configs:
- service_id: anvil
stake:
# NB: This value should be exactly 1upokt smaller than the value in
# `application1_stake_config.yaml` so that the stake command causes a state change.
# DEV_NOTE: Value should be exactly 1upokt smaller than `application1_stake_config.yaml` so that the stake command causes a state change.
amount: "100000068" # ~100 POKT
denom: upokt
- address: pokt184zvylazwu4queyzpl0gyz9yf5yxm2kdhh9hpm
- address: pokt1lqyu4v88vp8tzc86eaqr4lq8rwhssyn6rfwzex
delegatee_gateway_addresses:
[pokt15vzxjqklzjtlz7lahe8z2dfe9nm5vxwwmscne4]
service_configs:
- service_id: rest
- service_id: anvilws
stake:
# NB: This value should be exactly 1upokt smaller than the value in
# `application1_stake_config.yaml` so that the stake command causes a state change.
amount: "100000068" # ~100 POKT
denom: upokt
- address: pokt1lqyu4v88vp8tzc86eaqr4lq8rwhssyn6rfwzex
- address: pokt184zvylazwu4queyzpl0gyz9yf5yxm2kdhh9hpm
delegatee_gateway_addresses:
[pokt15vzxjqklzjtlz7lahe8z2dfe9nm5vxwwmscne4]
service_configs:
- service_id: anvilws
- service_id: rest
stake:
# DEV_NOTE: Value should be exactly 1upokt smaller than `application1_stake_config.yaml` so that the stake command causes a state change.
amount: "100000068" # ~100 POKT
denom: upokt
- address: pokt1pn64d94e6u5g8cllsnhgrl6t96ysnjw59j5gst
delegatee_gateway_addresses:
[pokt15vzxjqklzjtlz7lahe8z2dfe9nm5vxwwmscne4]
service_configs:
- service_id: static
- service_id: ollama
stake:
amount: "10000000000000"
# DEV_NOTE: Value should be exactly 1upokt smaller than `application1_stake_config.yaml` so that the stake command causes a state change.
amount: "100000068" # ~100 POKT
denom: upokt
# For ref, see proto/poktroll/supplier/params.proto
supplier:
params:
# TODO_MAINNET_MIGRATION(@olshansk): Determine realistic amount for minimum gateway stake amount.
min_stake:
amount: "1000000" # 1 POKT
denom: upokt
# TODO_MAINNET_MIGRATION(@olshansk): Determine realistic amount for supplier staking fee.
staking_fee:
amount: "1000000" # 1 POKT
denom: upokt
Expand All @@ -324,6 +321,22 @@ genesis:
rev_share:
- address: pokt19a3t4yunp0dlpfjrp7qwnzwlrzd5fzs2gjaaaj
rev_share_percentage: 100
- service_id: rest
endpoints:
- configs: []
rpc_type: REST
url: http://relayminer1:8545
rev_share:
- address: pokt19a3t4yunp0dlpfjrp7qwnzwlrzd5fzs2gjaaaj
rev_share_percentage: 100
- service_id: ollama
endpoints:
- configs: []
rpc_type: REST
url: http://relayminer1:8545
rev_share:
- address: pokt19a3t4yunp0dlpfjrp7qwnzwlrzd5fzs2gjaaaj
rev_share_percentage: 100
- service_id: static
endpoints:
- configs: []
Expand All @@ -333,22 +346,20 @@ genesis:
- address: pokt19a3t4yunp0dlpfjrp7qwnzwlrzd5fzs2gjaaaj
rev_share_percentage: 100
stake:
# NB: This value should be exactly 1upokt smaller than the value in
# DEV_NOTE: Value should be exactly 1upokt smaller than the value in
# `supplier1_stake_config.yaml` so that the stake command causes a state change.
amount: "1000068"
denom: upokt
# For ref, see proto/poktroll/gateway/params.proto
gateway:
params:
# TODO_MAINNET_MIGRATION(@olshansk): Determine realistic amount for minimum gateway stake amount.
min_stake:
amount: "1000000" # 1 POKT
denom: upokt
gatewayList:
- address: pokt15vzxjqklzjtlz7lahe8z2dfe9nm5vxwwmscne4
stake:
# NB: This value should be exactly 1upokt smaller than the value in
# `gateway1_stake_config.yaml` so that the stake command causes a state change.
# DEV_NOTE: Value should be exactly 1upokt smaller than the value in `gateway1_stake_config.yaml` so that the stake command causes a state change.
amount: "1000068"
denom: upokt
# For ref, see proto/poktroll/service/params.proto
Expand All @@ -367,14 +378,14 @@ genesis:
name: "anvilws"
compute_units_per_relay: 100
owner_address: pokt1cwnu460557x0z78jv3hhc7356hhkrgc86c87q5
- id: ollama
name: "ollama"
compute_units_per_relay: 100
owner_address: pokt1mx0klkkrj6v3dw8gs4nzlq0cq8lsktmx35t03e
- id: rest
name: "rest"
compute_units_per_relay: 100
owner_address: pokt1mx0klkkrj6v3dw8gs4nzlq0cq8lsktmx35t03e
- id: ollama
name: "ollama"
compute_units_per_relay: 100
owner_address: pokt1pn64d94e6u5g8cllsnhgrl6t96ysnjw59j5gst
- id: static
name: "static"
compute_units_per_relay: 1
Expand Down
3 changes: 3 additions & 0 deletions localnet/kubernetes/config-path-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ shannon_config:
gateway_private_key_hex: cf09805c952fa999e9a63a9f434147b0a5abfd10f268879694c6b5a70e1ae177
owned_apps_private_keys_hex:
- 2d00ef074d9b51e46886dc9a1df11e7b986611d0f336bdcf1f0adce3e037ec0a # anvil - app1 - pokt1mrqt5f7qh8uxs27cjm9t7v9e74a9vvdnq5jva4
- 7cbbaa043b9b63baa7d6bb087483b0a6a9f82596c19dce4c5028eb43e5b63674 # anvilws - app3 - pokt1lqyu4v88vp8tzc86eaqr4lq8rwhssyn6rfwzex
- 7e7571a8c61b0887ff8a9017bb4ad83c016b193234f9dc8b6a8ce10c7c483600 # rest - app2 - pokt184zvylazwu4queyzpl0gyz9yf5yxm2kdhh9hpm
- 84e4f2257f24d9e1517d414b834bbbfa317e0d53fef21c1528a07a5fa8c70d57 # ollama - app4 - pokt1pn64d94e6u5g8cllsnhgrl6t96ysnjw59j5gst
14 changes: 9 additions & 5 deletions localnet/kubernetes/values-pocketd-faucet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ nameOverride: ""
fullnameOverride: ""

flags:
log_level: debug
log-level: debug
network: local
node: tcp://validator-pocket-validator:26657
keyring_backend: test
Expand All @@ -40,10 +40,12 @@ serviceAccount:

podAnnotations: {}

podSecurityContext: {}
podSecurityContext:
{}
# fsGroup: 2000

securityContext: {}
securityContext:
{}
# capabilities:
# drop:
# - ALL
Expand All @@ -58,7 +60,8 @@ service:
ingress:
enabled: false
className: ""
annotations: {}
annotations:
{}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
Expand All @@ -71,7 +74,8 @@ ingress:
# hosts:
# - chart-example.local

resources: {}
resources:
{}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
Expand Down
7 changes: 7 additions & 0 deletions makefiles/ignite.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ RELEASE_TARGETS_NOCGO := $(LINUX_TARGETS) $(DARWIN_TARGETS)
CC_LINUX_AMD64 ?= x86_64-linux-gnu-gcc
CC_LINUX_ARM64 ?= aarch64-linux-gnu-gcc

# Docker Tag
DOCKER_TAG ?= ghcr.io/pokt-network/pocketd:rc

##########################
### Ignite Build Tasks ###
##########################
Expand Down Expand Up @@ -144,6 +147,10 @@ ignite_release_extract_binaries: ## Extract all archives to release_binaries/<ar
rm -rf "$$tmp"; \
done

.PHONY: docker_build_cgo_disabled
docker_build_cgo_disabled: ignite_pocketd_build ignite_release ignite_release_extract_binaries
docker build -f Dockerfile.release -t $(DOCKER_TAG) .

#################################
### Ignite Version Management ###
#################################
Expand Down
89 changes: 32 additions & 57 deletions makefiles/relay.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
########################################
### pocketd relayminer relay Helpers ###
########################################

.PHONY: pocketd_relayminer_relay_JSONRPC
pocketd_relayminer_relay_JSONRPC: test_e2e_env ## Send a JSONRPC relay through relayminer to a local anvil (test ETH) node
pocketd relayminer relay \
--app=pokt1mrqt5f7qh8uxs27cjm9t7v9e74a9vvdnq5jva4 \
--payload='{"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []}' \
--home=./localnet/pocketd \
--network=local \
--supplier-public-endpoint-override=http://localhost:8085


.PHONY: pocketd_relayminer_relay_NDJSONRPC
pocketd_relayminer_relay_NDJSONRPC: test_e2e_env ## Send a NDJSONRPC relay through relayminer to a local OpenAI compatible API served by Ollama
pocketd relayminer relay \
--app=pokt1pn64d94e6u5g8cllsnhgrl6t96ysnjw59j5gst \
--payload='{"messages":[{"role": "user", "content": "Count down from 10 to 0: ", "type": "text"}],"max_tokens":25, "model":"qwen:0.5b","stream":true}' \
--home=./localnet/pocketd \
--network=local \
--supplier-public-endpoint-override=http://localhost:8085/v1/chat/completions


#####################
### Relay Helpers ###
### Curl Helpers ###
#####################

# TODO_MAINNET(@olshansk): Add all the permissionless/delegated/centralized variations once
Expand All @@ -23,18 +47,13 @@ send_relay_path_WEBSOCKET: check_path_up test_e2e_env ## Send a WEBSOCKET relay
-H "App-Address: pokt1lqyu4v88vp8tzc86eaqr4lq8rwhssyn6rfwzex" \
-H "Target-Service-Id: anvilws"


# TODO_POST_MAINNET(@red-0ne): Re-enable this once PATH Gateway supports REST.
# See https://github.com/buildwithgrove/path/issues/87
.PHONY: send_relay_path_REST
send_relay_path_REST: acc_initialize_pubkeys ## Send a REST relay through PATH to a local ollama (LLM) service
@echo "Not implemented yet. Check if PATH supports REST relays yet: https://github.com/buildwithgrove/path/issues/87"
# curl http://localhost:3070/v1/api/chat \
# -H "Authorization: test_api_key" \
# -H "Target-Service-Id: ollama" \
# -H "App-Address: pokt1mrqt5f7qh8uxs27cjm9t7v9e74a9vvdnq5jva4" \
# -d '{"model": "qwen:0.5b", "stream": false, "messages": [{"role": "user", "content":"count from 1 to 10"}]}'

send_relay_path_REST: check_path_up test_e2e_env ## Send a REST relay through PATH to a local ollama (LLM) service
curl http://localhost:3069/v1/api/chat \
-H "Authorization: test_api_key" \
-H "Target-Service-Id: ollama" \
-H "App-Address: pokt1pn64d94e6u5g8cllsnhgrl6t96ysnjw59j5gst" \
-d '{"model": "qwen:0.5b", "stream": false, "messages": [{"role": "user", "content":"count from 1 to 10"}]}'

##################################
#### Relay Util Test Requests ####
Expand All @@ -49,48 +68,4 @@ test_relay_util_100: check_path_up check_relay_util ## Test anvil PATH behind G
-H "App-Address: pokt1mrqt5f7qh8uxs27cjm9t7v9e74a9vvdnq5jva4" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","id":1}' \
-x 100 \
-b

.PHONY: test_baseline_static_server_load
test_baseline_static_server_load: ## Establish baseline load test performance against static nginx chainid server (default: R=100000 T=16 C=5000 D=30s)
@echo "=== Load Testing Options ==="
@echo "Parameters:"
@echo " R: Requests per second rate (default: 100,000)"
@echo " T: Number of threads (default: 16)"
@echo " C: Concurrent connections (default: 5,000)"
@echo " D: Test duration (default: 30s)"
@echo ""
@echo "Examples:"
@echo " make test_baseline_static_server_load # Default test"
@echo " make test_baseline_static_server_load R=10000 C=1000 # Light load"
@echo " make test_baseline_static_server_load R=5000 C=500 D=10s # Quick test"
@echo " make test_baseline_static_server_load R=200000 T=32 C=15000 D=45s # Maximum load"
@echo ""
@echo "Running test with: R=$(or $(R),100000) T=$(or $(T),16) C=$(or $(C),5000) D=$(or $(D),30s)"
@echo "=========================="
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/

.PHONY: test_relayminer_only_load
test_relayminer_only_load: ## Generate and run load test against RelayMiner using real RelayRequest data (default: R=512 t=16 c=256 d=300s)
@echo "=== RelayRequest Load Testing ==="
@echo "This tool generates proper RelayRequest data and runs load tests against RelayMiner endpoints"
@echo ""
@echo "Parameters:"
@echo " R: Requests per second rate (default: 512)"
@echo " d: Test duration (default: 300s)"
@echo " t: Number of threads (default: 16)"
@echo " c: Concurrent connections (default: 256)"
@echo ""
@echo "Examples:"
@echo " make test_relayminer_only_load # Default test"
@echo " make test_relayminer_only_load R=1000 d=60s # Higher rate, shorter duration"
@echo " make test_relayminer_only_load R=100 t=4 c=50 d=30s # Light load test"
@echo " make test_relayminer_only_load R=2000 t=32 c=1000 # Heavy load test"
@echo ""
@echo "Running with: R=$(or $(R),512) d=$(or $(d),300s) t=$(or $(t),16) c=$(or $(c),256)"
@echo "================================"
go run tools/scripts/wrk2_relays/main.go \
-R $(or $(R),512) \
-d $(or $(d),300s) \
-t $(or $(t),16) \
-c $(or $(c),256)
-b
Loading
Loading