Blockscout Explorer Deployment
Blockchain explorer for examining and inspecting EVM chains.
Last updated
Blockchain explorer for examining and inspecting EVM chains.
Last updated
Blockscout is a fully-featured open-source blockchain explorer which can be used by any Ethereum virtual machine (EVM) chain. Blockscout provide access to essential on-chain data, the ability to interact with smart contracts, and tools to analyse any transactions at ease. The major features of blockscout are multichain, highly configurable, and open source. The explorer allows the user to search blocks, transaction, addresses and also connect & interact with smart contract, application, bridges, wallets, etc.,
The hardware requirement details to install the explorer for Peerplays2.0 is provided below.
EVM chains can differ in size and requirements, these are the recommendations for optimal performance.
CPU | 16 core, 32 thread |
---|---|
CPU | 8 |
---|---|
CPU | 8 Core/Thread Virtualized |
---|---|
Before installing the Blockscout explorer, the user must ensure that the below required software are installed in their machine. Follow the CLI below to install the desired software,
Docker is an open software platform that enables the user to build, deploy, test, and update applications swiftly. Docker uses containers for all the execution. A container is a total software package of an application's code, its libraries and other dependencies. The main advantage of using container is that, our application is portable and the same code can be executed on any device. The cli to install docker is provided below:
Erlang is used to build massive scalable soft real-time system with requirements on high availability. Install using the below command:
Elixir is a dynamic, functional language for building scalable and maintainable applications. Elixir runs on the Erlang VM, known for creating low-latency, distributed, and fault-tolerant systems. Install the Elixir using the below command:
PostgreSQL is an open source relational database management system emphasizing extensibility and SQL compliance. It is the primary primary datastore or data warehouse for many web, mobile, geospatial, and analytics application. Install PostgreSQL 14 using the below CLI:
Node 18 execute the JavaScript using the updated version to boost the performance of web applications. It allows to create and execute tests without intervention from any third party package before adding code to action. Its the build-in node. Install latest Node 18 version using the below commands:
The apt dependencies are the supporting packages required to run the application in Linux without interruption. Install the necessary package using below command:
In the terminal, follow the step-by-step procedure given below to setup the application
Grab the repository Clone the repository from the GitHub.
Ensure connectivity to PostgreSQL Login the PSQL using the correct database user.
Export PostgreSQL database URL Export the database to blockscout.
Install Mix dependencies and compile them
Generate a new secret_key_base for the DB Using the below command, generate the key for database:
Export the secret key
Set the following environment variables specific to Peerplays2.0 The below environment details are specific to Peerplays2.0 application:
Start Smart contract verification micro-service with docker Use below command to start the docker:
Compile the application compile using the below command:
Create and migrate database
Installing node.js dependencies Install the required modules using below commands:
Build static assets (if any)
Generate self signed certs for running locally (use certbot if deploying production) The required certificate can be generated using below commands:
Start the server with tmux To have multiple sessions and to switch between, start the application with tmux.
First, create blockscout
database dump using a proper database user. It's important because the application can be restored only using this data. Follow the below steps,
Create a dump of the blockscout
database using below command:
Drop the database and recreate an empty database from ~/blockscout/
Restarting blockscout from the above location will result in error, as the database has not been migrated - Follow next step to restore the database.
Restore the database using the dump taken earlier using below command:
The Application has to be restarted from here and it starts the indexing again from where it left off last in the database dump.
RAM
128GB
RAM
16GB
Disk
160GB SSD
RAM
16GB
Disk
15GB
CPU Average (1, 5, 15 Minutes)
0.25, 0.11, 0.10
RAM Usage
5.95GB
Disk Usage
25GB