Goreport status Test status Docker hub
Monitoring, analytics & data for Ethereum MEV-Boost builders and relays
Running on https://relayscan.io
Additional URLs:
- Builder profit:
- Stats in markdown:
- Stats in JSON:
- Daily stats:
Bid Archive
https://bidarchive.relayscan.io
- Work in progress
- At it's core, a set of tools to fill and show a postgres database
- Multiple relays can serve a payload for the same slot (if the winning builder sent the best bid to multiple relays, and the proposer asks for a payload from all of them)
- Comments and feature requests: @relayscan_io
- License: AGPL
- Maintainer: @metachris
- Uses PostgreSQL as data store
- Configuration:
- Relays and builder addresses in
config-mainnet.yaml - Builder aliases in
/vars/builder_aliases.go - Version and common env vars in
/vars/vars.go
- Relays and builder addresses in
- Some environment variables are required, see
.env.example
Relay URLs and builder addresses are configured via a YAML config file. By default, config-mainnet.yaml is used.
# Use default config (config-mainnet.yaml) ./relayscan <command> # Use a custom config file ./relayscan --config config-hoodi.yaml <command> # Or via environment variable CONFIG_FILE=config-hoodi.yaml ./relayscan <command>
- Saving and checking payloads is split into phases/commands:
data-api-backfill-- queries the data API of all relays and puts that data into the databasecheck-payload-value-- checks all new database entries for payment validityupdate-builder-stats-- create daily builder stats and save to database
You can either build relayscan from the repository, or use the Docker image:
# Build & run make build ./relayscan help ./relayscan version # Run with Docker docker run flashbots/relayscan docker run flashbots/relayscan /app/relayscan version
More example commands:
# Grab delivered payloads from relays data API, and fill up database ./relayscan core data-api-backfill # for all slots since the merge ./relayscan core data-api-backfill --min-slot 9590900 # since a given slot (good for dev/testing) # Double-check new entries for valid payments (and other) ./relayscan core check-payload-value # Update daily builder inclusion stats ./relayscan core update-builder-stats --start 2023年06月04日 --end 2023年06月06日 # update daily stats for 2023年06月04日 and 2023年06月05日 ./relayscan core update-builder-stats --start 2023年06月04日 # update daily stats for 2023年06月04日 until today ./relayscan core update-builder-stats --backfill # update daily stats since last entry, until today # Start the website (--dev reloads the template on every page load, for easier iteration) ./relayscan service website --dev # # backfill-runner: Backfill + Check Service # - a single service to continuously run these # - default interval: 5 minutes # # Test with just one relay (flashbots) ./relayscan service backfill-runner --relay fb # Test with ultrasound relay and limited slots (last 50 slots) ./relayscan service backfill-runner --relay us --min-slot -50 # Combine flags for quick testing ./relayscan service backfill-runner --relay fb --min-slot -50 --skip-check-value # Custom interval ./relayscan service backfill-runner --interval 10m # Run once and exit (useful for testing) ./relayscan service backfill-runner --once # Skip one of the steps ./relayscan service backfill-runner --skip-backfill ./relayscan service backfill-runner --skip-check-value
Start by filling the DB with relay data (delivered payloads), and checking it:
# Copy .env.example to .env.local, update ETH_NODE_URI and source it source .env.local # Start Postgres Docker container make dev-postgres-start # Query only a single relay, and for the shortest time possible go run . core data-api-backfill --relay us --min-slot -2000 # Now the DB has data, check it (and update in DB) go run . core check-payload-value # Can also check a single slot only: go run . core check-payload-value --slot <your_slot> # Run the website go run . service website --dev # Simplify working with read-only DB or large amount of data: DB_DONT_APPLY_SCHEMA=1 SKIP_7D_STATS=1 go run . service website --dev # Now you can open http://localhost:9060 in your browser and see the data open http://localhost:9060 # You can also reset the database: make dev-postgres-wipe # See the Makefile for more commands make help
For linting and testing:
# Install dependencies go install mvdan.cc/gofumpt@latest go install honnef.co/go/tools/cmd/staticcheck@v0.4.3 go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2 # Lint and test make lint make test make test-race # Format the code make fmt
Notes for updating relayscan:
- Relay payloads are selected by
inserted_at. When adding a new relay, you probably want to manually subtract a day frominserted_atso they don't show up all for today (UPDATE mainnet_data_api_payload_delivered SET inserted_at = inserted_at - INTERVAL '1 DAY' WHERE relay='newrelay.xyz';). See also #28