Forum

Trouble configuring blockscout for a private network

Hello POS People!

I am new to blockscout and I am having trouble setting up an explorer for my private network. I followed your instructions for creating a cloudformation-based installation on AWS.

I got to the point where I could log in to the instance and change the password when prompted, but then it gives a “401 Authorization Required” response.

I have a 2-part question:

  1. is there a server I can ssh into, to look around and see what it thinks it’s doing?
  2. what can you suggest as a troubleshooting approach for the 401 issue?

I do have a publicly-accessible full archive node that I have confirmed is working, by accessing its blocks from another machine over http json-rpc.

FYI: my network is a clique-based PoA network running geth 1.9.25 on all nodes.

The command that starts the archive node is
geth --config netconfig/priv_3.config.toml --password pw.txt --nat extip:34.222.x.y --http --http.addr 0.0.0.0 --http.api clique,debug,net,eth,web3,txpool --http.corsdomain blockscout-0.xxx.net --http.vhosts ‘*’

Hello,

  1. is there a server I can ssh into, to look around and see what it thinks it’s doing?

Yes, the application server should be available in the list of EC2 instances. You should be able to login with the key you provided during configuration.

  1. what can you suggest as a troubleshooting approach for the 401 issue?
  1. Check that application folders exist in the application server
  2. Check that application is running there sudo systemctl status explorer.service
  3. Check that the archive node accessible from the application server by making the request to it from the application server
  4. Check that DB is accessible from the application server

Thank you so much, I was feeling a little lost there, for a minute!

Do the following settings make sense for a clique-based private network?

BlockTransformer: clique
Coin: POA
Network: POA
SubNetwork: Sokol

Still having trouble after starting over.

At least I could ssh in as ec2-user, so that’s progress!

I saw no application folders in the ec2-user directory, but I do see a bunch of files in /opt/app

sudo systemctl status explorer.service returned:
Loaded: loaded (/usr/lib/systemd/system/explorer.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2021-03-25 23:01:09 UTC; 5s ago
Main PID: 8650 (beam.smp)
CGroup: /system.slice/explorer.service
├─8650 /usr/lib/erlang/erts-10.4/bin/beam.smp – -root /usr/lib/erlang -progname erl – -home /home/ec2-user – -pa /opt/elixir…
└─8664 erl_child_setup 1024

Mar 25 23:01:09 ip-10-0-1-165.ec2.internal systemd[1]: Started POA Explorer.
Mar 25 23:01:09 ip-10-0-1-165.ec2.internal systemd[1]: Starting POA Explorer…

curl gives no error accessing my geth node
curl http://34.222.xx.y:8545

I went ahead ad did sudo systemctl restart explorer.service

I don’t know if this isa real problem. It looks like it wants to do websocket, but I set EthereumJsonRPCWsURL empty, thinking it was not needed.

Mar 25 23:11:05 ip-10-0-1-165.ec2.internal explorer[10093]: ** (EXIT) an exception was raised:
Mar 25 23:11:05 ip-10-0-1-165.ec2.internal explorer[10093]: ** (FunctionClauseError) no function clause matching in EthereumJSONRPC…link/1
Mar 25 23:11:05 ip-10-0-1-165.ec2.internal explorer[10093]: (ethereum_jsonrpc 0.1.0) lib/ethereum_jsonrpc/web_socket/web_socket_clie…ket]])
Mar 25 23:11:05 ip-10-0-1-165.ec2.internal explorer[10093]: (stdlib 3.9) supervisor.erl:379: :supervisor.do_start_child_i/3
Mar 25 23:11:05 ip-10-0-1-165.ec2.internal explorer[10093]: (stdlib 3.9) supervisor.erl:365: :supervisor.do_start_child/2
Mar 25 23:11:05 ip-10-0-1-165.ec2.internal explorer[10093]: (stdlib 3.9) supervisor.erl:349: anonymous fn/3 in :supervisor.start_children/2
Mar 25 23:11:05 ip-10-0-1-165.ec2.internal explorer[10093]: (stdlib 3.9) supervisor.erl:1157: :supervisor.children_map/4
Mar 25 23:11:05 ip-10-0-1-165.ec2.internal explorer[10093]: (stdlib 3.9) supervisor.erl:315: :supervisor.init_children/2
Mar 25 23:11:05 ip-10-0-1-165.ec2.internal explorer[10093]: (stdlib 3.9) gen_server.erl:374: :gen_server.init_it/2
Mar 25 23:11:05 ip-10-0-1-165.ec2.internal explorer[10093]: (stdlib 3.9) gen_server.erl:342: :gen_server.init_it/6

Another sudo systemctl status explorer.service yielded:
● explorer.service - POA Explorer
Loaded: loaded (/usr/lib/systemd/system/explorer.service; enabled; vendor preset: disabled)
Active: activating (auto-restart) (Result: exit-code) since Thu 2021-03-25 23:17:50 UTC; 4s ago
Process: 11058 ExecStart=/opt/elixir/bin/mix phx.server (code=exited, status=1/FAILURE)
Main PID: 11058 (code=exited, status=1/FAILURE)

Mar 25 23:17:50 ip-10-0-1-165.ec2.internal systemd[1]: Unit explorer.service entered failed state.
Mar 25 23:17:50 ip-10-0-1-165.ec2.internal systemd[1]: explorer.service failed.

Do the following settings make sense for a clique-based private network?

BlockTransformer: clique
Coin: POA
Network: POA
SubNetwork: Sokol

That is correct, yes.

I suppose the issue is with EthereumJsonRPCWsURL. It shouldn’t be left empty during filling the CloudFormation template. But no worries, it can be fixed. If you don’t want to use node’s websockets for some reason, you should comment out ETHEREUM_JSONRPC_WS_URL in /etc/environment file on the application EC2 instance and then restart the application with sudo systemctl restart explorer.service.

Great, it’s working now that I commented out that bit!

I would suggest that you remove this vulnerability for the future, by making the software check for empty ETHEREUM_JSONRPC_WS_URL.

Before I close, I have one more question: is there any advantage to enabling websockets? (I wonder if it has anything to do with my other issue related to verifying contracts.)

I am still wondering what is the advantage of websockets that makes it worth opening and listening another port,

I am still wondering what is the advantage of websockets that makes it worth opening and listening another port,

  • Fewer HTTP requests to archive node
  • faster indexing of the new blocks