Skip to content

scroll-tech/rollup-explorer-backend

Repository files navigation

Scroll's Rollup Explorer Backend

Main Test Status Audit Status Rust Nightly

Purpose

This repo contains the backend code for the Rollup Explorer that's currently maintained by Scroll.

License

MIT.

Contributing

If you encounter bugs or have feature ideas, feel free to create an issue or write a PR.

Prerequisites

Naturally, you will need the Rust toolchain installed. Besides that, goose is necessary for external database migrations in database dictionary of scroll.

ENV

  • BIND_PORT: Internal binding HTTP port (5001 as default).
  • DB_URL: The database URL used to connect.
  • OPEN_API_ADDR: Open API URL displayed on Web UI.
  • MAX_PER_PAGE: Max value of query parameter per_page (100 as default)

Development

  • make start: Start a local Postgres docker-container, and cargo run --bin rollup_explorer. Then URL http://0.0.0.0:5001 could be accessed in a Web browser.

  • make stop: Stop running rollup_explorer processes and Postgres docker-container. The Postgres data should also be cleared via deleting folder docker-data.

  • make lint: Format and lint codes.

  • make shfmt: Format Shell scripts.

Adding Mock Data

Run the following:

psql postgres://postgres:scroll2022@localhost:5434/scroll -f db/tests/test.sql

Deployment

Currently deployed by Scroll's devops and used by https://scroll.io/rollupscan.