General deployment instructions for a hardware or cloud services environment
git clone https://github.com/blockscout/blockscout
2) cd blockscout
3) Provide DB URL: export DATABASE_URL=postgresql://user:password@localhost:5432/blockscout
apps/explorer/config/test.exs
for test envmix do deps.get, local.rebar --force, deps.compile
5) Generate a new secret_key_base for the DB by setting a corresponding ENV var:export SECRET_KEY_BASE=VTIB3uHDNbvrY0+60ZWgUoUBKDn9ppLR8MI4CpRz4/qLyEFs54ktJfaNT6Z221No
secret_key_base
run mix phx.gen.secret
mix phx.digest.clean
.
7) Set environment variables as needed.
CLI Example:
MIX_ENV=prod
during deployment. The current default is MIX_ENV=dev
which is a slower and less secure setting.ETHEREUM_JSONRPC_VARIANT
will vary depending on your client (nethermind, geth etc). More information on client settings.docker run -p 8050:8050 ghcr.io/blockscout/smart-contract-verifier:latest
cargo install --locked --git https://github.com/blockscout/blockscout-rs smart-contract-verifier-server
smart-contract-verifier-server
mix compile
10) If not already running, start Postgres: pg_ctl -D /usr/local/var/postgres start
pg_isready
mix do ecto.create, ecto.migrate
mix do ecto.drop, ecto.create, ecto.migrate
Be careful since it will delete all data from the DB. Don’t execute it on production if you don’t want to lose all 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 -
mix phx.digest
14) Enable HTTPS in development. The Phoenix server only runs with HTTPS.
cd apps/block_scout_web; mix phx.gen.cert blockscout blockscout.local; cd -
/etc/hosts
chrome://flags/#allow-insecure-localhost
mix phx.server
16) Check the Frontend Migration section if you would like to connect the enhanced frontend UI to the manually installed backend.