example for solana-trader-client in Rust
see document
-
Download git repository
git clone https://github.com/BlockRazorinc/solana-trader-client-rust.git -
Change directory
cd solana-trader-client-rust -
Download dependencies
install protoc, then
cargo build -
Edit src/mode_grpc_fast.rs
// BlockRazor relay endpoint address let blzendpoint = "http://frankfurt.solana-grpc.blockrazor.xyz:80"; // replace your solana rpc endpoint let mainnetrpc = ""; // replace your authKey let authkey = ""; // relace your private key(base58) let privatekey = ""; // send mode let mode = ""; // tip amount let tipamount = 1_000_000; -
Run mode-grpc-fast example
cargo run --bin mode-grpc-fast
-
Edit src/mode_grpc_fast.rs
// BlockRazor relay endpoint address let blzendpoint = "http://frankfurt.solana-grpc.blockrazor.xyz:80"; // replace your solana rpc endpoint let mainnetrpc = ""; // replace your authKey let authkey = ""; // relace your private key(base58) let privatekey = ""; // send mode let mode = ""; // tip amount let tipamount = 1_000_000; -
Run mode-grpc-fast example
cargo run --bin mode-grpc-fast
-
Edit src/mode_grpc_sandwichMitigation.rs
// BlockRazor relay endpoint address let blzendpoint = "http://frankfurt.solana-grpc.blockrazor.xyz:80"; // replace your solana rpc endpoint let mainnetrpc = ""; // replace your authKey let authkey = ""; // relace your private key let privatekey = ""; // send mode let mode = "sandwichMitigation"; // safe window let safe_window = Some(5); // revert protection let revert_protection = false; -
Run mode-grpc-sandwichMitigation example
cargo run --bin mode-grpc-sandwichMitigation
-
Edit src/mode_http_fast.rs
let http_endpoint = "http://frankfurt.solana.blockrazor.xyz:443/sendTransaction"; let health_endpoint = "http://frankfurt.solana.blockrazor.xyz:443/health"; let mainnetrpc = ""; // replace your authKey let authkey = ""; // relace your private key let privatekey =""; // relace your target public key let publickey = ""; -
Run mode-http-fast example
cargo run --bin mode-http-fast
-
Edit src/mode_http_sandwichMitigation.rs
// Configuration values let http_endpoint = "http://frankfurt.solana.blockrazor.xyz:443/sendTransaction"; let health_endpoint = "http://frankfurt.solana.blockrazor.xyz:443/health"; let mainnetrpc = ""; // replace your authKey let authkey = ""; // relace your private key let privatekey = ""; // relace your target public key let publickey = ""; // transaction amount let amount: u64 = 200_000; // tip amount let tipamount: u64 = 1_000_000; // safe window let safe_window: u32 = 5; // revert protection let revert_protection = false; // send mode let mode = "sandwichMitigation"; -
Run mode-http-sandwichMitigation example
cargo run --bin mode-http-sandwichMitigationn