From 89beb42edb8a190f06ec663ce072ebdbfd824b71 Mon Sep 17 00:00:00 2001 From: LordGhostX Date: Mon, 13 May 2024 13:40:43 +0100 Subject: [PATCH] add node health check --- docs/guides/nwaku/find-node-address.md | 60 ++++++++++++++++++++ docs/guides/nwaku/run-node.md | 78 +++++++------------------- sidebars.js | 1 + 3 files changed, 81 insertions(+), 58 deletions(-) create mode 100644 docs/guides/nwaku/find-node-address.md diff --git a/docs/guides/nwaku/find-node-address.md b/docs/guides/nwaku/find-node-address.md new file mode 100644 index 0000000..9b1bde9 --- /dev/null +++ b/docs/guides/nwaku/find-node-address.md @@ -0,0 +1,60 @@ +--- +title: Find Your Node Address +hide_table_of_contents: true +--- + +You can find the addresses of a running node through its logs or by calling the [Get node info](https://waku-org.github.io/waku-rest-api/#get-/debug/v1/info) endpoint of the [REST API](https://waku-org.github.io/waku-rest-api/). + +:::info +When starting the node, `nwaku` will display all the public listening and discovery addresses at the `INFO` log level. +::: + +## Listening addresses + +Look for the log entry that begins with `Listening on`, for example: + +```txt title="Nwaku Log Output" +INF 2023-06-15 16:09:54.448+01:00 Listening on topics="waku node" tid=1623445 file=waku_node.nim:922 full=[/ip4/0.0.0.0/tcp/60000/p2p/16Uiu2HAmQCsH9V81xoqTwGuT3qwkZWbwY1TtTQwpr3DjHU2TSwMn][/ip4/0.0.0.0/tcp/8000/ws/p2p/16Uiu2HAmQCsH9V81xoqTwGuT3qwkZWbwY1TtTQwpr3DjHU2TSwMn] +``` + +```shell +# Listening TCP transport address +/ip4/0.0.0.0/tcp/60000/p2p/16Uiu2HAmQCsH9V81xoqTwGuT3qwkZWbwY1TtTQwpr3DjHU2TSwMn + +# Listening WebSocket address +/ip4/0.0.0.0/tcp/8000/ws/p2p/16Uiu2HAmQCsH9V81xoqTwGuT3qwkZWbwY1TtTQwpr3DjHU2TSwMn +``` + +## Discoverable ENR addresses + +A `nwaku` node can encode its addressing information in an [Ethereum Node Record (ENR)](https://eips.ethereum.org/EIPS/eip-778). + +### ENR for DNS discovery + +Look for the log entry that begins with `DNS: discoverable ENR`, for example: + +```txt title="Nwaku Log Output" +INF 2023-06-15 16:09:54.448+01:00 DNS: discoverable ENR topics="waku node" tid=1623445 file=waku_node.nim:923 enr=enr:-Iu4QBKYj8Ovxwz4fIalxZ_1a8dOCU2WC-1LQrcBCCb4Np93f9-UuSZXn3vagJL1S3k3hwRYfOp3JSbW7_VqwtqMIeMBgmlkgnY0gmlwhAAAAACJc2VjcDI1NmsxoQOrmyV59dAzY4ZKrvrj32VOoZbLby8dCKFnXnqhIdQ0NYN0Y3CC6mCFd2FrdTIB +``` + +```shell +# ENR the node addresses are encoded in +enr:-Iu4QBKYj8Ovxwz4fIalxZ_1a8dOCU2WC-1LQrcBCCb4Np93f9-UuSZXn3vagJL1S3k3hwRYfOp3JSbW7_VqwtqMIeMBgmlkgnY0gmlwhAAAAACJc2VjcDI1NmsxoQOrmyV59dAzY4ZKrvrj32VOoZbLby8dCKFnXnqhIdQ0NYN0Y3CC6mCFd2FrdTIB +``` + +### ENR for Discv5 + +Look for the log entry that begins with `Discv5: discoverable ENR`, for example: + +```txt title="Nwaku Log Output" +INF 2023-06-15 16:09:54.448+01:00 Discv5: discoverable ENR topics="waku node" tid=1623445 file=waku_node.nim:924 enr=enr:-IO4QDxToTg86pPCK2KvMeVCXC2ADVZWrxXSvNZeaoa0JhShbM5qed69RQz1s1mWEEqJ3aoklo_7EU9iIBcPMVeKlCQBgmlkgnY0iXNlY3AyNTZrMaEDdBHK1Gx6y_zv5DVw5Qb3DtSOMmVHTZO1WSORrF2loL2DdWRwgiMohXdha3UyAw +``` + +```shell +# ENR the node addresses are encoded in +enr:-IO4QDxToTg86pPCK2KvMeVCXC2ADVZWrxXSvNZeaoa0JhShbM5qed69RQz1s1mWEEqJ3aoklo_7EU9iIBcPMVeKlCQBgmlkgnY0iXNlY3AyNTZrMaEDdBHK1Gx6y_zv5DVw5Qb3DtSOMmVHTZO1WSORrF2loL2DdWRwgiMohXdha3UyAw +``` + +:::tip Congratulations! +You have successfully found the listening and discoverable addresses for your `nwaku` node. Have a look at the Configure Peer Discovery](/guides/nwaku/configure-discovery) guide to learn how to discover and connect with peers in the network. +::: diff --git a/docs/guides/nwaku/run-node.md b/docs/guides/nwaku/run-node.md index e90c58e..3f4be47 100644 --- a/docs/guides/nwaku/run-node.md +++ b/docs/guides/nwaku/run-node.md @@ -19,15 +19,13 @@ To run a node, you must have the `nwaku` binary. Nwaku provides multiple options #### Run nwaku in Docker (recommended) +We recommend [using Docker Compose](/guides/nwaku/run-docker-compose) to run a node because it's the simplest and fastest way to configure and run one: + | | Description | Documentation | | ---------------- | ---------------------------------------- | ----------------------------------------------------------------- | | Docker Compose | Run a `nwaku` node with Docker Compose | [Run Nwaku with Docker Compose](/guides/nwaku/run-docker-compose) | | Docker Container | Run a `nwaku` node in a Docker Container | [Run Nwaku in a Docker Container](/guides/nwaku/run-docker) | -:::tip -We recommend [using Docker Compose](/guides/nwaku/run-docker-compose) to run a node because it's the simplest and fastest way to configure and run one. -::: - #### Download the binary | | Description | Documentation | @@ -50,11 +48,11 @@ You can run the `nwaku` binaries and Docker images on cloud service providers li Once you have gotten the `nwaku` binary, run it using the [default configuration](/guides/nwaku/config-methods#default-configuration-values): ```shell -# Run with default configuration -./build/wakunode2 +# Run the Docker Compose +docker-compose up -d -# See available command line options -./build/wakunode2 --help +# Run the standalone binary +./build/wakunode2 ``` :::tip @@ -72,8 +70,8 @@ To join the Waku Network, nodes must [bootstrap](/learn/glossary#bootstrapping) | Discv5 | Enable `nwaku` to discover peers using the [Discv5](/learn/concepts/discv5) mechanism | [Configure Discv5](/guides/nwaku/configure-discovery#configure-discv5) | | Peer Exchange | Enable [Peer Exchange](/learn/concepts/peer-exchange) protocol for light nodes to request peers from your `nwaku` node | [Configure Peer Exchange](/guides/nwaku/configure-discovery#configure-peer-exchange) | -:::info -You can configure a `nwaku` node to use multiple peer discovery mechanisms simultaneously. +:::tip +We suggest [configuring WebSocket transport](/guides/nwaku/configure-nwaku#configure-websocket-transport) for your node to enable support and serving of browser peers using [@waku/sdk](/guides/js-waku/). ::: ## Interact with the node @@ -112,63 +110,27 @@ curl --location 'http://127.0.0.1:8645/debug/v1/info' \ The `listenAddresses` field stores the node's listening addresses, while the `enrUri` field stores the discoverable `ENR` URI for peer discovery. ::: -:::tip -We suggest [configuring WebSocket transport](/guides/nwaku/configure-nwaku#configure-websocket-transport) for your node to enable support and serving of browser peers using [@waku/sdk](/guides/js-waku/). -::: +## Check the node health status -## Find the node addresses +You can check the health status of the node by calling the [Get node health status](https://waku-org.github.io/waku-rest-api/#get-/health) endpoint of the [REST API](https://waku-org.github.io/waku-rest-api/): -You can find the addresses of a running node through its logs or by calling the [Get node info](https://waku-org.github.io/waku-rest-api/#get-/debug/v1/info) endpoint of the [REST API](https://waku-org.github.io/waku-rest-api/). - -:::info -When starting the node, `nwaku` will display all the public listening and discovery addresses at the `INFO` log level. -::: - -### Listening addresses - -Look for the log entry that begins with `Listening on`, for example: - -```txt title="Nwaku Log Output" -INF 2023-06-15 16:09:54.448+01:00 Listening on topics="waku node" tid=1623445 file=waku_node.nim:922 full=[/ip4/0.0.0.0/tcp/60000/p2p/16Uiu2HAmQCsH9V81xoqTwGuT3qwkZWbwY1TtTQwpr3DjHU2TSwMn][/ip4/0.0.0.0/tcp/8000/ws/p2p/16Uiu2HAmQCsH9V81xoqTwGuT3qwkZWbwY1TtTQwpr3DjHU2TSwMn] -``` + + ```shell -# Listening TCP transport address -/ip4/0.0.0.0/tcp/60000/p2p/16Uiu2HAmQCsH9V81xoqTwGuT3qwkZWbwY1TtTQwpr3DjHU2TSwMn - -# Listening WebSocket address -/ip4/0.0.0.0/tcp/8000/ws/p2p/16Uiu2HAmQCsH9V81xoqTwGuT3qwkZWbwY1TtTQwpr3DjHU2TSwMn +curl --location 'http://127.0.0.1:8645/health' \ +--header 'Accept: text/plain' ``` -### Discoverable ENR addresses + + -A `nwaku` node can encode its addressing information in an [Ethereum Node Record (ENR)](https://eips.ethereum.org/EIPS/eip-778). - -#### ENR for DNS discovery - -Look for the log entry that begins with `DNS: discoverable ENR`, for example: - -```txt title="Nwaku Log Output" -INF 2023-06-15 16:09:54.448+01:00 DNS: discoverable ENR topics="waku node" tid=1623445 file=waku_node.nim:923 enr=enr:-Iu4QBKYj8Ovxwz4fIalxZ_1a8dOCU2WC-1LQrcBCCb4Np93f9-UuSZXn3vagJL1S3k3hwRYfOp3JSbW7_VqwtqMIeMBgmlkgnY0gmlwhAAAAACJc2VjcDI1NmsxoQOrmyV59dAzY4ZKrvrj32VOoZbLby8dCKFnXnqhIdQ0NYN0Y3CC6mCFd2FrdTIB +```txt +Node is healthy ``` -```shell -# ENR the node addresses are encoded in -enr:-Iu4QBKYj8Ovxwz4fIalxZ_1a8dOCU2WC-1LQrcBCCb4Np93f9-UuSZXn3vagJL1S3k3hwRYfOp3JSbW7_VqwtqMIeMBgmlkgnY0gmlwhAAAAACJc2VjcDI1NmsxoQOrmyV59dAzY4ZKrvrj32VOoZbLby8dCKFnXnqhIdQ0NYN0Y3CC6mCFd2FrdTIB -``` - -#### ENR for Discv5 - -Look for the log entry that begins with `Discv5: discoverable ENR`, for example: - -```txt title="Nwaku Log Output" -INF 2023-06-15 16:09:54.448+01:00 Discv5: discoverable ENR topics="waku node" tid=1623445 file=waku_node.nim:924 enr=enr:-IO4QDxToTg86pPCK2KvMeVCXC2ADVZWrxXSvNZeaoa0JhShbM5qed69RQz1s1mWEEqJ3aoklo_7EU9iIBcPMVeKlCQBgmlkgnY0iXNlY3AyNTZrMaEDdBHK1Gx6y_zv5DVw5Qb3DtSOMmVHTZO1WSORrF2loL2DdWRwgiMohXdha3UyAw -``` - -```shell -# ENR the node addresses are encoded in -enr:-IO4QDxToTg86pPCK2KvMeVCXC2ADVZWrxXSvNZeaoa0JhShbM5qed69RQz1s1mWEEqJ3aoklo_7EU9iIBcPMVeKlCQBgmlkgnY0iXNlY3AyNTZrMaEDdBHK1Gx6y_zv5DVw5Qb3DtSOMmVHTZO1WSORrF2loL2DdWRwgiMohXdha3UyAw -``` + + :::tip Congratulations! You have successfully started, configured, and connected a `nwaku` node to the Waku Network. Have a look at the [Node Configuration Examples](/guides/nwaku/configure-nwaku) guide to learn how to configure `nwaku` for different use cases. diff --git a/sidebars.js b/sidebars.js index acf1cbc..77a6e19 100644 --- a/sidebars.js +++ b/sidebars.js @@ -17,6 +17,7 @@ const sidebars = { "guides/nwaku/run-docker", "guides/nwaku/build-source", "guides/nwaku/configure-discovery", + "guides/nwaku/find-node-address", "guides/nwaku/config-methods", "guides/nwaku/config-options", "guides/nwaku/configure-nwaku",