relayscan

command module
v1.8.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

README

relayscan

Goreport status Test status Docker hub

Monitoring, analytics & data for Ethereum MEV-Boost builders and relays

Running on https://relayscan.io

Additional URLs:

Bid Archive

https://bidarchive.relayscan.io

Notes

  • 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

Overview

Getting started

Run

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

---

# 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 6658658  #  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

You might want to run Postgres locally for testing:

docker run -d -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgres postgres
Test & dev
# 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, test and build
make lint
make test
make test-race
make build
Updating relayscan

Notes for updating relayscan:

  • 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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
Package cmd contains the cobra command line setup
Package cmd contains the cobra command line setup
core
Package core contains code for the core subcommands
Package core contains code for the core subcommands
service
Package service contains code for the service subcommands
Package service contains code for the service subcommands
util
Package util contains code for the util subcommands
Package util contains code for the util subcommands
Package common includes common utilities
Package common includes common utilities
Package database exposes the postgres database
Package database exposes the postgres database
services
bidcollect
Package bidcollect contains code for bid collection from various sources.
Package bidcollect contains code for bid collection from various sources.
bidcollect/website
Package website contains the service delivering the website
Package website contains the service delivering the website
collector
Package collector collects data from the relays
Package collector collects data from the relays
website
Package website contains the service delivering the website
Package website contains the service delivering the website
Package vars contains global variables and configuration
Package vars contains global variables and configuration

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL