Skip to main content

How to Set Up Your PATH Gateway and Save Big on RPC Costs

A hands-on guide to launching your own decentralized Gateway on Pocket Network’s Shannon Mainnet, for fun or profit!

In Summary

Running your own PATH is the most cost-effective and decentralized way to access Pocket Network’s RPC services. Compared to centralized gateway providers, you could save 30–70%. This guide gives you everything needed — step-by-step instructions, verified tools, real examples, and advanced tips—to go live today. 

Why This Matters: Rethinking RPC Infrastructure

Most developers interact with blockchains the way they interact with the internet—through APIs provided by companies they don’t control. Whether you’re deploying a dApp on Ethereum, querying DeFi data, odds are your data comes through a centralized gateway.

If you’ve ever used services like Infura, Alchemy, or even through Grove Portal (powered by Pocket Network) to access blockchain data, you’re likely familiar with the centralized relay problem:

  • You’re paying per request
  • You have little control over uptime or reliability
  • You don’t benefit from the economic upside

Now imagine flipping that model: you spin up your own Gateway, stake your own app, and route traffic yourself, cutting out middlemen, lowering costs, and with the possibility of volume-based rebates for relays you serve.

That’s the power of PATH — Pocket’s open-source “Path API & Toolkit Harness” — built to run decentralized Gateways in the Shannon upgrade. It’s a new approach to infrastructure ownership — a self-hosted gateway that gives you full control over how you access blockchain data.

What Is PATH?

Imagine if, instead of renting access to Ethereum or Polygon via centralized RPC services, you could spin up your secure endpoint in an hour. One where you control your stack, connect to a decentralized network of node operators, and even have the opportunity to receive rebates once a specified call volume threshold is reached via your gateway.

That’s precisely what PATH lets you do.

PATH, short for Path API & Toolkit Harness, is the open-source framework built by Grove to power Gateways on Pocket Network’s Shannon upgrade. In Pocket Network, a Gateway is the relay layer—the entry point where applications send requests to blockchain nodes or other data services. 

PATH gives anyone the tools to deploy and run decentralized data services, whether you’re relaying blockchain transactions, hosting inference models, or building APIs for new networks. It abstracts away the complexities of staking, relay mining, traffic routing, and proof submission into a developer-friendly CLI and orchestration layer.

Before PATH, launching a Gateway required deep technical knowledge and custom tooling. Grove—the team behind Pocket’s largest Gateway, Grove Portal—has open-sourced its entire internal stack to democratize that process.

“We open-sourced PATH so others can run high-quality Gateways with the same tools we use internally. It’s infrastructure that stays decentralized.”


Michael O’Rourke, Co-founder, Pocket Network.

PATH’s Framework. Source: Grove

How PATH Handles the Heavy Lifting

Instead of configuring your own Gateway from scratch, PATH gives you a developer-friendly, modular system that:

  1. Deploys a full Gateway stack across local or cloud environments
  2. Connects to the Shannon network with built-in support for app staking
  3. Manages real-time relay processing with retry logic and metrics tracking
  4. Uses the same SLA-grade tooling that Grove relies on to serve millions of relays
  5. Proxies traffic to your backend services and automatically submits cryptographic proofs to Pocket Network

What You Can Do with PATH

Once deployed, PATH doesn’t just sit there — it becomes part of your workflow. Whether you’re building an AI inference API, a custom RPC endpoint, or offering a community Gateway for your DAO, PATH is flexible enough to adapt.

With PATH, you can:

  1. Serve relays from Pocket-connected apps with zero manual wiring
  2. Stake and route traffic across multiple backend services
  3. Monitor, throttle, or tune routing behavior in real time
  4. Scale from local testing to full production with Helm or K8s

Why Run Your Own Gateway Instead of Using a Hosted One?

Let’s be honest. There’s a convenience factor in using hosted gateways. Services like Grove’s Portal or centralized RPC providers remove much of the infrastructure overhead. But that convenience comes at a cost, and not just financial.

Running your own Gateway with PATH offers the following key advantages:

1. Cost Control

Instead of the $2.50–$20 per million relays that managed RPC gateways typically charge, running your own PATH Gateway means you pay only the on-chain burn rate—$0.50–$6.19 per million relays, depending on the chain ($2.49 on average), plus a modest VPS fee (around $80/month). That alignment between actual usage and spend can translate into up to 80% savings on your RPC bill.

2. Sovereignty
Self-hosting means you’re no longer at the mercy of someone else’s SLAs, routing policies, or pricing decisions. You choose your backends, enforce your quality thresholds, and decide how your Gateway behaves.

