Avail is now backed by prominent investors to accelerate the unification of web3 ๐ŸŽ‰๐ŸŽ‰

How to Run an RPC Node

This guide offers a walkthrough for configuring and running an RPC node, enabling seamless interaction with the Avail network via HTTP and WebSocket.

BEFORE YOU START
Ensure that you meet the system requirements.

Before setting up an RPC node, make sure to review the archive node setup process. The setup process for an RPC node is almost identical, with a few additional parameters to enable RPC functionality.

Configuration Parameters

To run an RPC node, append the following flags to your startup command:

  • --rpc-external
  • --ws-external
  • --rpc-port 9944
  • --ws-port 9944
  • --rpc-cors=all

These flags enable external RPC and WebSocket connections and set the default port to 9944 for both HTTP and WebSocket (WS).

Example Startup Command

Here's an example command to start your RPC node:

./data-avail -d ~/avail-node/data --chain goldberg --pruning archive \
             --rpc-external --ws-external --rpc-port 9944 --ws-port 9944 --rpc-cors=all

FIREWALL CONFIGURATION
Make sure to add the RPC ports (9944) to your firewall's allowed list to ensure smooth communication.

Testing Your RPC Node

You can verify that your RPC node is running correctly by executing a simple curl command. A functioning RPC node will return data, while a non-functioning one will return an error.

curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "rpc_methods"}' http://127.0.0.1:9944/