# Do you want to run a builder?

**URL:** https://collective.flashbots.net/t/do-you-want-to-run-a-builder/212
**Category:** Block Builders
**Tags:** question
**Created:** [September 5, 2022, 6:56pm UTC](https://collective.flashbots.net/t/do-you-want-to-run-a-builder/212 "2022-09-05T18:56:38Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![guayabyte](https://collective.flashbots.net/user_avatar/collective.flashbots.net/guayabyte/32/4_2.png) [@guayabyte](https://collective.flashbots.net/u/guayabyte)
#### Post date: [September 5, 2022, 6:56pm UTC](https://collective.flashbots.net/t/do-you-want-to-run-a-builder/212/1 "2022-09-05T18:56:39Z")

</div>

If so, please tell us more here:

> <https://github.com/flashbots/mev-boost/issues/145>
>
> So, we heard you want to run a builder! Tell us more :)
> 
> The \[builder API spec…ification\](https://ethereum.github.io/builder-specs/) is open and every validator can select their own builders. However, there are still open questions that we need to resolve with the humans in the ethereum ecosystem to get a permissionless and fully decentralized design. Following \[the plan\](https://github.com/flashbots/mev-boost/wiki/The-Plan-(tm)) towards proposer/builder separation we are \[researching and prototyping\](https://github.com/flashbots/mev-boost/wiki/Research) solutions for decentralization. Coming next is the addition of independent block builders to the Flashbots relay. You can find the initial \[Relay API specification here\](https://flashbots.notion.site/Relay-API-Spec-5fb0819366954962bc02e81cb33840f5), which outlines how builders can interact with the Flashbots Relay.
> 
> Tell us more about who you are, what is your role in the ecosystem, how will you profit from running a builder, how are you going to contribute to answer the \[open questions\](https://github.com/flashbots/mev-boost/wiki/Research#open-questions), in order to get us to the trustless proposer/builder separation. Leave a comment in this issue so we can talk about collaboration.

---

<div class="post-metadata">

### Author: ![vishal](https://collective.flashbots.net/letter_avatar_proxy/v4/letter/v/49beb7/32.png) [@vishal](https://collective.flashbots.net/u/vishal)
#### Post date: [September 10, 2022, 11:03pm UTC](https://collective.flashbots.net/t/do-you-want-to-run-a-builder/212/2 "2022-09-10T23:03:30Z")

</div>

Yes I am interested. I find playing with Ethereum ecosystem very exciting. What software I need to build my own builder ? I see lots of documentation around but I am more of a install the SW , roll up the sleeves and learn.

---

<div class="post-metadata">

### Author: ![guayabyte](https://collective.flashbots.net/user_avatar/collective.flashbots.net/guayabyte/32/4_2.png) [@guayabyte](https://collective.flashbots.net/u/guayabyte)
#### Post date: [September 12, 2022, 2:01pm UTC](https://collective.flashbots.net/t/do-you-want-to-run-a-builder/212/3 "2022-09-12T14:01:28Z")

</div>

Hello @vishal. See here: [GitHub - flashbots/boost-geth-builder: Example builder](https://collective.flashbots.net/t/github-flashbots-boost-geth-builder-example-builder/139)

You can ask your questions, if any, in that thread.

---

<div class="post-metadata">

### Author: ![vishal](https://collective.flashbots.net/letter_avatar_proxy/v4/letter/v/49beb7/32.png) [@vishal](https://collective.flashbots.net/u/vishal)
#### Post date: [September 12, 2022, 11:11pm UTC](https://collective.flashbots.net/t/do-you-want-to-run-a-builder/212/4 "2022-09-12T23:11:23Z")

</div>

Thank you.

---

<div class="post-metadata">

### Author: ![metachris](https://collective.flashbots.net/user_avatar/collective.flashbots.net/metachris/32/6_2.png) [@metachris](https://collective.flashbots.net/u/metachris)
#### Post date: [September 13, 2022, 8:39am UTC](https://collective.flashbots.net/t/do-you-want-to-run-a-builder/212/5 "2022-09-13T08:39:36Z")

</div>

In addition to our Goerli relay, **we’ve now also opened block submissions on our [Sepolia relay](https://builder-relay-sepolia.flashbots.net/)** (where our relay delivers about 1 in 5 blocks).

**Sepolia relay block submission endpoints:**

- `getValidators`: [https://builder-relay-sepolia.flashbots.net/relay/v1/builder/validators](https://builder-relay-sepolia.flashbots.net/relay/v1/builder/validators) (GET) - array of proposer preferences for registered validators with assigned duties in the current and next epoch
- `submitBlock`: [https://builder-relay-sepolia.flashbots.net/relay/v1/builder/blocks](https://builder-relay-sepolia.flashbots.net/relay/v1/builder/blocks) (POST)

**Goerli relay block submission endpoints:**

- `getValidators`: [https://builder-relay-goerli.flashbots.net/relay/v1/builder/validators](https://builder-relay-goerli.flashbots.net/relay/v1/builder/validators) (GET) - array of proposer preferences for registered validators with assigned duties in the current and next epoch
- `submitBlock`: [https://builder-relay-goerli.flashbots.net/relay/v1/builder/blocks](https://builder-relay-goerli.flashbots.net/relay/v1/builder/blocks) (POST)

**See also:**

- [Relay API documentation - Block Builder API](https://bit.ly/3BmGZ3T)

* * *

Note: Submissions are currently rate-limited to 60 requests / minute / IP address.

---

<div class="post-metadata">

### Author: ![metachris](https://collective.flashbots.net/user_avatar/collective.flashbots.net/metachris/32/6_2.png) [@metachris](https://collective.flashbots.net/u/metachris)
#### Post date: [September 13, 2022, 8:40am UTC](https://collective.flashbots.net/t/do-you-want-to-run-a-builder/212/6 "2022-09-13T08:40:53Z")

</div>

Btw, the Flashbots mainnet relay will also allow external builder submissions from the get-go (the merge), in the same way as our testnet relays.

---

<div class="post-metadata">

### Author: ![metachris](https://collective.flashbots.net/user_avatar/collective.flashbots.net/metachris/32/6_2.png) [@metachris](https://collective.flashbots.net/u/metachris)
#### Post date: [September 14, 2022, 9:26am UTC](https://collective.flashbots.net/t/do-you-want-to-run-a-builder/212/7 "2022-09-14T09:26:54Z")

</div>

**Mainnet relay block submission endpoints:**

- `getValidators`: [https://boost-relay.flashbots.net/relay/v1/builder/validators](https://boost-relay.flashbots.net/relay/v1/builder/validators) (GET) - array of proposer preferences for registered validators with assigned duties in the current and next epoch
- `submitBlock`: [https://boost-relay.flashbots.net/relay/v1/builder/blocks](https://boost-relay.flashbots.net/relay/v1/builder/blocks) (POST)

---

<div class="post-metadata">

### Author: ![grust](https://collective.flashbots.net/letter_avatar_proxy/v4/letter/g/a4c791/32.png) [@grust](https://collective.flashbots.net/u/grust)
#### Post date: [September 27, 2022, 12:57pm UTC](https://collective.flashbots.net/t/do-you-want-to-run-a-builder/212/8 "2022-09-27T12:57:32Z")

</div>

This is my start command  
But it does not show the execution of the build block

 ![截屏2022-09-27 下午7.56.18](https://collective.flashbots.net/uploads/default/original/1X/37e26d8358d4d0a77e12bf5c1b63e77b7174fb82.png)

---

<div class="post-metadata">

### Author: ![metachris](https://collective.flashbots.net/user_avatar/collective.flashbots.net/metachris/32/6_2.png) [@metachris](https://collective.flashbots.net/u/metachris)
#### Post date: [September 27, 2022, 6:55pm UTC](https://collective.flashbots.net/t/do-you-want-to-run-a-builder/212/9 "2022-09-27T18:55:59Z")

</div>

Are you triggering the block production? You will need to run the custom Prysm fork from [GitHub - flashbots/prysm: Our custom Prysm fork for boost relay and builder CL. Sends payload attributes for block building on every slot to trigger building.](https://github.com/flashbots/prysm)

---

<div class="post-metadata">

### Author: ![grust](https://collective.flashbots.net/letter_avatar_proxy/v4/letter/g/a4c791/32.png) [@grust](https://collective.flashbots.net/u/grust)
#### Post date: [September 28, 2022, 2:16am UTC](https://collective.flashbots.net/t/do-you-want-to-run-a-builder/212/10 "2022-09-28T02:16:12Z")

</div>

I ran the flashbot prysm program, but it still did not appear in the build block  
This is my start command

 ![截屏2022-09-28 上午10.13.43](https://collective.flashbots.net/uploads/default/original/1X/1533fb1ef85aa00c8355279533ffcbbe33761788.png)

---

<div class="post-metadata">

### Author: ![mateusz](https://collective.flashbots.net/user_avatar/collective.flashbots.net/mateusz/32/336_2.png) [@mateusz](https://collective.flashbots.net/u/mateusz)
#### Post date: [September 28, 2022, 4:45pm UTC](https://collective.flashbots.net/t/do-you-want-to-run-a-builder/212/11 "2022-09-28T16:45:09Z")

</div>

@grust - let’s move to [Issues · flashbots/boost-geth-builder · GitHub](https://github.com/flashbots/boost-geth-builder/issues)  
Please attach your logs there!

---

<div class="post-metadata">

### Author: ![grust](https://collective.flashbots.net/letter_avatar_proxy/v4/letter/g/a4c791/32.png) [@grust](https://collective.flashbots.net/u/grust)
#### Post date: [September 29, 2022, 12:40am UTC](https://collective.flashbots.net/t/do-you-want-to-run-a-builder/212/12 "2022-09-29T00:40:29Z")

</div>

ok，Submitted

---

<div class="post-metadata">

### Author: ![mateusz](https://collective.flashbots.net/user_avatar/collective.flashbots.net/mateusz/32/336_2.png) [@mateusz](https://collective.flashbots.net/u/mateusz)
#### Post date: [September 30, 2022, 11:52am UTC](https://collective.flashbots.net/t/do-you-want-to-run-a-builder/212/13 "2022-09-30T11:52:45Z")

</div>

For reference - [geth builder doesn't seem to work · Issue #29 · flashbots/boost-geth-builder · GitHub](https://github.com/flashbots/boost-geth-builder/issues/29)

---

<div class="post-metadata">

### Author: ![apache-monkey](https://collective.flashbots.net/letter_avatar_proxy/v4/letter/a/d6d6ee/32.png) [@apache-monkey](https://collective.flashbots.net/u/apache-monkey)
#### Post date: [December 21, 2022, 5:09pm UTC](https://collective.flashbots.net/t/do-you-want-to-run-a-builder/212/14 "2022-12-21T17:09:02Z")

</div>

I am toying around with a builder at the moment. I like to have my blocks / bundles saved into a DB for analyzing the behaviour a bit better than just with the logs…

I can see in the docs that this is supposed to be possible with the builder by using flashbotsextra.IDatabaseService.

however I am not sure what kind of a database am I supposed to deploy and how to configure builder-geth to use it?

any pointers here please?

---

<div class="post-metadata">

### Author: ![metachris](https://collective.flashbots.net/user_avatar/collective.flashbots.net/metachris/32/6_2.png) [@metachris](https://collective.flashbots.net/u/metachris)
#### Post date: [December 22, 2022, 8:51am UTC](https://collective.flashbots.net/t/do-you-want-to-run-a-builder/212/15 "2022-12-22T08:51:24Z")

</div>

You need a Postgres database, and configure the DSN via the `FLASHBOTS_POSTGRES_DSN` environment variable:

- [builder/service.go at 586fbec873e3ec9952f8aa185fa5942b4346efde · flashbots/builder · GitHub](https://github.com/flashbots/builder/blob/586fbec873e3ec9952f8aa185fa5942b4346efde/builder/service.go#L185)
- [builder/database.go at main · flashbots/builder · GitHub](https://github.com/flashbots/builder/blob/main/flashbotsextra/database.go#L44)

You can spin up such a database with Docker like this:

```auto
docker run -d -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgres postgres

```

then you’d set the environment variable like this:

```auto
export FLASHBOTS_POSTGRES_DSN="postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable"

```

---

<div class="post-metadata">

### Author: ![apache-monkey](https://collective.flashbots.net/letter_avatar_proxy/v4/letter/a/d6d6ee/32.png) [@apache-monkey](https://collective.flashbots.net/u/apache-monkey)
#### Post date: [December 22, 2022, 7:29pm UTC](https://collective.flashbots.net/t/do-you-want-to-run-a-builder/212/16 "2022-12-22T19:29:06Z")

</div>

> [@metachris](#):
>
> ```auto
> export FLASHBOTS_POSTGRES_DSN="postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable"
> 
> ```

Thanks a bunch! this is really helpful. I would assume that I`ll have to create the db schema manually? cheers

---

<div class="post-metadata">

### Author: ![metachris](https://collective.flashbots.net/user_avatar/collective.flashbots.net/metachris/32/6_2.png) [@metachris](https://collective.flashbots.net/u/metachris)
#### Post date: [December 22, 2022, 8:14pm UTC](https://collective.flashbots.net/t/do-you-want-to-run-a-builder/212/17 "2022-12-22T20:14:38Z")

</div>

Oh yeah, seems that the schema is not yet in there.

For now, you’d have to reconstruct the two tables (`built_blocks` and `bundles`) based on the [types](https://github.com/flashbots/builder/blob/main/flashbotsextra/database_types.go) and [tests](https://github.com/flashbots/builder/blob/main/flashbotsextra/database_test.go). If you manage to get it done, a PR would be nice! 🙏 ⭐

---

<div class="post-metadata">

### Author: ![apache-monkey](https://collective.flashbots.net/letter_avatar_proxy/v4/letter/a/d6d6ee/32.png) [@apache-monkey](https://collective.flashbots.net/u/apache-monkey)
#### Post date: [December 22, 2022, 10:05pm UTC](https://collective.flashbots.net/t/do-you-want-to-run-a-builder/212/18 "2022-12-22T22:05:52Z")

</div>

Definitely! Will have to clean up my script first as I am not super experienced with postgres. (understatement) 😬

Btw how exactly will these two tables be populated? Do I need to enable local relay for saving the built blocks? Which process is responsible for saving the incoming bundles into postgres? cheers

---

<div class="post-metadata">

### Author: ![laospace](https://collective.flashbots.net/user_avatar/collective.flashbots.net/laospace/32/2541_2.png) [@laospace](https://collective.flashbots.net/u/laospace)
#### Post date: [May 5, 2023, 1:40pm UTC](https://collective.flashbots.net/t/do-you-want-to-run-a-builder/212/19 "2023-05-05T13:40:59Z")

</div>

Tried to run the builder with Postgres and failed.

here is my table creation SQL: [-- based on https://collective.flashbots.net/t/do-you-want-to-run-a-builder/212/ - Pastebin.com](https://pastebin.com/kGBiLVTq)

after start the PG instance and create the tables, running the builder will result in error log:

> pq: operator does not exist: character varying \* numeric

seems the error is caused by this SQL in [flashbotsextra/database.go](https://github.com/flashbots/builder/blob/main/flashbotsextra/database.go#L66):

> fetchPrioBundlesStmt, err := db.PrepareNamed(“select bundle\_hash, param\_signed\_txs, param\_block\_number, param\_timestamp, received\_timestamp, param\_reverting\_tx\_hashes, coinbase\_diff, total\_gas\_used, state\_block\_number, gas\_fees, eth\_sent\_to\_coinbase from bundles where is\_high\_prio = :is\_high\_prio and coinbase\_diff\*1e18/total\_gas\_used \> 1000000000 and param\_block\_number = :param\_block\_number order by coinbase\_diff/total\_gas\_used DESC limit :limit”)

The expression `coinbase_diff*1e18/total_gas_used` is trying to multiply the `coinbase_diff` column, which is of type `VARCHAR` , with a numeric constant (1e18) and then divide by the `total_gas_used` column, which is of type `BIGINT` , hence the error.

_coinbase\_diff_ has to be varchar according to the go struct defined in flashbotsextra/database\_types.go

It seems that the only way to correct this issue is by updating the SQL code for `fetchPrioBundlesStmt`. This makes me wonder if anyone has ever successfully run the code using a PostgresDB, or if I’m doing something wrong here that I’m not aware of?

---

<div class="post-metadata">

### Author: ![Kosala](https://collective.flashbots.net/letter_avatar_proxy/v4/letter/k/8491ac/32.png) [@Kosala](https://collective.flashbots.net/u/Kosala)
#### Post date: [April 12, 2024, 1:20pm UTC](https://collective.flashbots.net/t/do-you-want-to-run-a-builder/212/20 "2024-04-12T13:20:49Z")

</div>

Does Flashbots relay charges a fee from external builders when accepting blocks in the mainnet?
