Skip to content

Commit

Permalink
Cleanup Docs & Sample Env (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
cowanator authored May 12, 2024
1 parent 2d781d7 commit b0ad65e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 24 deletions.
18 changes: 9 additions & 9 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Dune Details
DUNE_API_KEY=
PAYMENT_QUERY=3630322
FEE_QUERY=3605385

# Node Details
## Testnet
RPC_URL=https://rpc.ankr.com/eth_sepolia
BILLING_CONTRACT_ADDRESS=0xF1436859a0F04A827b79F8c92736F6331ebB64A1

# sepolia
RPC_URL=
BILLING_CONTRACT_ADDRESS=0x2ad5fcddf209ca9e01509ecfa77115d3a9f999fa
BILLER_PRIVATE_KEY=

# Mainnet
# RPC_URL=
## Mainnet
# RPC_URL=https://rpc.ankr.com/eth
# BILLING_CONTRACT_ADDRESS=0x08Cd77fEB3fB28CC1606A91E0Ea2f5e3EABa1A9a
# BILLER_PRIVATE_KEY=

# Secrets
DUNE_API_KEY=
BILLER_PRIVATE_KEY=
35 changes: 20 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,49 @@
# Automated Builder Billing for MEV Blocker

On April 10, 2024, MEV Blocker Private RPC started charging a fee paid by the builders.
The accounting processes are seeded through the [MEVBlockerFeeTill](https://github.com/cowprotocol/mev-blocker-till) contract deployed on Ethereum mainnet at [0x08Cd77fEB3fB28CC1606A91E0Ea2f5e3EABa1A9a](https://etherscan.io/address/0x08Cd77fEB3fB28CC1606A91E0Ea2f5e3EABa1A9a).
The accounting processes are seeded through the [MEVBlockerFeeTill](https://github.com/cowprotocol/mev-blocker-till) contract deployed on Ethereum Mainnet at [0x08Cd77fEB3fB28CC1606A91E0Ea2f5e3EABa1A9a](https://etherscan.io/address/0x08Cd77fEB3fB28CC1606A91E0Ea2f5e3EABa1A9a).

The billing process is achieved through calling the `bill` method on this contract (restricted to `onlyBiller`).
The data supplied to the billing method is aggregated by the following [Dune](https://dune.com) queries:
The data supplied to the billing method is aggregated by the following:

1. [MEV Blocker - Fee per block](https://dune.com/queries/3605385)
2. [MEV Blocker - Payment Due](https://dune.com/queries/3630322)
### [Dune](https://dune.com) Queries:

## Verified Contracts
- **Fee per block:** https://dune.com/queries/3605385
- **Payment Due:** https://dune.com/queries/3630322

```sh
https://etherscan.io/address/0x08Cd77fEB3fB28CC1606A91E0Ea2f5e3EABa1A9a#writeContract
```
## Verified Contracts

```
https://sepolia.etherscan.io/address/0xF1436859a0F04A827b79F8c92736F6331ebB64A1#writeContract
```
- **Mainnet:** https://etherscan.io/address/0x08Cd77fEB3fB28CC1606A91E0Ea2f5e3EABa1A9a
- **Testnet:** https://sepolia.etherscan.io/address/0xF1436859a0F04A827b79F8c92736F6331ebB64A1

## Local Development: Install, Set ENV & Run

```sh
# Install
yarn
# Copy and fill env vars
# Copy and fill environment variables
cp .env.sample .env
```

Some values are filled, but others require secrets.
Some values are filled, but others require secrets (`DUNE_API_KEY` & `BILLER_PRIVATE_KEY`).

Run the Script
Run the Script:

```sh
yarn run main
```

## Docker

**Local build and run**

```sh
docker build -t mb-billing .
docker run --env-file .env mb-billing
docker run --rm --env-file .env mb-billing
```

**Published image**

```sh
docker run --rm --env-file .env ghcr.io/cowanator/mb-billing:main
```

0 comments on commit b0ad65e

Please sign in to comment.