BlockScout is an open-source, real-time Ethereum block explorer which enables users to inspect and analyze blocks, transactions and accounts on any EVM (Ethereum Virtual Machine) blockchain network.
To learn more about BlockScout, please visit their GitHub.
The following steps will allow you to enable BlockScout on Microsoft's Ethereum Proof-of-Authority Consortium Template.
The only requirement is that you have already successfully deployed the Ethereum Proof-Of-Authority template in Azure. If you have yet to deploy an instance, please refer to the documentation before getting started.
In order to deploy BlockScout, a separate Linux Virtual Machine must first be created. Either within the existing PoA Resource Group or within another Resource Group, select the "+ Add" button and search for "Ubuntu Server 16.04 LTS", then expand the resource and select "Create".
- On the first blade, either select the existing Resource Group or a new Resource Group if you prefer.
- Next, choose an appropriate size for the Virtual Machine (B2ms should suffice).
- On the Settings blade, be sure to choose the following settings:
-
Virtual Network & Subnet -> Select Existing Virtual Network in the PoA Resource Group
-
Public IP Address -> Create a new Public IP Address for the VM
-
Network Security Group -> Select Advanced and then choose the existing Network Security Group in the PoA Resource Group
-
Diagnostics Storage Account -> Optional: Select the existing Storage Account in the Resource Group.
See the following deployment settings example:
- Select the "Create" button to complete the Virtual Machine deployment.
- Navigate to the existing Network Security Group within the PoA Resource Group.
- Select the "Inbound Security Rules" blade and then select the "+ Add" button.
- Add a new Inbound Security Rule for Port 80 as follows:
- Make an SSH connection to the newly created VM and ensure you are in the following directory: "home/{$USER}"
- Download a copy of the deployment shell script
install_blockscout.sh
.curl -O https://raw.githubusercontent.com/Azure-Samples/blockchain/master/ledger/template/ethereum-on-azure/technology-samples/blockscout/install_blockscout.sh
- Ensure you have the appropriate permissions to run the script:
chmod +x install_blockscout.sh
- Execute the script using the following parameters:
Parameter | Description |
---|---|
RPC Endpoint | This is the URL of the RPC Endpoint Balancer. |
WebSocket Endpoint* | This must use the IP Address of a specific node within the PoA Consortium (not the Load Balancer IP Address). |
Database Password | This will be the password to use when generating the BlockScout PostgreSQL database. |
*The WebSocket IP Address is the Private IP Address of a specific node when deploying behind a VPN with a VNet Gateway.
Example:
./install_blockscout.sh "http://192.168.0.1:8540" "ws://192.168.0.2:8547" "Password123!"
- Wait approximately 5-10 minutes for the script to complete execution.
- You can optionally add a Custom DNS for the BlockScout site by navigating to the IP Address for the newly created VM.
- Navigate to the "Configuration" blade and under "DNS name label", choose an appropriate DNS name.
Once the deployment script has successfully completed, you should be able to navigate to either the Public IP Address or Custom DNS name to view the BlockScout user interface.
If you would like to customize the theme, follow these steps after a successful deployment:
- Stop the BlockScout service:
sudo systemctl stop blockscout.service
. - Navigate to
blockscout/apps/block_scout_web/assets/css/theme
. - Edit
_poa_variables.scss
with appropriate theme colors. - Rebuild the static assets:
sudo npm run-script deploy
(fromblockscout/apps/block_scout_web/assets
directory). - Restart the BlockScout service:
sudo systemctl start blockscout.service
.
The BlockScout application will now be running with the designated theme changes.