From 8996e364349315a86244254e4efbc530a5e6ba17 Mon Sep 17 00:00:00 2001 From: "joshcs.eth" <46639943+jcstein@users.noreply.github.com> Date: Thu, 28 Sep 2023 13:39:12 -0400 Subject: [PATCH 1/3] chore: resolve inaccuracies around exposing consensus node's RPC note: after this is implemented, i plan to complete #556 --- docs/nodes/full-consensus-node.mdx | 39 ++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/docs/nodes/full-consensus-node.mdx b/docs/nodes/full-consensus-node.mdx index 3eb21af6735..57a7bb6ad0d 100644 --- a/docs/nodes/full-consensus-node.mdx +++ b/docs/nodes/full-consensus-node.mdx @@ -239,21 +239,44 @@ Please refer to the [ports](../../nodes/celestia-node/#ports) section for inform which ports are required to be open on your machine. ::: -### Optional: configure for RPC endpoint +### Optional: Configuration for RPC endpoint -You can configure your full consensus node to be a public RPC endpoint -and listen to any connections from Data Availability Nodes in order to -serve requests for the Data Availability API [here](../developers/node-tutorial.mdx). +You can configure your Consensus Full Node to be a public RPC endpoint. +This allows it to accept connections from Data Availability Nodes and] +serve requests for the Data Availability API. -Run the following commands: +#### Expose RPC + +By default, the RPC service listens on `localhost` which means it can't +be accessed from other machines. To make the RPC service available publicly, +you need to bind it to a public IP or `0.0.0.0` (which means listening on all +available network interfaces). + +You can do this by editing the config.toml file: ```sh -EXTERNAL_ADDRESS=$(wget -qO- eth0.me) -sed -i.bak -e "s/^external_address = \"\"/external_address = \"$EXTERNAL_ADDRESS:26656\"/" $HOME/.celestia-app/config/config.toml sed -i 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:26657"#g' ~/.celestia-app/config/config.toml ``` -Restart `celestia-appd` in the previous step to load those configs. +This command replaces the `localhost` IP address with `0.0.0.0`, making the +RPC service listen on all available network interfaces. + +#### Note on `external-address` + +The `external-address` field in the configuration is used when your node +is behind a NAT and you need to advertise a different address for peers +to dial. Populating this field is not necessary for making the RPC +endpoint public. + +```sh +EXTERNAL-ADDRESS=$(wget -qO- eth0.me) +sed -i.bak -e "s/^external-address = ""/external-address = "$EXTERNAL-ADDRESS:26656"/" $HOME/.celestia-app/config/config.toml +``` + +#### Restart the node + +After making these changes, restart `celestia-appd` to load the new +configurations. ## Transaction indexer configuration options From a739ca2754e3ffc1be7afa585d09cd8d6d3fc96f Mon Sep 17 00:00:00 2001 From: Josh Stein <46639943+jcstein@users.noreply.github.com> Date: Thu, 28 Sep 2023 18:38:46 -0400 Subject: [PATCH 2/3] Update docs/nodes/full-consensus-node.mdx --- docs/nodes/full-consensus-node.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/nodes/full-consensus-node.mdx b/docs/nodes/full-consensus-node.mdx index 57a7bb6ad0d..0a4f8a6bfa1 100644 --- a/docs/nodes/full-consensus-node.mdx +++ b/docs/nodes/full-consensus-node.mdx @@ -239,7 +239,7 @@ Please refer to the [ports](../../nodes/celestia-node/#ports) section for inform which ports are required to be open on your machine. ::: -### Optional: Configuration for RPC endpoint +### Optional: Configuring an RPC endpoint You can configure your Consensus Full Node to be a public RPC endpoint. This allows it to accept connections from Data Availability Nodes and] From 4c1a7ba77fc83ae9f68d0223e464a8a3644efcad Mon Sep 17 00:00:00 2001 From: Josh Stein <46639943+jcstein@users.noreply.github.com> Date: Fri, 29 Sep 2023 17:22:51 -0400 Subject: [PATCH 3/3] Update docs/nodes/full-consensus-node.mdx --- docs/nodes/full-consensus-node.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/nodes/full-consensus-node.mdx b/docs/nodes/full-consensus-node.mdx index 0a4f8a6bfa1..4a0f20c3f2b 100644 --- a/docs/nodes/full-consensus-node.mdx +++ b/docs/nodes/full-consensus-node.mdx @@ -242,7 +242,7 @@ which ports are required to be open on your machine. ### Optional: Configuring an RPC endpoint You can configure your Consensus Full Node to be a public RPC endpoint. -This allows it to accept connections from Data Availability Nodes and] +This allows it to accept connections from Data Availability Nodes and serve requests for the Data Availability API. #### Expose RPC