3. Token Incentives
Unlike traditional cloud APIs, Pocket Network rewards users for their participation. Network participants like open data providers earn POKT, creating a demand-side incentive to Pocket Network node operators. You’re not just using infrastructure; you’re part of the network powering it.


How PATH Saves You Money

With Shannon, every network call on Pocket burns a fixed number of “Compute Units” (CUs) that you can see on-chain—there’s no guessing which RPC method costs more. For example, Ethereum relays use 1,579 CUs, Polygon uses 1,118 CUs, and Solana uses 5,033 CUs. Since each CU is worth $1 × 10⁻⁹ USD, those translate to $1.58, $1.12, and $5.03 per million relays, respectively. These rates remain the same regardless of which endpoint you reach on the respective chain.

Unlike other providers, which charge extra credits for heavier calls or bundle multiple chains under opaque tiers, PATH’s fee is a simple, chain-specific per-million-relay rate that undercuts even the cheapest managed gateways.

Transparent, Chain-Specific Pricing

When you operate your own PATH Gateway, you avoid all subscription bundles, hidden multipliers, and third-party mark-ups. You pay precisely the published CU burn rate for each chain, and once you surpass the high-volume threshold (for example, 100 million relays in a day), you become eligible for up to a 40 percent rebate on the burn fees you’ve paid.

In practice, that means PATH gives you direct, sovereign access to Pocket Network’s protocol-level economics—chain-specific pricing, predictable costs, and meaningful volume discounts—while undercutting every managed gateway on the market.

ChainPATH CUs/RelayPATH Price ($/M)Cheapest Competitor ($/M)
Ethereum1 579$1.58$2.50
Solana5 033$5.03
Polygon1 118$1.12$2.50
Arbitrum One2 733$2.73$2.50
Fantom2 501$2.50$2.50
Average2 592.8$2.59$2.50

The Full per-chain CU schedule on Shannon can be found in the Shannon Economics Parameters post in the forum.

With PATH, you operate the Gateway yourself:

  • You pay no markup
  • You keep 100% of your protocol-level Gateway rewards
  • No hidden multipliers—all calls on a given chain cost the same CU amount.
  • You aren’t locked into any rate plans or API limitations.

Direct Access to Protocol-Level Rebates

PATH Gateways don’t earn newly minted tokens, but they do unlock a volume-based rebate on their own burn fees. Once you exceed 100 million relays in a single day, you begin to recoup a percentage of your spend, up to 40 percent at peak volume. In practice, that means your net cost per million relays can fall by as much as 40 percent, directly reducing your infrastructure bill with every request you route.

Pocket Network’s Shannon economics specify that your rebate rate scales with daily traffic (measured in Compute Units, or CUs):

  • 0 % rebate for throughput below 250 B CUs/day (≈ 105 M relays/day)
  • 10 % rebate once you hit 250 B CUs/day
  • 40 % rebate at 1,250 B CUs/day (≈ 525 M relays/day)
  • Linear interpolation between 10 % and 40 % for volumes in between

Below is an apples-to-apples comparison of major providers on a per-million-relays basis, showing both sticker price and net price after the maximum rebate:

ProviderPrice per 1 M RelaysRebate Model (Protocol-Level)Net Price at Max Rebate ($/1 M)
Infura / Alchemy$0.45 – $3.64None$0.45 – $3.64
Managed Gateways$0.55 – $20None$0.55 – $20
PATH (Self-Hosted)$0.43 – $1.930% → 40% (linear scale)$0.26 – $1.16

Step-by-Step Setup Guide: Launching Your PATH Gateway

⚠️ Note: This guide is for setting up a PATH Gateway on the Pocket Network Shannon TestNet. All configurations, commands, and funding steps are specific to TestNet environments and use faucet-provided tokens.

Prerequisites

Before you begin, ensure you have the following tools installed:

  • Helm: Kubernetes package manager.
  • Tilt: Local Kubernetes development tool.
  • Kind: Tool for creating and running local Kubernetes clusters using Docker.
  • Kubectl: For managing and interacting with Kubernetes clusters.
  • pocketd CLI: Command-line interface for interacting with the Pocket Network. (from Pocket GitHub)

If that feels like a lot, don’t worry — you’ll see how it all fits together shortly. For more detailed and customized installation instructions, refer to the PATH Developer Guide.

Step 1: Open Your Terminal and Clone the PATH Stack

After installing the required tools, the first thing you’ll do is open your terminal. This is where all the commands in this guide will be entered. You’ll also edit .yaml files in a text editor.

