diff --git a/README.md b/README.md index 95022ce..b570df7 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ ## About -This repository provides a user friendly CLI interface for making preconfirmation bids from mev-commit for ETH transfers or blob transactions. Transactions are sent directly to the builder as transaction payloads. Currently a fixed priority fee is used alongside a preconf bid amount. +This repository provides a user friendly CLI interface for making preconfirmation bids from mev-commit for ETH transfers or blob transactions. Additionally a bidder can spin up the docker container and run directly with the example [bidder node docker](https://github.com/primev/bidder_node_docker) + +Transactions are sent directly to the builder as transaction payloads. Currently a fixed priority fee is used alongside a preconf bid amount. If you’re an advanced user, you can still skip the interactive mode by specifying all configurations via environment variables, .env files, or command-line flags. @@ -7,7 +9,7 @@ If you’re an advanced user, you can still skip the interactive mode by specify ## Requirements - funded holesky address - funded mev-commit address -- mev-commit p2p bidder node (v0.7) +- mev-commit p2p bidder node (v0.8) - a good websocket endpoint (a publicly available one is set as default, but cannot handle high throughput) ## Installation @@ -24,15 +26,16 @@ Ensure that the .env file is filled out with all of the variables. RPC_ENDPOINT=rpc_endpoint # optional, not needed if `USE_PAYLOAD` is true. WS_ENDPOINT=ws_endpoint PRIVATE_KEY=private_key # L1 private key -USE_PAYLOAD=true # sends tx payload direclty to providers. +USE_PAYLOAD=true # sends tx payload direclty to providers (Default is true). SERVER_ADDRESS="localhost:13524" # address of the server (Default localhost:13524 to run locally) OFFSET=1 # of blocks in the future to ask for the preconf bid (Default 1 for next block) NUM_BLOB=0 # blob count of 0 will just send eth transfers (Default 0) BID_AMOUNT=0.001 # preconf bid amount (Default 0.001 ETH) +PRIORITY_FEE=1 # priority fee in wei (Default 1 gwei) BID_AMOUNT_STD_DEV_PERCENTAGE=100 # amount of variation in the preconf bid amount (in %) (Default 100%) DEFAULT_TIMEOUT=15 # default context timeout for the program (Default 15 seconds) -APP_NAME=preconf_bidder # application name for logging purposes -VERSION=0.8.0 # mev-commit version for logging purposes +APP_NAME=preconf_bidder # application name for logging purposes (Default name preconf_bidder) +VERSION=0.8.0 # mev-commit version for logging purposes (Default version v0.8.0) ``` ## How to run Ensure that the mev-commit bidder node is running in the background. A quickstart can be found [here](https://docs.primev.xyz/get-started/quickstart), which will get the latest mev-commit version and start running it with an auto generated private key. diff --git a/biddercli b/biddercli index cc9de62..9f30cd4 100755 Binary files a/biddercli and b/biddercli differ diff --git a/docker-compose.yml b/docker-compose.yml index 687ee34..dfbfbd3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,13 +8,14 @@ services: - PRIVATE_KEY=${PRIVATE_KEY} - RPC_ENDPOINT=${RPC_ENDPOINT} - WS_ENDPOINT=${WS_ENDPOINT} - - USE_PAYLOAD=${USE_PAYLOAD:-true} # Use "true" if USE_PAYLOAD is unset or empty + - USE_PAYLOAD=${USE_PAYLOAD:-true} - SERVER_ADDRESS=${SERVER_ADDRESS} - OFFSET=${OFFSET} - NUM_BLOB=${NUM_BLOB} - BID_AMOUNT=${BID_AMOUNT} - BID_AMOUNT_STD_DEV_PERCENTAGE=${BID_AMOUNT_STD_DEV_PERCENTAGE} - DEFAULT_TIMEOUT=${DEFAULT_TIMEOUT} + - PRIORITY_FEE=${PRIORITY_FEE} networks: app-network: external: true diff --git a/env.example b/env.example index e9a6e16..061fa08 100644 --- a/env.example +++ b/env.example @@ -7,6 +7,7 @@ OFFSET=1 # 0 blobs means eth transfer. Otehrwise a nonzero blob count will send blobs NUM_BLOB=0 BID_AMOUNT=0.0025 +PRIORITY_FEE=1 BID_AMOUNT_STD_DEV_PERCENTAGE=200 DEFAULT_TIMEOUT=15 APP_NAME=preconf_bidder diff --git a/main.go b/main.go index ba537ab..1758dd3 100644 --- a/main.go +++ b/main.go @@ -40,7 +40,7 @@ const ( FlagAppName = "app-name" FlagVersion = "version" - FlagPriorityFeeGwei = "priority-fee-gwei" + FlagPriorityFee = "priority-fee" ) // promptForInput prompts the user for input and returns the entered string @@ -202,7 +202,7 @@ func main() { fmt.Println(" --ws-endpoint The WebSocket endpoint for your Ethereum node") fmt.Println(" --rpc-endpoint The RPC endpoint if not using payload") fmt.Println(" --bid-amount The amount to bid (in ETH), default 0.001") - fmt.Println(" --priority-fee-gwei The priority fee in gwei, default 1") + fmt.Println(" --priority-fee The priority fee in wei, default 1") fmt.Println(" --bid-amount-std-dev-percentage Std dev percentage of bid amount, default 100.0") fmt.Println(" --num-blob Number of blob transactions to send, default 0 makes the tx an eth transfer") fmt.Println(" --default-timeout Default client context timeout in seconds, default 15") @@ -223,7 +223,7 @@ func main() { privateKeyHex := getOrDefault(c, FlagPrivateKey, "PRIVATE_KEY", "") // No default, required offset := getOrDefaultUint64(c, FlagOffset, "OFFSET", 1) bidAmount := getOrDefaultFloat64(c, FlagBidAmount, "BID_AMOUNT", 0.001) - priorityFeeGwei := getOrDefaultUint64(c, FlagPriorityFeeGwei, "PRIORITY_FEE_GWEI", 1) + priorityFee := getOrDefaultUint64(c, FlagPriorityFee, "PRIORITY_FEE", 1) stdDevPercentage := getOrDefaultFloat64(c, FlagBidAmountStdDevPercentage, "BID_AMOUNT_STD_DEV_PERCENTAGE", 100.0) numBlob := getOrDefaultUint(c, FlagNumBlob, "NUM_BLOB", 0) defaultTimeoutSeconds := getOrDefaultUint(c, FlagDefaultTimeout, "DEFAULT_TIMEOUT", 15) @@ -288,7 +288,7 @@ func main() { fmt.Printf(" - Server Address: %s\n", serverAddress) fmt.Printf(" - Use Payload: %v\n", usePayload) fmt.Printf(" - Bid Amount: %f ETH\n", bidAmount) - fmt.Printf(" - Priority Fee: %d gwei\n", priorityFeeGwei) + fmt.Printf(" - Priority Fee: %d wei\n", priorityFee) fmt.Printf(" - Standard Deviation: %f%%\n", stdDevPercentage) fmt.Printf(" - Number of Blobs: %d\n", numBlob) fmt.Printf(" - Default Timeout: %d seconds\n", defaultTimeoutSeconds) @@ -311,7 +311,7 @@ func main() { "offset", offset, "usePayload", usePayload, "bidAmount", bidAmount, - "priorityFeeGwei", priorityFeeGwei, + "priorityFee", priorityFee, "stdDevPercentage", stdDevPercentage, "numBlob", numBlob, "privateKeyProvided", privateKeyHex != "", @@ -388,10 +388,10 @@ func main() { if numBlob == 0 { // Perform ETH Transfer amount := big.NewInt(1e15) - signedTx, blockNumber, err = ee.SelfETHTransfer(wsClient, authAcct, amount, offset, big.NewInt(int64(priorityFeeGwei))) + signedTx, blockNumber, err = ee.SelfETHTransfer(wsClient, authAcct, amount, offset, big.NewInt(int64(priorityFee))) } else { // Execute Blob Transaction - signedTx, blockNumber, err = ee.ExecuteBlobTransaction(wsClient, authAcct, int(numBlob), offset, big.NewInt(int64(priorityFeeGwei))) + signedTx, blockNumber, err = ee.ExecuteBlobTransaction(wsClient, authAcct, int(numBlob), offset, big.NewInt(int64(priorityFee))) } if signedTx == nil { @@ -522,9 +522,9 @@ func main() { Value: "0.8.0", }, &cli.Int64Flag{ - Name: FlagPriorityFeeGwei, - Usage: "Priority fee in gwei", - EnvVars: []string{"PRIORITY_FEE_GWEI"}, + Name: FlagPriorityFee, + Usage: "Priority fee in wei", + EnvVars: []string{"PRIORITY_FEE"}, Value: 1, }, },