### Install ethers-flashbots Source: https://github.com/onbjerg/ethers-flashbots/blob/master/README.md Add the ethers-flashbots crate to your Cargo.toml file to include it in your Rust project. This example shows how to add the development version from a Git repository. ```toml # This is the development version, for the stable release refer # to crates.io ethers-flashbots = { git = "https://github.com/onbjerg/ethers-flashbots" } ``` -------------------------------- ### Update Changelog Source: https://github.com/onbjerg/ethers-flashbots/blob/master/RELEASE.md This task requires updating the `CHANGELOG.md` file. Specifically, the 'Unreleased' section needs to be moved to a new header corresponding to the new version, and a comparison link to the previous version should be added. ```markdown Move "Unreleased" section in [CHANGELOG.md](./CHANGELOG.md) into a header with the new version, and add a link at the bottom of the CHANGELOG to compares that version to HEAD ``` -------------------------------- ### Publish New Version Source: https://github.com/onbjerg/ethers-flashbots/blob/master/RELEASE.md The final step in the release process is to push the committed and tagged changes to the remote repository and then publish the new version of the crate using the `cargo publish` command. ```rust Push the changes and run `cargo publish` ``` -------------------------------- ### Commit and Tag Release Source: https://github.com/onbjerg/ethers-flashbots/blob/master/RELEASE.md After updating the version and changelog, the changes must be committed to version control. A tag should then be created for this commit, using the version number without any prefix (e.g., '0.1.0', not 'v0.1.0'). ```git Commit those changes and tag that commit with the version number (**no `v` prefix!**) ``` -------------------------------- ### Update Version in Cargo.toml Source: https://github.com/onbjerg/ethers-flashbots/blob/master/RELEASE.md This step involves modifying the `Cargo.toml` file to reflect the new version number of the project. This is a standard practice in Rust projects managed by Cargo. ```rust Update version in `Cargo.toml` ``` -------------------------------- ### Send Transaction Bundle with Ethers Flashbots Source: https://github.com/onbjerg/ethers-flashbots/blob/master/README.md Demonstrates how to use the ethers-flashbots middleware to send a transaction bundle via Flashbots. It covers connecting to an Ethereum network, setting up signers for the bundle and transactions, creating a Flashbots middleware client, and sending a transaction for prioritized inclusion. ```rust use eyre::Result; use ethers::core::rand::thread_rng; use ethers::prelude::*; use ethers_flashbots::*; use std::convert::TryFrom; use url::Url; #[tokio::main] async fn main() -> Result<()> { // Connect to the network let provider = Provider::::try_from("https://mainnet.eth.aragon.network")?; // This is your searcher identity let bundle_signer = LocalWallet::new(&mut thread_rng()); // This signs transactions let wallet = LocalWallet::new(&mut thread_rng()); // Add signer and Flashbots middleware let client = SignerMiddleware::new( FlashbotsMiddleware::new( provider, Url::parse("https://relay.flashbots.net")?, bundle_signer, ), wallet, ); // Pay Vitalik using a Flashbots bundle! let tx = TransactionRequest::pay("vitalik.eth", 100); let pending_tx = client.send_transaction(tx, None).await?; // Get the receipt let receipt = pending_tx .await? .ok_or_else(|| eyre::format_err!("tx not included"))?; let tx = client.get_transaction(receipt.transaction_hash).await?; println!("Sent transaction: {}\n", serde_json::to_string(&tx)?); println!("Receipt: {}\n", serde_json::to_string(&receipt)?); Ok(()) } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.