-
Notifications
You must be signed in to change notification settings - Fork 33
Demos Iteration 9 K8S Localnet And Logging
user_name edited this page Feb 15, 2023
·
1 revision
tl;dr Run a LocalNet using k8s, monitor your cluster, develop on top of it, scale it and search logs in Grafana.
- Deploy a V1 LocalNet using k8s
- Present infrastructure that can be used to deploy remote clusters
- Demonstrate tooling that can be used to scale a cluster
- Demo a mature logging framework integrated with Grafana
- Make it easier to deploy a DevNet and TestNet in the future
- Collect telemetry and gain visibility into node operations
- Enable stress/chaos testing in the future
- Provide tooling & infrastructure for both PNI and external node runners
- Streamline development & debugging
- Pocket-specific Utility
- Sending on-chain transactions
-
Basic env setup based on instructions at docs/development/README.md
-
k8s Localnet env setup based on instructions at build/localnet/README.md
-
[Optional] Learn about the logging library at logger/docs/README.md
- Start up a k8s LocalNet and press
Space
when prompted
make localnet_up
- Confirm that the
Validator
s are present and select the recommended UI at the top left; or visit http://localhost:10350/r/(all) directly
- Open up the debug client and select
TriggerNextView
a few times when prompted to increase the chain height
make localnet_client_debug
- Use the
Tilt UI
to select aValidator
and inspect its logs
-
Commit a few blocks via CLI
-
Search for
Line contains
”Committing block”
- Rather than viewing in Tilt, you can use Grafana to view & filter them as well. Go to http://localhost:42000 click on
explore
; or visit this link directly.
- You can filter by label:
- Or create more complex filter using by parsing
{{.log}}
as shown below:
- To scale the number of validator, change
count
to10
in./localnet_config.yaml
and visit the Tilt UI:
- Bonus: Verify that changing the code retriggers the cluster to rebuild the image: Hot-Reloading out of the box!
- Improved log parsing
- Automate validator staking when scaling
- Discover peers (nodes or actors) when connected to the network
- Sync new nodes to the latest height
Contents
- Home
- Persistence
- Changelog
-
Persistence
- Indexer
- Rpc
- Runtime
- State_Machine
-
Guides
- Roadmap
-
Guides
- Learning
- Guides
-
Guides
- Contributing
- Devlog
-
Guides
- Dependencies
-
Guides
- Releases
- Guides
- P2P
-
Shared
- Crypto
- Shared
-
Shared
- Modules
-
Build
- Config
- Consensus
-
Guides
- Telemetry
- Utility
- Logger