How to set up private RPC server on Debian / Ubuntu
- Set up and sync your BPX Chain full node following this guide. When creating the execution client systemd service, add some new parameters to the geth command line:
ExecStart=bpx-geth --syncmode snap --http --http.api web3,eth,net --http.corsdomain "*"
--http.api web3,eth,net
makes only safe APIs available to the public:web3
,eth
andnet
, meanwhile it blocks access to dangerous RPC methods, e.g.admin
orpersonal
--http.corsdomain "*"
allows your RPC endpoint to be used in dApps in all domains
If you want to run an RPC endpoint providing archive states, replace the mentioned line to the following one:
ExecStart=bpx-geth --syncmode full --gcmode archive --http --http.api web3,eth,net --http.corsdomain "*"
2. Create an A record in your domain DNS zone and point it to your BPX full node IP address. BPX developers recommend that all private RPC endpoints should be named bpx-dataseed
, so if your domain is example.com
, please name your RPC server bpx-dataseed.example.com
.
3. Install nginx HTTP server and certbot - a tool to get free SSL certificate:
apt-get install nginx python3-certbot-nginx
3.