{"id":20433863,"url":"https://github.com/flashbots/relayscan","last_synced_at":"2025-04-07T19:12:52.449Z","repository":{"id":65847574,"uuid":"596462331","full_name":"flashbots/relayscan","owner":"flashbots","description":"Ethereum MEV-Boost Relay Monitoring","archived":false,"fork":false,"pushed_at":"2025-01-09T17:05:18.000Z","size":3019,"stargazers_count":81,"open_issues_count":9,"forks_count":13,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-03-31T18:22:11.679Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.relayscan.io","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flashbots.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-02T08:31:50.000Z","updated_at":"2025-01-23T17:49:24.000Z","dependencies_parsed_at":"2024-01-05T10:37:27.777Z","dependency_job_id":"424f29cf-46b5-4acd-93d0-eef0ebf5c67e","html_url":"https://github.com/flashbots/relayscan","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Frelayscan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Frelayscan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Frelayscan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Frelayscan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flashbots","download_url":"https://codeload.github.com/flashbots/relayscan/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247713258,"owners_count":20983683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T08:21:52.168Z","updated_at":"2025-04-07T19:12:52.273Z","avatar_url":"https://github.com/flashbots.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# relayscan\n\n[![Goreport status](https://goreportcard.com/badge/github.com/flashbots/relayscan)](https://goreportcard.com/report/github.com/flashbots/relayscan)\n[![Test status](https://github.com/flashbots/relayscan/workflows/Checks/badge.svg)](https://github.com/flashbots/relayscan/actions?query=workflow%3A%22Checks%22)\n[![Docker hub](https://badgen.net/docker/size/flashbots/relayscan?icon=docker\u0026label=image)](https://hub.docker.com/r/flashbots/relayscan/tags)\n\nMonitoring, analytics \u0026 data for Ethereum MEV-Boost builders and relays\n\n**Running on https://relayscan.io**\n\nAdditional URLs:\n\n- Builder profit:\n  - Last 24h: https://www.relayscan.io/builder-profit?t=24h\n  - Last 7d: https://www.relayscan.io/builder-profit?t=7d\n- Current stats in markdown:\n  - https://www.relayscan.io/overview/md\n  - https://www.relayscan.io/builder-profit/md\n- Daily stats:\n  - https://www.relayscan.io/stats/day/2023-06-20\n  - https://www.relayscan.io/stats/day/2023-06-20/json\n\n**Bid Archive**\n\nhttps://bidarchive.relayscan.io\n\n## Notes\n\n- Work in progress\n- At it's core, a set of tools to fill and show a postgres database\n- 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)\n- Comments and feature requests: [@relayscan_io](https://twitter.com/relayscan_io)\n- License: AGPL\n- Maintainer: [@metachris](https://twitter.com/metachris)\n\n---\n\n## Overview\n\n* Uses PostgreSQL as data store\n* Configuration:\n  * Relays in [`/vars/relays.go`](/vars/relays.go)\n  * Builder aliases in [`/vars/builder_aliases.go`](/vars/builder_aliases.go)\n  * Version and common env vars in [`/vars/vars.go`](/vars/vars.go)\n* Some environment variables are required, see [`.env.example`](/.env.example)\n* Saving and checking payloads is split into phases/commands:\n  * [`data-api-backfill`](/cmd/core/data-api-backfill.go) -- queries the data API of all relays and puts that data into the database\n  * [`check-payload-value`](/cmd/core/check-payload-value.go) -- checks all new database entries for payment validity\n  * [`update-builder-stats`](/cmd/core/update-builder-stats.go) -- create daily builder stats and save to database\n\n\n## Getting started\n\n### Run\n\nYou can either build relayscan from the repository, or use the Docker image:\n\n```bash\n# Build \u0026 run\nmake build\n./relayscan help\n./relayscan version\n\n# Run with Docker\ndocker run flashbots/relayscan\ndocker run flashbots/relayscan /app/relayscan version\n```\n\nMore example commands:\n\n```bash\n# Grab delivered payloads from relays data API, and fill up database\n./relayscan core data-api-backfill                     #  for all slots since the merge\n./relayscan core data-api-backfill --min-slot 9590900  #  since a given slot (good for dev/testing)\n\n# Double-check new entries for valid payments (and other)\n./relayscan core check-payload-value\n\n# Update daily builder inclusion stats\n./relayscan core update-builder-stats --start 2023-06-04 --end 2023-06-06  # update daily stats for 2023-06-04 and 2023-06-05\n./relayscan core update-builder-stats --start 2023-06-04                   # update daily stats for 2023-06-04 until today\n./relayscan core update-builder-stats --backfill                           # update daily stats since last entry, until today\n\n# Start the website (--dev reloads the template on every page load, for easier iteration)\n./relayscan service website --dev\n```\n\n### Test \u0026 development\n\nStart by filling the DB with relay data (delivered payloads), and checking it:\n\n```bash\n# Copy .env.example to .env.local, update ETH_NODE_URI and source it\nsource .env.local\n\n# Start Postgres Docker container\nmake dev-postgres-start\n\n# Query only a single relay, and for the shortest time possible\ngo run . core data-api-backfill --relay fb --min-slot -2000\n\n# Now the DB has data, check it (and update in DB)\ngo run . core check-payload-value\n\n# Can also check a single slot only:\ngo run . core check-payload-value --slot _N_\n\n# Reset DB\ndev-postgres-wipe\n\n# See the Makefile for more commands\nmake help\n```\n\nFor linting and testing:\n\n```bash\n# Install dependencies\ngo install mvdan.cc/gofumpt@latest\ngo install honnef.co/go/tools/cmd/staticcheck@v0.4.3\ngo install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2\n\n# Lint and test\nmake lint\nmake test\nmake test-race\n\n# Format the code\nmake fmt\n```\n\n\n### Updating relayscan\n\nNotes for updating relayscan:\n\n- Relay payloads are selected by `inserted_at`. When adding a new relay, you probably want to manually subtract a day from `inserted_at` so 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 https://github.com/flashbots/relayscan/issues/28\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflashbots%2Frelayscan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflashbots%2Frelayscan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflashbots%2Frelayscan/lists"}