If you’re on:

  • macOS: Use the Terminal app (press Cmd + Space, then type “Terminal”)
  • Linux: Use your system terminal (e.g., GNOME Terminal)
  • Cloud VM: SSH into your remote machine using your terminal ssh user@your‑vm-ip or a tool like PuTTY

a. Choose your workspace: eg;

bash

cd ~/projects

b. Clone and enter the repo

Once you’re in your terminal and you’re in your working directory, clone the PATH repository: 

git clone https://github.com/buildwithgrove/path.git

cd path

This gives you the full source code Grove uses to run its own Gateway, including configuration templates, Helm charts, and a local development environment powered by Tilt.

Step 2. Generate Gateway & Application Keys

In the same terminal, you’ll be acting as both a Gateway operator (relaying traffic) and an Application staker (creating demand). You’ll need to generate keys for both roles.

a. Create keys:

pocketd keys add gateway
pocketd keys add application

You’ll now have two wallet addresses. Follow the prompts to set a passphrase.

b. Confirm both keys exist:

bash

pocketd keys list

Save the addresses (you’ll need them in the next step).

c. Fund your keys:

Step 3: Stake and Register Your Services

Make sure you’re still in your terminal and inside the path/ directory with access to the pocketd CLI. You’ll be using it to stake your Gateway and Application accounts on the Shannon TestNet.

Prepare Your Staking Config Files

After creating your keys, you need to create two YAML files—one for your Gateway and one for your Application—so the staking commands know which address, public key, and chain ID to register on-chain.

a. Extract Key Details

pocketd keys show gateway        # Copy the “address” and “public_key” fields pocketd keys show application    # Copy the “address” and “public_key” fields

b. Create the Gateway Stake Config In your path/ folder, open a text editor (e.g., nano, vi, or VS Code) and create a file named stake_gateway_config.yaml:

bash

nano stake_gateway_config.yaml

Paste the following (replacing placeholders with your values) in the file you opened above:

address: pokt1YOUR_GATEWAY_ADDRESS
chains:  - "0011"                # Shannon TestNet chain ID
public_key: YOUR_GATEWAY_PUBLIC_KEY_HEX
output_address: pokt1YOUR_GATEWAY_ADDRESS

Save and exit the editor (e.g., Ctrl+O, Enter, Ctrl+X in nano). For more details on config.yaml on PATH, refer to Grove’s PATH documentation. 

c. Create the Application Stake Config Similarly, open a new file named stake_app_config.yaml:

bash

nano stake_gateway_config.yaml

Paste:

xaddress: pokt1YOUR_APP_ADDRESS
chains:  - "0011"
public_key: YOUR_APP_PUBLIC_KEY_HEX
output_address: pokt1YOUR_APP_ADDRESS

Save and exit.

d. Run the Staking Commands Stake your Gateway and Application using the config files you just created:

pocketd tx gateway stake-gateway --config=./stake_gateway_config.yaml
pocketd tx application stake-application --config=./stake_app_config.yaml

e. Delegate the Application to your Gateway

bash

pocketd tx application delegate-to-gateway $(pocketd keys show -a gateway)

Tip: You can also replace $(pocketd keys show -a gateway) with your actual Gateway address if you prefer.

f. Verify

bash

pocketd query application show-application $(pocketd keys show -a application)

If everything’s in place, your Gateway and Application should now be registered and active on-chain.

Step 4: Configure PATH to Use Your Credentials

In the same terminal, while inside the path/ directory, run the command below to auto-generate your Gateway config file:

make shannon_populate_config

This will generate path/.config.yaml with pre-filled Shannon TestNet values.

Here’s an example snippet:

gateway_config:
  gateway_address: pokt1youraddress...
  gateway_private_key_hex: 0xyourkey...
  owned_apps_private_keys_hex:
    - 0xappkey...

Open the file and confirm your Gateway and App private keys are correct.

Step 5: Fire Up the PATH Stack (Locally)

Still in your terminal and inside the path/ folder, run the following command to launch a local Kubernetes cluster using Tilt:

make path_up

This launches the full Gateway stack in a local Kind cluster:

  • path (handles relays)
  • guard (verifies requests)
  • watch (logs and metrics)

Once everything is up, visit Tilt at:
👉 http://localhost:10350

You’re almost there.

Step 6: Send Your First Request

Let’s test the setup with a sample RPC call. In your terminal, paste the following:

curl http://localhost:3070/v1 \
  -H "Target-Service-Id: anvil" \
  -H "Authorization: test_api_key" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber"}'

If you receive a hex number (e.g. 0x5a3d23), congrats — your Gateway handled a successful relay.

Optional: Move to Production with Helm

