Installation
The RPC Reverse Proxy is independent sofware to Web3 Pi nodes and othere Ethereum nodes. It can be installed on any machine that can directly or via tunnels connect to your Ethereum nodes. There is no restriction if hardware parameters are sufficent - and this is satisfied in most cases since the proxy is lightweight. For instance it can be installed on PC, a dedicated Raspberry Pi, or collocated with one of Ethereum nodes.
The instruction is provided for Linux. Windows instalation needs further examination.
Requirements
To run the proxy, python >= 3.10
is required
Installation
Before proceeding further, verify the python's version. Should be at least 3.10
.
At first create a data directory for RPC Reverse Proxy instance and change the working directory to it.
For the purposes of demonstration assume that the data directory is web3pi
in the user's home folder.
Then the example commands are
You may wish preferably to use a python's virtual environment venv
.
Note that this is optional.
For example, create a virtual environment venv
.
The folder venv
is created in the place. Now activate the virtual environment.
Get latest version from pypi
Configuration
Before running for the first time, a basic configuration with Ethereum nodes addresses needs to be provided. For more options and further details see Configuration and Monitoring. Here is simple configuration that allows the proxy to run.
Create the file .env
. Note the the file name must be exactly .env
.
Edit the file with an editor of your preference, and provide variable/value records.
In simple configuration only the variable ETH_ENDPOINTS
needs to be set.
It lists Ethereum nodes to be connected.
A basic example of .env
file content is as follows.
(venv) user@host:~/web3pi$ cat .env
ETH_ENDPOINTS='[{"name": "my_node", "url": "http://192.168.1.90:8545/"}]'
Remember that the value of ETH_ENDPOINTS
must be a valid json.
Furthermore, this is an array of objects, each describing one Ethereum node with
arbitrary but distinct name
(pick one you like) and url
which is an RPC endpoint of Ethereum node.
Run
Simply execute
Ctrl+C (SIGTERM
) shuts down the proxy.
Admin panel
When the proxy is up, you can check it in the admin panel. Here is a short instruction how to open. The access url to the admin panel is generated at the start of proxy. Check logs and grep the line that looks like this
Update the address part0.0.0.0
in the url according to your network configuration.
The excerpt above is an example, use a token that is actually included in your logs.
Note that the access token may change in the next run of the proxy.
See Admin Panel for details.