Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to expose RSK node to an external network?

Tags:

rsk

I am having problems exposing my RSK node to an external IP. My startup command looks as follows:

java \
  -cp $HOME/Downloads/rskj-core-3.0.1-IRIS-all.jar \
  -Drsk.conf.file=/root/bitcoind-lnd/rsk/rsk.conf \
  -Drpc.providers.web.cors=* \
  -Drpc.providers.web.ws.enabled=true \
  co.rsk.Start \
  --regtest

This is my rsk.conf:

rpc {
 
     providers {
         web {
             cors: "*",
             http {
                 enabled = true
                 bind_address = "0.0.0.0"
                 hosts = ["localhost", "0.0.0.0"]
                 port: 4444
             }
         }
     }
 }

API is accessible from localhost, but from external network I get error 400. How do I expose it to external network?

like image 568
Aleks Shenshin Avatar asked Oct 27 '21 12:10

Aleks Shenshin


People also ask

How do I set up a Node RED server?

Specify the internal port for your Node-RED server (default is 1880). Specify the external port you want to use to access your Node-RED server. I used 443 since the site is encrypted and HTTPS will default to 443 by default. Select TCP and UDP (I’m not really sure if UDP is used but figured why not).

How to access the service from the external network?

In order to access the service from the external network, the users can use <IP>:<NodePort> where <IP> is the IP address on the external network of any of the nodes. This method is easy to implement.

When should I expose my local NodeJS app to the world?

In this guide, we're going to review three services to expose your local Node.js app to the world: When a remote service needs to call your application and you don't want (or can) deploy your application to a public server. For debugging purposes, it's better to keep everything local.

How do I set up port forwarding for Node-RED?

Click on the “…” menu in the upper right and select the Set up IPv4 port forwarding option. Specify the internal port for your Node-RED server (default is 1880). Specify the external port you want to use to access your Node-RED server. I used 443 since the site is encrypted and HTTPS will default to 443 by default.


Video Answer


1 Answers

You should add your external IP to hosts. Adding just 0.0.0.0 is not enough to indicate all IPs to be valid. Port forwarding needs to be enabled for the port number that you have configured in rsk.conf, which in this case is the default value of 4444.

rpc {
     providers {
         web {
             cors: “*”,
             http {
                 enabled = true
                 bind_address = “0.0.0.0"
                 hosts = [“localhost”, “0.0.0.0", “216.58.208.100”]
                 port: 4444
             }
         }
     }
 }

where 216.58.208.100 is your external IP

like image 161
Owans Avatar answered Oct 22 '22 12:10

Owans