From 2bb2af19e4c68a131b1be4e726fc4712fd163319 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Thu, 17 Dec 2020 11:42:40 +0400 Subject: [PATCH] localnet: expose 6060 (pprof) and 9090 (prometheus) on node0 This removes the need to do it yourself every time you want to debug a issue or look at Prometheus graphs. --- docker-compose.yml | 2 ++ docs/networks/docker-compose.md | 5 +++++ networks/local/localnode/config-template.toml | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index ccc802040..faa41a62a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,6 +6,8 @@ services: image: "tendermint/localnode" ports: - "26656-26657:26656-26657" + - "6060:6060" + - "9090:9090" environment: - ID=0 - LOG=${LOG:-tendermint.log} diff --git a/docs/networks/docker-compose.md b/docs/networks/docker-compose.md index 4e8b03b38..b1592ed09 100644 --- a/docs/networks/docker-compose.md +++ b/docs/networks/docker-compose.md @@ -44,6 +44,11 @@ This file creates a 4-node network using the localnode image. The nodes of the network expose their P2P and RPC endpoints to the host machine on ports 26656-26657, 26659-26660, 26661-26662, and 26663-26664 respectively. +The first node (`node0`) exposes two additional ports: 6060 for profiling using +[`pprof`](https://golang.org/pkg/net/http/pprof), and `9090` - for Prometheus +server (if you don't know how to start one check out ["First steps | +Prometheus"](https://prometheus.io/docs/introduction/first_steps/)). + To update the binary, just rebuild it and restart the nodes: ```sh diff --git a/networks/local/localnode/config-template.toml b/networks/local/localnode/config-template.toml index a90eb7bd5..2061412a4 100644 --- a/networks/local/localnode/config-template.toml +++ b/networks/local/localnode/config-template.toml @@ -1,2 +1,7 @@ [rpc] laddr = "tcp://0.0.0.0:26657" +pprof-laddr = ":6060" + +[instrumentation] +prometheus = true +prometheus-listen-addr = ":9090"