xDai Stable Chain xDai Stable Chain BlockScout BlockScout TokenBridge TokenBridge

How do I bind BlockScout to external IP?

Hey,

Can anyone tell me how do bind this awesome BlockScout app to external IP, so that it will be accessible over internet?

Love this forum, people help immediately.

Thanks!

What is your current deployment; which method did you use? How many network interfaces are in your BlockScout host or VM? Are you asking how to bind to a single IP Address on the host, or are you asking how to have a public IP Address be mapped through a firewall to your BlockScout instance?

1 Like

Its Ubuntu 18.04
Manual setup.
I have one interface only and yes I’m asking how to bind public IP to my blockscout intance.

Will try to ask again, including your answers to help gather more information :slight_smile:

  • What is your current deployment (Ubuntu 18.04 VM); which method did you use? - Which installation steps did you follow (manual), could you post link here please?
  • How many network interfaces are in your BlockScout VM (1)? Do you have only one IP address or more IP addresses bound to this interface? Is this a pubic IP address or a private IP? Is this instance hosted in a lab, or on a public cloud like DigitalOcean, AWS, or other?
  • Are you asking how to bind to a single IP Address on the host (not clear), or are you asking how to have a public IP Address be mapped through a firewall to your BlockScout instance? In other words, are you attempting to simply open public access to your BlockScout instance using the IP address already bound to your network Interface, or are you trying to essentially forward connections to a public IP address through a firewall to your instance?

Please answer above and it will be easier to help. Thanks!

1 Like

Hi @1proof!

Thank you for helping me :slight_smile:
I’m sorry for missing details, haven’t touched Linux for a long time and completely new to BlockScout.

Yes, I deployed BlockScout on Ubuntu 18.04 LTS hosted on AWS.
I installed BlockScout following manual setup instructions.
And yes, I want to simply open public access to BlockScout instance using the public IP address already bound to AWS instance.

Thanks a lot!

Based on your description, everything should work ‘out of the box.’ I’ve asked twice now for you to post the link to the install steps you have followed - if you do that it will be much easier to help :slight_smile: Could you post the link to the instructions and steps you followed to install BlockScout, please?

Sorry, I followed this maunal to setup BlockScout.

https://poanetwork.github.io/blockscout/#/manual-deployment

Very good. Is your BlockScout instance running? Since you say you have a public IP Address on your AWS instance of Ubuntu 18.04, what is not working for you? Do you have a specific error?

I get this error when running mix phx.server.
I’m using geth-classic with rpc and ws options:

./geth --rpc --ws --fast --cache=1024

Error is following:

2019-07-14T07:25:17.852 [error] ** Websocket client EthereumJSONRPC.WebSocket.WebSocketClient terminating in :websocket_info/3
for the reason :error::function_clause
** Last message was {:tcp, #Port<0.24118>, “HTTP/1.1 403 Forbidden\r\n\r\n”}
** Handler state was EthereumJSONRPC.WebSocket.WebSocketClient{connected: false, request_id_to_registration: {2992716400 => EthereumJSONRPC.WebSocket.Registration{from: {#PID<0.1656.0>, #Reference<0.2713117227.2337800193.131382>}, request: {id: 2992716400, jsonrpc: “2.0”, method: “eth_subscribe”, params: [“newHeads”]}, type: :subscribe}}, subscription_id_to_subscription_reference: {}, subscription_reference_to_subscription: {}, subscription_reference_to_subscription_id: %{}, url: “ws://localhost:8546”}
** Stacktrace: [{EthereumJSONRPC.WebSocket.WebSocketClient, :websocket_info, [{:tcp, #Port<0.24118>, “HTTP/1.1 403 Forbidden\r\n\r\n”}, {:websocket_req, :ws, ‘localhost’, 8546, ‘/’, 150000, #Reference<0.2713117227.2337800193.131413>, 1, #Port<0.24119>, {:transport, :gen_tcp, :tcp, :tcp_closed, :tcp_error, [mode: :binary, active: true, packet: 0]}, “g8GNArBXKeinTqMuIkVvEw==”, :undefined, :undefined, :undefined, :undefined, :undefined}, EthereumJSONRPC.WebSocket.WebSocketClient{connected: false, request_id_to_registration: {2992716400 => EthereumJSONRPC.WebSocket.Registration{from: {#PID<0.1656.0>, #Reference<0.2713117227.2337800193.131382>}, request: {id: 2992716400, jsonrpc: “2.0”, method: “eth_subscribe”, params: [“newHeads”]}, type: :subscribe}}, subscription_id_to_subscription_reference: {}, subscription_reference_to_subscription: {}, subscription_reference_to_subscription_id: %{}, url: “ws://localhost:8546”}], [file: ‘lib/ethereum_jsonrpc/web_socket/web_socket_client.ex’, line: 161]}, {:websocket_client, :handle_info, 3, [file: ‘/home/blockscout/blockscout/deps/websocket_client/src/websocket_client.erl’, line: 423]}, {:gen_fsm, :handle_msg, 8, [file: ‘gen_fsm.erl’, line: 486]}, {:proc_lib, :init_p_do_apply, 3, [file: ‘proc_lib.erl’, line: 249]}]

Then it stops throwing these error message and stops with :slight_smile:

Application indexer exited: shutdown

But I can successfully download home page with

curl localhost:4000

When I try to access with public IP, I just receive :slight_smile:

This site can’t be reached

Tried to set up BLOCKSCOUT_HOST env variable to public IP, but no luck.

This has nothing to do with “binding to an external IP address” - congratulations, that problem is solved :slight_smile:

Take a look at Step 10 from the instructions you have posted, headed with:
“10. Enable HTTPS in development. The Phoenix server only runs with HTTPS.”

Make sure to follow the complete deployment instructions. If you continue to have issues, please start a different subject so DevTeam can help. Good luck!

This is the wrong set of parameters for Geth because your Ethereum node should be fully synchronized archive node to be used by Blockscout. Please check FAQ: What settings are required on a Parity or Geth Client?. Especially, Geth Client section.

1 Like

Hi @viktorbaranov and @1proof ! I appreciate your help very much! I hope I’m not annoying much :smile:

@viktorbaranov, there are bunch of settings apart from syncmode in that section. Is it enough to switch to full syncmode and archive gcmode?

–syncmode=full --gcmode=archive

Also, @1proof I did that part already and modified/etc/hosts after step 10. I believe its not related to that.

@viktorbaranov, @viktorbaranov thank you for your help, I resolved issue. Appeared to be firewall issue :man_facepalming: