A parallel transaction sender with pluggable chain adapters (Ethereum today, Solana planned).
- Architecture
- Problem Answers
- Original Design Notes (superseded by ARCHITECTURE.md)
- Handles sending transactions to a rapid EVM blockchain
- Sends multiple transactions concurrently
- Implements a priority system for transactions
- Includes a mechanism for replacing stuck transactions
- Manages nonces to ensure proper transaction ordering
- Late-binds nonces and gas prices to messages for flexible processing
- Rust (latest stable version)
cargo builduse bulkmail::{
Chain, Eth, EthClient, EthFeeManager, EthReplayProtection, EthRetryStrategy, Message, Sender,
};
use alloy::primitives::Address;
use std::sync::Arc;
# async fn run(chain: Chain, signer: Address) -> Result<(), bulkmail::Error> {
let chain_arc: Arc<dyn bulkmail::LegacyChainClient> = Arc::new(chain.clone());
let client = Arc::new(EthClient::new(chain_arc.clone()));
let fees = Arc::new(EthFeeManager::new());
let replay = Arc::new(EthReplayProtection::new(chain_arc, signer).await?);
let retry = Arc::new(EthRetryStrategy::new());
let sender = Sender::<Eth>::new(client, fees, replay, retry);
sender.add_message(Message::default()).await;
sender.run().await
# }Bulkmail includes an oracle program that simulates the system's behavior. To run it:
cargo run --example oracle_ethcargo testsrc/: Contains the main library codeexamples/: Example programs (e.g.,oracle_eth.rs)