These commands assume you’re working in a terminal connected to your cloud VM or production cluster where Helm is installed and properly configured.

Add Grove’s Helm repo:

helm repo add grove https://charts.grove.city
helm repo update

Customize your values.yaml:

Configure:

  • Your private keys — so your production Gateway can sign relay proofs and access your staked accounts.
  • Backend endpoints — point to the blockchain nodes or services you want your Gateway to serve.
  • Resource limits & replicas — size your pods for the right balance of performance and cost.
  • Environment variables — tweak logging levels, QoS settings, and feature flags without rebuilding your image.

Here’s a quick snippet to show how you’d customize those fields in your values.yaml. Just open the file in your editor and replace the placeholders:

gateway:
  # Your Gateway private key (hex-encoded)
  privateKey: "0xYOUR_GATEWAY_PRIVATE_KEY"

  # Number of Gateway replicas to run
  replicas: 2

  # Resource sizing for each Gateway pod
  resources:
    limits:
      cpu: "500m"
      memory: "1Gi"
    requests:
      cpu: "250m"
      memory: "512Mi"

backend:
  # Your own RPC endpoint(s)
  rpcUrl: "https://your-node.example.com"

env:
  # Environment variables for tuning
  LOG_LEVEL: "info"
  RETRY_MAX: "5"
  QOS_ENABLED: "true"
  1. Set privateKey to the same hex key you used locally.
  2. Adjust replicas and resources based on your expected load and VM size.
  3. Point backend.rpcUrl at your own node or service.
  4. Use env entries to toggle logging, retries, or other feature flags.

Deploy with Helm:

helm upgrade --install path-stack grove/path \  --namespace pokt \  --create-namespace \  -f path-values.yaml

Once deployed, your Gateway will be reachable over the internet and ready to serve real traffic (on TestNet by default).

Observability & QoS

PATH comes with everything you need to monitor and tune your Gateway—no extra installs required. Just point your tools at the endpoint of your choice. Here’s how to “activate” and access each piece:

  1. Prometheus Metrics: The /metrics endpoint is exposed on port 9090 by default.

To scrape it locally, run then add http://localhost:9090/metrics to your Prometheus targets.

bash
kubectl port-forward svc/path 9090:9090 -n pokt
  1. JSON‑Formatted Logs: All services (path, guard, watch) log structured JSON to stdout.

Tail them with the following code and ship to Loki, ELK, or any log collector.

bash
kubectl -n pokt logs -l app=path --follow
  1. Tilt UI (Local Dev Only): If you launched with make path_up, browse to
    http://localhost:10350. View live logs, pod status, and resource usage—then restart or rebuild with a click.

Key Metrics to Watch

  • Relay throughput (relay_count_total)
  • Success vs. failure rates (relay_success_total / relay_failure_total)
  • Latency histograms (relay_duration_seconds_bucket)
    Pod health & restarts

With these endpoints, you can drop PATH into Grafana, Datadog, New Relic, or your favorite observability stack—giving you end‑to‑end visibility without extra instrumentation.

Common Issues + Fixes

Common IssueFix
Gateway not appearingDouble‑check that your Gateway stake transaction has finalized on‑chain.
Tilt not loadingIncrease Docker’s memory allocation to at least 4 GB and restart Tilt.
No relaysEnsure your Application is both staked and delegated to your Gateway on Shannon TestNet.
Configuration not foundFrom within the path/ directory, run make shannon_populate_config to generate path/.config.yaml.
Can’t connect to blockchainEnsure correct SUPPORTED_CHAINS syntax
Port already in useChange GATEWAY_PORT in .env

Tips to Maximize Your PATH Setup

  • Use a reverse proxy: Clean URLs and better security
  • Add monitoring early: Catch issues before they impact users
  • Keep your Docker images updated: Run docker-compose pull && docker-compose up -d
  • Consider geo-distributed deployment: For global latency reduction
  • Use autoscaling (Kubernetes) if you’re scaling beyond single server

Refer to the PATH Developer Guide for detailed instructions on utilizing these tools.

Final Thoughts: From Consumer to Contributor

Most people consume infrastructure — they rent access to public goods owned by someone else. What PATH offers is the opportunity to contribute infrastructure, to participate in a decentralized economy that pays you to host value.

You save money. You earn tokens. You control your stack.

No middlemen. No markups. No monthly surprises.

Just open data, open infra — and now, open to you.

Now it’s your turn to put PATH to work. Spin up that Gateway, point your applications to it, and watch as your infrastructure comes alive. Tweak the settings, experiment with different backends, and share what you build with the community—because every new Gateway makes Pocket Network stronger, fairer, and more resilient.