Search…
Appendix: Ports, addresses, validators, and archivists
This page aims to provide more context with regard to the ports and which of them should be made available publicly.
There are three ports that an Aleph Node uses:
  • an RPC port for calling remote procedures (by default this port is set to 9933)
  • a WebSocket port for communication with the node (e.g. by using a wallet, the default is 9944)
  • a P2P port for inter-node communication (by default: 30333)
All of these ports can be configured in the env/validator and env/archivist files and are named RPC_PORT, WS_PORT and PORT respectively.
As validators and archivists have different responsibilities, their networking configuration must differ slightly:
  • a validator needs to be fully accessible from the host that’s running it in order to execute a full range of RPC calls necessary for becoming a validator, but inaccessible from the outside world to prevent tampering. As such, the RPC and WebSocket ports cannot be exposed outside of localhost. If you are using our script, the default is to run in precisely this configuration. Note that the P2P port still needs to be accessible, more on which in later sections.
  • an archivist is required to respond to calls from outside and all those ports should be exposed to the outside world.

Exposing a port

Regardless of whether you are an archivist or a validator, you still need to expose the P2P port in order for the node to be discovered by its peers and the protocol to function correctly. There is several ways of doing that and if you have a public IP you should be all set (this includes the case of running within a cloud provider like AWS, where getting a public IP is a matter of a few clicks).
However, if you’re on a private network and are behind a NAT, you will need to somehow expose your port. We recommend obtaining a public IP with your internet service provider for the secure setup. That said, we will also present a quick way of exposing the port using ngrok as an easy demonstration of using a proxy with aleph-node (even though we recommend more sophisticated methods for increased safety):
  1. 1.
    Get ngrok using these instructions.
  2. 2.
    Run ngrok tcp 30333
  3. 3.
    You should get an ouput similar to this:
ngrok (Ctrl+C to quit)
Session Status online
Account <your_user> (Plan: Free)
Update update available (version 3.0.4, Ctrl-U to update)
Version 3.0.3
Region Europe (eu)
Latency 63.608139ms
Web Interface <http://127.0.0.1:4040>
Forwarding tcp://5.tcp.eu.ngrok.io:14092 -> localhost:30333
Connections ttl opn rt1 rt5 p50 p90
0 0 0.00 0.00 0.00 0.00
4. The interesting part is the address under “Forwarding”. We will need to convert it to the libp2p format, so the address from the listing above would look like the following:
/dns4/5.tcp.eu.ngrok.io/tcp/14092
5. This address needs to be set as PUBLIC_ADDR inside ether env/archivist or env/validator, which will tell the node to advertise it as the public address for other nodes to use:
PUBLIC_ADDR=/dns4/5.tcp.eu.ngrok.io/tcp/14092
6. This should make your node discoverable by other nodes via the p2p protocol.
Copy link