Blockchain explorer for Ethereum based network and a tool for inspecting and analyzing EVM based blockchains.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
blockscout/docs/manual-deployment.md

3.6 KiB

Manual Deployment

Below is the procedure for manual deployment of BlockScout. For automated deployment, see ansible deployment.

BlockScout currently requires a full archive node in order to import every state change for every address on the target network. For client specific settings related to a node running parity or geth, please see this forum post.

Deployment Steps

  1. git clone https://github.com/poanetwork/blockscout

  2. cd blockscout

  3. Setup 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

  4. Update apps/explorer/config/dev.secret.exs

    Linux: Update the database username and password configuration

    Mac: Remove the username and password fields

    Optional: Set up a 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.

  5. If you have deployed previously, delete the apps/block_scout_web/priv/static folder. This removes static assets from the previous build.

  6. Install dependencies. mix do deps.get, local.rebar --force, deps.compile, compile

  7. If not already running, start postgres: pg_ctl -D /usr/local/var/postgres start

    [!TIP] To check postgres status: pg_isready

  8. Create and migrate database mix do ecto.create, ecto.migrate

    [!NOTE] If you have run previously, drop the previous database mix do ecto.drop, ecto.create, ecto.migrate

  9. Install Node.js dependencies

    • cd apps/block_scout_web/assets; npm install && node_modules/webpack/bin/webpack.js --mode production; cd -

    • cd apps/explorer && npm install; cd -

  10. Enable HTTPS in development. The Phoenix server only runs with HTTPS.

    • cd apps/block_scout_web
    • mix phx.gen.cert blockscout blockscout.local; cd -
    • Add blockscout and blockscout.local to your /etc/hosts

   127.0.0.1       localhost blockscout blockscout.local

   255.255.255.255 broadcasthost

   ::1             localhost blockscout blockscout.local

[!NOTE] If using Chrome, Enable chrome://flags/#allow-insecure-localhost

  1. Set your environment variables as needed.

CLI Example:

export COIN=DAI
export NETWORK_ICON=_network_icon.html
export ... 

[!NOTE] The ETHEREUM_JSONRPC_VARIANT will vary depending on your client (parity, geth etc). See this forum post for more information on client settings.

  1. Return to the root directory and start the Phoenix Server. mix phx.server

Check your instance:

  1. Check that there are no visual artifacts, all assets exist and there are no database errors.

  2. If there are no errors, stop BlockScout (ctrl+c)

  3. Build static assets for deployment mix phx.digest

  4. Delete build artifacts:

    a. Script: ./rel/commands/clear_build.sh

    b. Manually:

    • delete _build & deps directories
    • delete node modules located at
    • apps/block_scout_web/assets/node_modules
    • & apps/explorer/node_modules
    • delete logs/dev directory