Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: resolve inaccuracies around exposing consensus node's RPC #1095

Merged
merged 3 commits into from
Oct 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 31 additions & 8 deletions docs/nodes/full-consensus-node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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: Configuring an 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

Expand Down