{"id":34160605,"url":"https://github.com/flashbots/builder-hub","last_synced_at":"2026-03-11T12:50:14.941Z","repository":{"id":265769634,"uuid":"859298549","full_name":"flashbots/builder-hub","owner":"flashbots","description":"BuilderHub service for provisioning and permissioning BuilderNet instances","archived":false,"fork":false,"pushed_at":"2026-02-03T14:31:32.000Z","size":247,"stargazers_count":16,"open_issues_count":1,"forks_count":2,"subscribers_count":6,"default_branch":"main","last_synced_at":"2026-02-04T01:10:14.164Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://buildernet.org","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2024-09-18T12:34:02.000Z","updated_at":"2026-02-03T14:33:37.000Z","dependencies_parsed_at":"2026-01-07T19:08:43.085Z","dependency_job_id":null,"html_url":"https://github.com/flashbots/builder-hub","commit_stats":null,"previous_names":["flashbots/builder-hub"],"tags_count":6,"template":false,"template_full_name":"flashbots/go-template","purl":"pkg:github/flashbots/builder-hub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fbuilder-hub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fbuilder-hub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fbuilder-hub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fbuilder-hub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flashbots","download_url":"https://codeload.github.com/flashbots/builder-hub/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fbuilder-hub/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30381733,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T06:09:32.197Z","status":"ssl_error","status_checked_at":"2026-03-11T06:09:17.086Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2025-12-15T08:35:52.493Z","updated_at":"2026-03-11T12:50:14.929Z","avatar_url":"https://github.com/flashbots.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BuilderHub\n\n[![Goreport status](https://goreportcard.com/badge/github.com/flashbots/builder-hub)](https://goreportcard.com/report/github.com/flashbots/builder-hub)\n[![Test status](https://github.com/flashbots/builder-hub/actions/workflows/checks.yml/badge.svg?branch=main)](https://github.com/flashbots/builder-hub/actions?query=workflow%3A%22Checks%22)\n[![Docker hub](https://badgen.net/docker/size/flashbots/builder-hub?icon=docker\u0026label=image)](https://hub.docker.com/r/flashbots/builder-hub/tags)\n\nBuilderHub is the central data source for BuilderNet builder registration and configuration.\n\nDocs here: https://buildernet.org/docs/flashbots-infra\n\nBuilderHub has these responsibilities:\n\n1. Builder identity management\n2. Provisioning of secrets and configuration\n3. Peer discovery\n\n---\n\n![Architecture](https://buildernet.org/assets/ideal-img/flashbots-infra-dataflow.7377b1f.3909.png)\n\n---\n\n## Getting started\n\n\n### Admin authentication\n\nThe Admin API (port 8081) requires HTTP Basic Auth. Configure via env vars or flags:\n\n- `ADMIN_BASIC_USER` (default: `admin`)\n- `ADMIN_BASIC_PASSWORD_BCRYPT` (bcrypt hash of the password; required)\n\nGenerate a bcrypt hash (example using htpasswd):\n\n```bash\nhtpasswd -nbBC 10 \"\" 'secret' | cut -d: -f2\n```\n\nRun with:\n\n```bash\nexport ADMIN_BASIC_USER=admin\nexport ADMIN_BASIC_PASSWORD_BCRYPT='$2y$12$...'\ngo run cmd/httpserver/main.go\n```\n\nUse Basic Auth when calling admin endpoints, e.g.:\n\n```bash\ncurl -u admin:secret http://localhost:8081/api/admin/v1/measurements\n```\n\nLocal development only: you can disable Admin API auth with `--disable-admin-auth` or `DISABLE_ADMIN_AUTH=1`. This is unsafe; never use in production.\n\n### Manual setup\n\n**Start the database and the server:**\n\n```bash\n# Start a Postgres database container\ndocker run -d --name postgres-test -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgres postgres\n\n# Apply the DB migrations\nfor file in schema/*.sql; do psql \"postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable\" -f $file; done\n\n# Start the server\ngo run cmd/httpserver/main.go\n```\n\n### Using Docker\n\n- See instructions on using Docker to run the full stack at [`docs/devenv-setup.md`](./docs/devenv-setup.md)\n- Also check out the [`docker-compose.yaml`](../docker/docker-compose.yaml) file, which sets up the BuilderHub, a mock proxy, and a Postgres database.\n- Finally, there's an e2e api spec test suite you can run: [`./scripts/ci/integration-test.sh`](./scripts/ci/integration-test.sh)\n\n### Example requests\n\n```bash\n# Public endpoints\ncurl localhost:8080/api/l1-builder/v1/measurements\n\n# client-aTLS secured endpoints\ncurl localhost:8080/api/l1-builder/v1/builders\ncurl localhost:8080/api/l1-builder/v1/configuration\ncurl -X POST localhost:8080/api/l1-builder/v1/register_credentials/rbuilder\n```\n\n### Testing\n\nRun test suite with database tests included:\n\n```bash\nRUN_DB_TESTS=1 make test\n```\n\n---\n\n## Contributing\n\n**Install dev dependencies**\n\n```bash\ngo install mvdan.cc/gofumpt@v0.4.0\ngo install honnef.co/go/tools/cmd/staticcheck@v0.4.2\ngo install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.3\ngo install go.uber.org/nilaway/cmd/nilaway@v0.0.0-20240821220108-c91e71c080b7\ngo install github.com/daixiang0/gci@v0.11.2\n```\n\n**Lint, test, format**\n\n```bash\nmake lint\nmake test\nmake fmt\n```\n\n---\n\n## API Documentation\n\n`BuilderHub` exposes a JSON+REST API with these methods:\n\n| API                      | Exposure | Authentication               | Requested by                  | Served by              |\n| ------------------------ | -------- | ---------------------------- | ----------------------------- | ---------------------- |\n| Get Secrets + Config     | TDX Node | IP + Client-ATLS Attestation | Builder (via cvm-proxy)       | cvm-proxy → BuilderHub |\n| Register Credentials     | TDX Node | IP + Client-ATLS Attestation | Builder (via cvm-proxy)       | cvm-proxy → BuilderHub |\n| Get Active Builders      | TDX Node | IP + Client-ATLS Attestation | Builder (via cvm-proxy)       | cvm-proxy → BuilderHub |\n| Get Active Builders      | Internal | HTTP Basic Auth              | MEV-Share, block processor, … | BuilderHub             |\n| Get Allowed Measurements | Internal | HTTP Basic Auth              | Users, Builders               | nginx → BuilderHub     |\n| Admin Endpoints          | Internal | HTTP Basic Auth              |                               |                        |\n\nSee also a [Bruno collection](https://www.usebruno.com/) (Postman alternative) in [`docs/api-docs/`](./docs/api-docs/).\n\n---\n\n### Get Secrets + Configuration\n\n`GET /api/l1-builder/v1/configuration`\n\nAuth:\n\n- IP + Client-ATLS Attestation\n\nResponse: [testdata/get-configuration.json](https://github.com/flashbots/builder-config-hub/blob/main/testdata/get-configuration.json)\n\n---\n\n### Register Credentials\n\n`POST /api/l1-builder/v1/register_credentials/\u003cSERVICE\u003e`\n\nAuth:\n\n- IP + Client-ATLS Attestation\n\nRequest:\n\n- [service: `instance`]: TLS cert\n\n    ```json\n    {\n    \t\"tls_cert\": string (\\n instead of newlines)\n    }\n    ```\n\n- [service: `orderflow_proxy`]: ECDSA pubkey address (for orderflow)\n\n    ```json\n    {\n    \t\"ecdsa_pubkey_address\": string\n    }\n    ```\n\n- [service: `rbuilder`]: ECDSA pubkey address (for bids)\n\n    ```json\n    {\n    \t\"ecdsa_pubkey_address\": string\n    }\n    ```\n\n\nResponse: 200 OK\n\n---\n\n### Get Active Builders\n\n`GET /api/l1-builder/v1/builders` (external, requests from builder via cvm-proxy)\n\n`GET /api/internal/l1-builder/v1/builders` (internal, no auth, uses `production` network by default)\n\n`GET /api/internal/l1-builder/v2/network/{network}/builders` (internal, no auth, for specific peer network)\n\nResponse: [testdata/get-builders.json](https://github.com/flashbots/builder-config-hub/blob/main/testdata/get-builders.json)\n\n---\n\n### Get Allowed Measurements\n\nAuth: public\n\n`GET /api/l1-builder/v1/measurements`\n\nResponse: Array with currently allowed measurement JSONs\n\n[testdata/get-measurements.json](https://github.com/flashbots/builder-config-hub/blob/main/testdata/get-measurements.json)\n\n---\n\n## Admin Endpoints\n\n### Add measurements\n\n(created disabled by default)\n\n`POST /api/admin/v1/measurements`\n\nPayload\n\n```json\n{\n\t\"measurement_id\": \"v1.2.3-20241010-rc1\",\n\t\"attestation_type\": \"azure-tdx\",\n\t\"measurements\": {\n\t\t\"11\": {\n\t\t    \"expected_any\": [\"efa43e0beff151b0f251c4abf48152382b1452b4414dbd737b4127de05ca31f7\", \"abc123...\"]\n\t    },\n\t\t\"4\": {\n\t\t    \"expected\": \"ea92ff762767eae6316794f1641c485d4846bc2b9df2eab6ba7f630ce6f4d66f\"\n\t    }\n  }\n}\n```\n\nTwo fields are available for specifying expected values:\n- `expected` (string): A single expected value\n- `expected_any` (array): Multiple expected values - any matching value is accepted (OR semantics)\n\nUse `expected_any` when multiple firmware versions or configurations should be accepted for a single measurement key.\n\nNote that only the measurements given are expected, and any non-present will be ignored.\n\nTo allow _any_ measurement, use an empty measurements field:\n`\"measurements\": {}`.\n\n```json\n{\n    \"measurement_id\": \"test-blanket-allow\",\n    \"attestation_type\": \"azure-tdx\",\n    \"measurements\": {}\n}\n```\n\n### Enable/disable measurements\n\n`POST /api/admin/v1/measurements/activation/{measurement_id}`\n\n```json\n{\n  \"enabled\": true\n}\n```\n\n### Adding a new builder instance\n\n(created inactive by default)\n\n`POST /api/admin/v1/builders/`\n\nPayload\n\n```json\n{\n\t\"name\": string,\n\t\"ip_address\": string\n}\n```\n\n### Enable/disable builder instance\n\n`POST /api/admin/v1/builders/activation/{builder_name}`\n\n```json\n{\n  \"enabled\": true\n}\n```\n\nErrors:\n\n- if no active configuration available\n\n### Get builder configuration\n\n`GET /api/admin/v1/builders/configuration/{builder_name}/active`\n\ngets always the latest/active configuration\n\n### Get builder configuration with secrets\n\n`GET /api/admin/v1/builders/configuration/{builder_name}/full`\n\ngets always the latest/active configuration\n\n### Update builder configuration\n\nif valid JSON, will create a new active configuration and disable the old configuration\n\n`POST /api/admin/v1/builders/configuration/{builder_name}`\n\n```json\n{\n  ...\n}\n```\n\n### Update secrets configuration\n\nPOST `/api/admin/v1/builders/secrets/{builderName}`\n\nPayload: JSON with secrets, both flattened/unflattened\n\n```json\n{\n    ...\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflashbots%2Fbuilder-hub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflashbots%2Fbuilder-hub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflashbots%2Fbuilder-hub/lists"}