This repository provides an example workflow that attaches preconfirmations to blob transactions. The script supports sending transactions to a public endpoint or directly to the Titan relay for private transactions. This project demonstrates how to send blob transactions with preconfirmation bids in the Ethereum Holesky testnet. It includes a script to interact with a mev-commit p2p bidder node.
- funded holesky address
- funded mev-commit address
- mev-commit p2p bidder node v0.5.0 or higher
cd preconf_blob_bidder
Then go mod tiny
to install dependencies.
-
Ensure the mev-commit bidder node is starting in the background. See here for a quickstart. This is the following command to use:
curl -L -o launchmevcommit launch.mev-commit.xyz; chmod +x launchmevcommit; ./launchmevcommit --node-type bidder
-
go run cmd/preconfethtransfer.go --endpoint endpoint --privatekey private_key
whereendpoint
is the endpoint of the Holesky node andprivate_key
is the private key of the account that will be used to send the transactions.
- --endpoint: The RPC endpoint of your Ethereum Holesky node.
- --privatekey: The private key of the account that will send the transaction.
- --private: Set this flag to True to send the transaction privately to the Titan relay. Otherwise, it will send the transaction to the public Ethereum endpoint.
Main Logic:
The main() function sets up the mev-commit bidder client and connects to the Ethereum client using the provided endpoint. It checks for pending transactions in a loop, sending a new blob transaction if no transactions are pending. The loop runs for 12 hours, after which it stops. sendPreconfBid:
sendPreconfBid
sends a preconfirmation bid for a transaction. The bid amount and decay period are hardcoded but can be adjusted if needed.
checkPendingTxs:
checkPendingTxs
checks the status of transactions that were sent. If a transaction is still pending, it resends a preconfirmation bid. If the transaction is confirmed, it removes it from the pending transactions list.