Blockchain Explorer for inspecting and analyzing EVM Chains.
BlockScout provides a comprehensive, easy-to-use interface for users to view, confirm, and inspect transactions on all EVM (Ethereum Virtual Machine) blockchains. This includes the Ethereum main and test networks as well as Ethereum forks and sidechains.
Following is an overview of the project and instructions for getting started.
BlockScout is an Elixir application that allows users to search transactions, view accounts and balances, and verify smart contracts on the entire Ethereum network including all forks and sidechains.
Currently available block explorers (i.e. Etherscan and Etherchain) are closed systems which are not independently verifiable. As Ethereum sidechains continue to proliferate in both private and public settings, transparent tools are needed to analyze and validate transactions.
Open source development: The code is community driven and available for anyone to use, explore and improve.
Real time transaction tracking: Transactions are updated in real time - no page refresh required. Infinite scrolling is also enabled.
Smart contract interaction: Users can read and verify Solidity smart contracts and access pre-existing contracts to fast-track development. Support for Vyper, LLL, and Web Assembly contracts is in progress.
Token support: ERC20 and ERC721 tokens are supported. Future releases will support additional token types including ERC223 and ERC1155.
User customization: Users can easily deploy on a network and customize the Bootstrap interface.
Ethereum sidechain networks: BlockScout supports the Ethereum mainnet, Ethereum testnets, POA network, and forks like Ethereum Classic, xDAI, additional sidechains, and private EVM networks.
- POA Core Network
- POA Sokol Testnet
- xDai Chain
- Ethereum Mainnet
- Kovan Testnet
- Ropsten Testnet
- Goerli Testnet
- Rinkeby Testnet
- Ethereum Classic
Additional Chains Utilizing BlockScout
Interface for the POA network updated 02/2019
We use Terraform to build the correct infrastructure to run BlockScout. See https://github.com/poanetwork/blockscout-terraform for details.
The development stack page contains more information about these frameworks.
||Erlang Install Example|
|Elixir 1.7.1||Elixir Install Example|
||Postgres Install Example|
||Node.js Install Example|
||Automake Install Example|
||Libtool Install Example|
|Inotify-tools||Not Required||Ubuntu -
||GCC Compiler Example|
||Install GMP Devel|
Build and Run
Clone the repository.
git clone https://github.com/poanetwork/blockscout
Go to the explorer subdirectory.
Set up default configurations.
cp apps/explorer/config/dev.secret.exs.example apps/explorer/config/dev.secret.exs
cp apps/block_scout_web/config/dev.secret.exs.example apps/block_scout_web/config/dev.secret.exs
Linux: Update the database username and password configuration in
Mac: Remove the
Optional: Set up default configuration for testing.
cp apps/explorer/config/test.secret.exs.example apps/explorer/config/test.secret.exs
Example usage: Changing the default Postgres port from localhost:15432 if Boxen is installed.
mix do deps.get, local.rebar --force, deps.compile, compile
Create and migrate database.
mix ecto.create && mix ecto.migrate
Note: If you have run previously, drop the previous database
mix do ecto.drop, ecto.create, ecto.migrate
Install Node.js dependencies.
cd apps/block_scout_web/assets && npm install; cd -
cd apps/explorer && npm install; cd -
Update your JSON RPC Variant in
Update your JSON RPC Endpoint in
variantchosen in step 7, enter the correct information for the corresponding JSON RPC Endpoint in
Enable HTTPS in development. The Phoenix server only runs with HTTPS.
mix phx.gen.cert blockscout blockscout.local; cd -
- Add blockscout and blockscout.local to your
127.0.0.1 localhost blockscout blockscout.local 255.255.255.255 broadcasthost ::1 localhost blockscout blockscout.local
- If using Chrome, Enable
Start Phoenix Server.
Now you can visit
localhost:4000 from your browser.
Additional runtime options:
Run Phoenix Server with IEx (Interactive Elixer)
iex -S mix phx.server
Run Phoenix Server with real time indexer
iex -S mix phx.server
blockscout does not restart if it crashes. To enable automated
restarts, set the environment variable
HEART_COMMAND to whatever you run to
blockscout. You can configure the heart beat timeout, which will change
how long it will wait before considering the application to be unresponsive. At
that point, it will kill the current blockscout and execute
By default a crash dump is not written unless you set
to a positive or negative integer. See the documentation for
heart for more information.
Configuring Ethereum Classic and other EVM Chains
Note: Most of these modifications will be consolidated into a single file in the future.
Update the import file in
apps/block_scout_web/assets/css/theme/_variables.scss. There are several preset css files for our supported chains which include Ethereum Classic, Ethereum Mainnet, Ropsten Testnet, Kovan Testnet, POA Core, and POA Sokol. To deploy Ethereum Classic, change the import to
Update the logo file in
apps/block_scout_web/config/config.exs. To deploy Ethereum Classic, change this file to
apps/block_scout_web/config/prod.exs. This allows realtime events to occur on your endpoint.
Update the node configuration. You will need a full tracing node with WebSockets enabled. Make the changes in the following files (dev/prod):
Update the dropdown menu in the main navigation
Update the coin in
apps/explorer/config/config.exs. This will pull relevant information from Coinmarketcap.com.
Umbrella Project Organization
Each OTP application has a restricted domain.
||Ethereum JSONRPC client. It is allowed to know
||Storage for the indexed chain. Can read and write to the backing storage. MUST be able to boot in a read-only mode when run independently from
||Phoenix interface to
To monitor build status, configure your local CCMenu with the following url:
- PhantomJS (for wallaby)
Running the tests
Build the assets.
cd apps/block_scout_web/assets && npm run build; cd -
Format the Elixir code.
Run the test suite with coverage for whole umbrella project. This step can be run with different configuration outlined below.
mix coveralls.html --umbrella
Lint the Elixir code.
mix credo --strict
Run the dialyzer.
mix dialyzer --halt-exit-status
Check the Elixir code for vulnerabilities.
cd apps/explorer && mix sobelow --config; cd -
cd apps/block_scout_web && mix sobelow --config; cd -
cd apps/block_scout_web/assets && npm run eslint; cd -
cd apps/block_scout_web/assets && npm run test; cd -
This is the default setup.
mix coveralls.html --umbrella will work on its own, but to be explicit, use the following setup:
export ETHEREUM_JSONRPC_CASE=EthereumJSONRPC.Case.Parity.Mox export ETHEREUM_JSONRPC_WEB_SOCKET_CASE=EthereumJSONRPC.WebSocket.Case.Mox mix coveralls.html --umbrella --exclude no_parity
HTTP / WebSocket
export ETHEREUM_JSONRPC_CASE=EthereumJSONRPC.Case.Parity.HTTPWebSocket export ETHEREUM_JSONRPC_WEB_SOCKET_CASE=EthereumJSONRPC.WebSocket.Case.Parity mix coveralls.html --umbrella --exclude no_parity
export ETHEREUM_JSONRPC_CASE=EthereumJSONRPC.Case.Geth.Mox export ETHEREUM_JSONRPC_WEB_SOCKET_CASE=EthereumJSONRPC.WebSocket.Case.Mox mix coveralls.html --umbrella --exclude no_geth
HTTP / WebSocket
export ETHEREUM_JSONRPC_CASE=EthereumJSONRPC.Case.Geth.HTTPWebSocket export ETHEREUM_JSONRPC_WEB_SOCKET_CASE=EthereumJSONRPC.WebSocket.Case.Geth mix coveralls.html --umbrella --exclude no_geth
To view Modules and API Reference documentation:
- Generate documentation.
- View the generated docs.
This folder contains all scripts that can be reused in any page or can be used as a helper to some component.
This folder contains the scripts that are specific for some page.
This project uses Redux to control the state in some pages. There are pages that have things happening in real-time thanks to the Phoenix channels, e.g. Address page, so the page state changes a lot depending on which events it is listening. The redux is also used to load some contents asynchronous, see async_listing_load.js.
To understand how to build new pages that need redux in this project, see the redux_helpers.js
The app is currently internationalized. It is only localized to U.S. English. To translate new strings.
- To setup translation file.
cd apps/block_scout_web; mix gettext.extract --merge; cd -
- To edit the new strings, go to
BlockScout is setup to export Prometheus metrics at
- Install prometheus:
brew install prometheus
- Start the web server
iex -S mix phx.server
- Start prometheus:
- Install grafana:
brew install grafana
- Install Pie Chart panel plugin:
grafana-cli plugins install grafana-piechart-panel
- Start grafana:
brew services start grafana
- Add Prometheus as a Data Source
- Click "+ Add data source"
- Put "Prometheus" for "Name"
- Change "Type" to "Prometheus"
- Set "URL" to "http://localhost:9090"
- Set "Scrape Interval" to "10s"
- Add the dashboards from https://github.com/deadtrickster/beam-dashboards:
*.jsonfile in the repo.
- Copy the contents of the JSON file in the "Or paste JSON" entry
- Click "Load"
- View the dashboards. (You will need to click-around and use BlockScout for the web-related metrics to show up.)
Blockscout supports tracing via
Spandex. Each application
has its own tracer, that is configured internally to that application. In order
to enable it, visit each application's
config/<env>.ex and update its tracer
configuration to change
disabled?: true to
disabled?: false. Do this for
each application you'd like included in your trace data.
Currently, only Datadog is supported as a tracing backend, but more will be added soon.
If you would like to use DataDog, after enabling
"DATADOG_PORT" environment variables to the
host/port that your Datadog agent is running on. For more information on
Datadog and the Datadog agent, see their
If you want to use a different backend, remove the
Explorer.Application and follow any instructions provided in
for setting up that backend.
The work queues for building the index of all blocks, balances (coin and token), and internal transactions can grow quite large. By default, the soft-limit is 1 GiB, which can be changed in
config :indexer, memory_limit: 1 <<< 30
Memory usage is checked once per minute. If the soft-limit is reached, the shrinkable work queues will shed half their load. The shed load will be restored from the database, the same as when a restart of the server occurs, so rebuilding the work queue will be slower, but use less memory.
If all queues are at their minimum size, then no more memory can be reclaimed and an error will be logged.
We would like to thank the EthPrize foundation for their funding support.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.