LocalNet
LocalNet
This document walks you through launching a LocalNet that brings up a k8s cluster with a Data Availability network, a validator, Pocket actors and everything else needed to send an end-to-end relay.
Run Pocket Network locally
Report issues
If you encounter any problems, please create a new GitHub Issue here.
TL;DR
Run:
make localnet_upto start the network.
When prompted, press space to see the web UI with logs and current status of the network. Alternatively, open:
http://localhost:10350/
Developing with LocalNet
localnet_config.yaml
Once LocalNet is started, a new file localnet_config.yaml is generated in the root directory of the repository. This file contains the configuration of the network. It looks like this:
helm_chart_local_repo:
enabled: false
path: ../helm-charts
relayers:
count: 1Scaling network actors
To scale the number of actors, edit the localnet_config.yaml file and change the count of the relayers.
For example:
helm_chart_local_repo:
enabled: false
path: ../helm-charts
relayers:
- count: 1
+ count: 2Offchain actors configuration
LocalNet uses Helm charts for configuring services. Default values are defined in each service chart's values.yaml. Example: the RelayMiner values.yaml in the helm-charts repository:
https://github.com/pokt-network/helm-charts/blob/main/charts/relayminer/values.yaml
Local infrastructure requires overrides to some defaults (for example to configure RelayMiner or PATH Gateway). These overrides live in the pocket/localnet/kubernetes directory:
https://github.com/pokt-network/poktroll/tree/main/localnet/kubernetes
If you need to change LocalNet configs, check that directory.
Modify Kubernetes workloads
Local cluster depends on the latest helm charts from:
https://github.com/pokt-network/helm-charts.git
To modify Kubernetes resources locally:
Clone the helm charts locally:
cd .. && git clone [email protected]:pokt-network/helm-charts.git
cd -Update the path of the helm charts to the relative path of the cloned repository:
sed -i'' -e '/helm_chart_local_repo:/,/path:/ s|\(path: \).*|\1../helm-charts|' localnet_config.yamlSet the
helm_chart_local_repo.enabledflag inlocalnet_config.yamltotrue:
sed -i'' -e '/helm_chart_local_repo:/,+1 s/\(enabled: \)true/\1false/; /helm_chart_local_repo:/,+1 s/\(enabled: \)false/\1true/' localnet_config.yamlYou can set it back to false with:
sed -i'' -e '/helm_chart_local_repo:/,+1 s/\(enabled: \)false/\1true/; /helm_chart_local_repo:/,+1 s/\(enabled: \)true/\1false/' localnet_config.yamlObservability
You can configure LocalNet to deploy third-party observability tools such as Prometheus and Grafana by enabling observability in localnet_config.yaml:
observability:
enabled: trueAccess dashboards with graphs and logs
Each service in Tilt has a link to its own Grafana dashboard (RelayMiner, Validator, PATH Gateway, etc).

How to update and save an existing dashboard?
Make the necessary modifications in the Grafana UI.
Click the save button. This will display the updated JSON output of the dashboard.
Copy-paste the output to the corresponding file in localnet/grafana-dashboards.

High-level overview of LocalNet
This section describes how LocalNet operates and the interactions between different components to provision a working network.
LocalNet Deployment Flow
After you execute make localnet_up, many things happen. Overview:
ignite CLI provisions a new genesis.json and validator keys.
tilt starts and runs a Tiltfile — a Python-like script.
The logic in the Tiltfile executes various CLI commands, communicates with the k8s API, and creates or reads the LocalNet configuration file:
Creates a new
localnet_config.yamlif it doesn't exist. Updates it with default values if new ones are introduced.Depending on
localnet_config.yaml, uses Helm charts from the localhelm-chartsrepository or downloads Helm charts from the Helm chart repository athttps://pokt-network.github.io/helm-charts/.Compiles the
pocketdbinary from source.Using values from
localnet_config.yaml, provisions an observability stack (Grafana, Prometheus, Loki), a validator, PATH Gateways, RelayMiners, etc.
With make localnet_up continually running, tilt monitors for code changes and re-compiles the binary when code changes are detected. After the new binary is built it is pushed to containers and processes restart.
Troubleshooting
Clean Slate (Nuclear Option)
If you're encountering weird issues and need to start over, run:
make localnet_down
kind delete cluster --name pocket-localnet
make docker_wipe
make go_develop_and_test
kind create cluster --name pocket-localnet
make localnet_upLast updated
Was this helpful?
