Deploy Blockscout with a user-friendly UI and all microservices
.tool-versions
file. Additional Instructions for setting up the environment are available for Ubuntu and MacOS.
Dependency | Mac | Linux |
---|---|---|
Erlang/OTP 26 | brew install erlang | Erlang Install Example |
Elixir 1.15.x | brew install elixir | Elixir Install Example |
Postgres 12, 13, 14 | brew install postgresql | Postgres Install Example |
Node.js 18.x.x | brew install node | Node.js Install Example |
Automake | brew install automake | Automake Install Example |
Libtool | brew install libtool | Libtool Install Example |
Inotify-tools | Not Required | Ubuntu - apt-get install inotify-tools |
GCC Compiler | brew install gcc | GCC Compiler Example |
GMP | brew install gmp | Install GMP Devel |
Make | - | sudo apt install make if Debian 9 |
G++ Compiler | - | sudo apt install g++ if Debian 9 |
git clone https://github.com/blockscout/blockscout blockscout-backend
2) Change directories
cd blockscout-backend
3) Provide DB URL with your username export DATABASE_URL=postgresql://username:password@localhost:5432/blockscout
export DATABASE_URL=postgresql://username:@localhost:5432/blockscout
)apps/explorer/config/test.exs
for test env Example usage: Changing the default Postgres port from localhost:5432 if Boxen is installed.mix do deps.get, local.rebar --force, deps.compile
5) Generate a new secret_key_base for the DB
mix phx.gen.secret
6) Copy keybase and export as an env (for example)
export SECRET_KEY_BASE=VTIB3uHDNbvrY0+60ZWgUoUBKDn9ppLR8MI4CpRz4/qLyEFs54ktJfaNT6Z221No
7) Export remaining environment variables as needed.
CLI basic example:
ETHEREUM_JSONRPC_VARIANT
will vary depending on your client (nethermind, geth etc). More information on client settings.MIX_ENV=prod
. The current default is MIX_ENV=dev
which is a slower and less secure setting. However, for development purposes, unsetting or setting is MIX_ENV=dev
is preferred.mix compile
9) If not already running, start Postgres: pg_ctl -D /usr/local/var/postgres start
or brew services start postgresql
pg_isready
mix do ecto.create, ecto.migrate
mix do ecto.drop, ecto.create, ecto.migrate
Be careful since this will delete all data from the DB. Don’t execute it on production if you don’t want to lose all of the data!npm ci
rather than npm install
to strictly follow all package versions in package-lock.json.
cd apps/block_scout_web/assets; npm install && node_modules/webpack/bin/webpack.js --mode production; cd -
cd apps/explorer && npm install; cd -
12)
Build static assets for deployment
mix phx.digest
13) Enable HTTPS in development. The Phoenix server only runs with HTTPS.
cd apps/block_scout_web; mix phx.gen.cert blockscout blockscout.local; cd -
14) Add blockscout and blockscout.local to your /etc/hosts
chrome://flags/#allow-insecure-localhost
cd ./blockscout-backend/docker-compose
docker-compose -f microservices.yml up -d
{"status":"SERVING"}
{"status":"SERVING"}
{"status":"SERVING"}
.it should return the list of compilers (click to see the sample response)
docker-compose -f microservices.yml down
docker ps
to check which containers are not starting.Check logs with docker logs visualizer -f
MICROSERVICE_SC_VERIFIER
envs./blockscout-backend
mix phx.server
git clone https://github.com/blockscout/frontend blockscout-frontend
cd blockscout-frontend
touch .env
yarn install
yarn dev
http://localhost:3000