/galaxias-explorer

Primary LanguageJavaScriptOtherNOASSERTION

How to Install and Run the Blockchain Explorer

This document is an (outdated) guide to install the carsenk/explorer blockchain explorer found at https://github.com/carsenk/explorer. It assumes Ubuntu 16.04 as a target OS. A forked version called glxplorer may be forthcoming. Let's hope so because carsenk/explorer is pretty bad.

Install Parity

Install Parity (https://parity.io)

Install Dependencies

i. make:

# apt-get install build-essential

ii. node.js:

Follow the instructions here to [[https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions|install node.js]].

iii. bower:

As root:

# npm install -g bower

Acquire Network Files and Connect to the Galaxy Blockchain

https://gitlab.securesystemdesign.io/GALAXIAS/GalaxyBlockchain/Network-Files

Invoking Parity

Parity will need to allow RPC access from the same IP address that the explorer is accessible at. If you are accessing the explorer from localhost, no change is needed as that is the default. If you are viewing from then you have to invoke Parity with the following flag (or the equivalent config option if you are using a config file):

--jsonrpc-hosts=<ip-address>

Install the Blockchain Explorer

**NOTE: This file has not been updated since fork!! **

Follow instructions in README.md.carsenk

Before starting the explorer with "npm start", you may wish to configure the explorer as instructed below.

Configure the Blockchain Explorer

Connecting to localhost

If you will be viewing this locally, you do not need to change the defaults.

SSH for localhost access to remote server

$ ssh -N -L 8000:localhost:8000 8545:localhost:8545 username@server

Connecting Publicly

If you are connecting publicly, edit explorer/app/app.js

change this:

var GETH_HOSTNAME       = "localhost";       // put your IP address!

to this:

var GETH_HOSTNAME       = "<ip-address>";       // i just did!

To serve on another port than 8000, change the line in package.json from:

     "start": "http-server ./app -a localhost -p 8000 -c-1",

to:

     "start": "http-server ./app -a localhost -p <your-port> -c-1",

Choosing port 80 will likely fail unless you are running the explorer as root.

Configure Reverse Proxy

If you are viewing the explorer publicly, you will need to configure a reverse proxy to forward both ports 8000 (the explorer UI) and port 8545 (the Parity RPC) to the localhost.

If you are using Apache2, [[set_up_apache2_for_reverse_proxy|Set up Apache2 for Reverse Proxy]]. Then make sure /etc/apache2/ports.conf has these two lines:

# Parity RPC

Listen <ip-address>:8545

# Blockchain Explorer

Listen <ip-address>:80

Then make sure you have the following in /etc/apache2/sites-enabled/000-default.conf:

# For RPC

<VirtualHost <ip-address>:8545>

    ProxyPreserveHost Off

    ProxyPass / http://127.0.0.1:8545/

    ProxyPassReverse / http://127.0.0.1:8545

    ServerName localhost

</VirtualHost>



# For Blockchain Explorer

<VirtualHost <ip-address>:80>

    ProxyPreserveHost On

    ProxyPass / http://127.0.0.1:8000/

    ProxyPassReverse / http://127.0.0.1:8000

    ServerName localhost

</VirtualHost>

If you wish to view at the standard http port of 80, your VirtualHost statement will read:

# For Blockchain Explorer

<VirtualHost <ip-address>:80>

    ProxyPreserveHost On

    ProxyPass / http://127.0.0.1:8000/

    ProxyPassReverse / http://127.0.0.1:8000

    ServerName localhost

</VirtualHost>

</code>

Opening Firewall Ports

Make sure your firewall allows access to ports 8000 (or 80 if choosing the second config) and 8545.

Putting it Together

  • Invoke Parity

  • Start the explorer as per the instructions on its github page

  • Start Apache2

  • Open your browser to :8000 (or simply to if using port 80).