-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dbfeca1
commit c7588dd
Showing
2 changed files
with
61 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,76 @@ | ||
# MEV-Commit Bidder Docker Setup | ||
This repository contains the Docker setup for running a MEV-Commit bidder node service in one container. The bidder node connects to the mev-commmit testnet and lets a user submit bids on the network. | ||
# mev-commit | ||
|
||
# Prerequisites | ||
- Docker and Docker Compose installed on your machine | ||
- A funded mev-commit address and valid private key - [faucet](https://faucet.testnet.mev-commit.xyz/) to receive funds. | ||
[](https://github.com/primev/mev-commit/actions/workflows/ci.yml) | ||
[](LICENSE.txt) | ||
|
||
# Setup Instructions | ||
1. Clone the repository | ||
2. Prepare Environment Variables | ||
Create a .env file in the root of the repository and define the PRIVATE_KEY_BIDDER variable | ||
|
||
3. Build and Run the Docker Containers | ||
Run the following command to build the Docker image and start the bidder node service: | ||
Is P2P software that creates a network of execution providers and bidders. | ||
Bidders can broadcast bids to providers and receive commitments from them. | ||
A high throughput POA EVM chain settles the bids at the end of a block slot. | ||
|
||
```bash | ||
docker-compose up --build | ||
## Documentation | ||
|
||
For detailed documentation, visit the [mev-commit docs](https://docs.primev.xyz/). | ||
|
||
## Main Components | ||
- [mev-commit client](p2p) | ||
- [mev-commit-oracle](oracle) | ||
- [mev-commit-bridge](bridge) | ||
- [mev-commit-geth](external/geth) | ||
- [contracts](contracts) | ||
|
||
## Getting Started | ||
|
||
The mev-commit repository is a mono-repository that also use submodules for external dependencies. | ||
To clone the repository and its submodules, run the following command: | ||
|
||
```shell | ||
git clone --recurse-submodules <[email protected]:primev/mev-commit.git|https://github.com/primev/mev-commit.git> | ||
``` | ||
|
||
- Build the Docker image based on Ubuntu 20.04 | ||
- Install necessary dependencies (curl, jq, etc.) | ||
- Download and install the latest mev-commit binary from the official repository | ||
If you have already cloned the repository and need to update the submodules, run the following command: | ||
|
||
## Customization | ||
Environment Variables | ||
You can customize the following environment variables in the .env file or Docker Compose: | ||
```shell | ||
git submodule update --init --recursive | ||
``` | ||
|
||
- PRIVATE_KEY_BIDDER: Your private key for authenticating the node with the testnet. | ||
- DOMAIN: The MEV-Commit testnet domain, default is testnet.mev-commit.xyz. | ||
## Development | ||
|
||
## Running entrypoint directly | ||
The entrypoint script can be run directly with `./entrypoint.sh` as a CLI script. It will prompt for a private key to use if one isn't provided as an `.env` variable. | ||
When working with submodules, you can use the `git submodule` command to list available submodules. | ||
To make changes to a submodule, navigate to the submodule directory using the `cd` command. | ||
Before making any changes, ensure that the submodule is up-to-date. | ||
For example, to navigate to the `external/geth` submodule, run the following command: | ||
|
||
# Networking with Other Repositories | ||
To allow the mev-commit-bidder service to interact with other containers (like a l1 transaction sender bot) that are defined in different repositories, we use a Docker network. This network allows services to discover and communicate with each other via container names instead of hardcoded IP addresses. | ||
```shell | ||
cd external/geth | ||
git submodule update --init --recursive | ||
``` | ||
|
||
## Creating the Network | ||
Before running the containers, ensure that the shared network is created. This only needs to be done once: | ||
Make the necessary changes to the submodule and commit (and push) them. | ||
To make the changes available in the main repository, you need to push the changes to the submodule. | ||
After making changes to the submodule, navigate back to the main repository and commit the changes. | ||
For example, to commit and push changes made to the `external/geth` submodule, run the following commands inside the submodule directory: | ||
|
||
```bash | ||
docker network create app-network | ||
```shell | ||
git add -p | ||
git commit -m "<your-commit-message>" | ||
git push | ||
``` | ||
Go back to the main repository and commit (and push) the changes made to the submodule: | ||
|
||
The app-network allows the bidder node and other services (e.g., a bid sender) to communicate over the same network. | ||
|
||
### Using the Network with Other Repositories | ||
If you have other repositories with Docker services that need to communicate with this bidder node, make sure they also reference the same app-network. Here's an example of how to include this network in another repository’s docker-compose.yml: | ||
|
||
```yaml | ||
version: '3' | ||
services: | ||
bid-sender: | ||
networks: | ||
- app-network | ||
environment: | ||
- RPC_ENDPOINT=http://mev-commit-bidder:13524 | ||
networks: | ||
app-network: | ||
external: true | ||
```shell | ||
git add external/geth | ||
git commit -m "<your-commit-message>" | ||
git push | ||
``` | ||
This ensures that the containers across different repositories can communicate with each other using container names, like mev-commit-bidder, for service discovery. | ||
|
||
### Go Modules | ||
|
||
# Troubleshooting | ||
Service not starting: Check the logs: | ||
Since this repository uses [Go Workspaces](https://go.dev/ref/mod#workspaces) to manage Go modules, when making changes to a Go module and its dependencies, ensure that the changes are reflected everywhere by running the following command: | ||
|
||
```shell | ||
go list -f '{{.Dir}}' -m | xargs -L1 go mod tidy -C | ||
go work sync | ||
``` | ||
|
||
```bash | ||
docker-compose logs -f mev-commit-bidder | ||
``` | ||
> See the [go.work](go.work) file for all the Go modules used in this repository. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
PRIVATE_KEY_BIDDER=your_private_key | ||
DOMAIN=testnet.mev-commit.xyz | ||
AUTO_DEPOSIT_VALUE=100000000000000000 # .1 ETH | ||
DOMAIN=testnet.mev-commit.xyz # use for testnet | ||
DOMAIN=mev-commit.xyz # use for mainnet | ||
AUTO_DEPOSIT_VALUE=100000000000000000 # .1 ETH value |