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

[Docs] How do I access my CometBFT endpoint externally? #986

Merged
merged 3 commits into from
Dec 5, 2024
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
38 changes: 36 additions & 2 deletions docusaurus/docs/operate/run_a_node/full_node_walkthrough.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ few commands to get started, check out the [Full Node Cheat Sheet](../quickstart
- [How do I start my node?](#how-do-i-start-my-node)
- [How do I restart my node?](#how-do-i-restart-my-node)
- [How do I query the latest block (i.e. check the node height)?](#how-do-i-query-the-latest-block-ie-check-the-node-height)
- [How do I access my CometBFT endpoint externally?](#how-do-i-access-my-cometbft-endpoint-externally)
- [How do I check the node version?](#how-do-i-check-the-node-version)
- [How do I check the Cosmosvisor directory structure?](#how-do-i-check-the-cosmosvisor-directory-structure)
- [How do I check if an upgrade is available?](#how-do-i-check-if-an-upgrade-is-available)
Expand Down Expand Up @@ -240,15 +241,15 @@ This may involve one or more of the following:
5. **Verify your port** is accessible using a tool like netcat or telnet from another machine:

```bash
nc -vz your_server_ip 26656
nc -vz {EXTERNAL_IP} 26656
```

### FAQ & Troubleshooting

#### How do I check the node is accessible from another machine?

```bash
nc -vz your_server_ip 26656
nc -vz {EXTERNAL_IP} 26656
```

#### How do I view the node status?
Expand Down Expand Up @@ -295,6 +296,39 @@ Or, using curl:
curl -X GET http://localhost:26657/block | jq
```

#### How do I access my CometBFT endpoint externally?

The default CometBFT port is at `26657`.

To make it accessible externally, you'll need to port all the instructions from
port `26656` on this page to port `26657`. Specifically:

```bash
# Update your firewall
sudo ufw allow 26657/tcp

# Alternatively, if ufw is not available, update your iptables
sudo iptables -A INPUT -p tcp --dport 26657 -j ACCEPT

# Update your Cosmovisor config
sed -i 's|laddr = "tcp://127.0.0.1:26657"|laddr = "tcp://0.0.0.0:26657"|' $HOME/.poktroll/config/config.toml
sed -i 's|cors_allowed_origins = \[\]|cors_allowed_origins = ["*"]|' $HOME/.poktroll/config/config.toml

# Restart the service
sudo systemctl restart cosmovisor.service

# Test the connection
nc -vz {EXTERNAL_IP} 26657
```

Learn more [here](https://docs.cometbft.com/main/rpc/).

:::warning

Be careful about making this public as adversarial actors may try to DDoS your node.

:::

#### How do I check the node version?

```bash
Expand Down
Loading