Skip to content

Commit

Permalink
add transaction parameters dump
Browse files Browse the repository at this point in the history
  • Loading branch information
KirillLykov committed Mar 18, 2022
1 parent 1b0c9ad commit a63dee8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dos/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ bincode = "1.3.3"
clap = "2.33.1"
log = "0.4.14"
rand = "0.7.0"
serde = "1.0.136"
solana-client = { path = "../client", version = "=1.10.4" }
solana-core = { path = "../core", version = "=1.10.4" }
solana-gossip = { path = "../gossip", version = "=1.10.4" }
Expand Down
19 changes: 16 additions & 3 deletions dos/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ use {
clap::{crate_description, crate_name, value_t, value_t_or_exit, App, Arg},
log::*,
rand::{thread_rng, Rng},
serde::{Deserialize, Serialize},
solana_client::rpc_client::RpcClient,
solana_core::serve_repair::RepairProtocol,
solana_gossip::{contact_info::ContactInfo, gossip_service::discover},
solana_sdk::pubkey::Pubkey,
solana_sdk::{
hash::Hash,
instruction::CompiledInstruction,
instruction::{AccountMeta, Instruction},
instruction::{AccountMeta, CompiledInstruction, Instruction},
pubkey::Pubkey,
signature::{read_keypair_file, Keypair, Signer},
stake,
system_instruction::SystemInstruction,
Expand All @@ -34,6 +34,7 @@ fn get_repair_contact(nodes: &[ContactInfo]) -> ContactInfo {
}

/// Options for data_type=transaction
#[derive(Serialize, Deserialize, Debug)]
struct TransactionParams {
unique_transactions: bool, // use unique transactions
num_sign: usize, // number of signatures in a transaction
Expand Down Expand Up @@ -163,8 +164,16 @@ fn run_dos(
}
target = Some(entrypoint_addr);
} else {
info!("************ NODE ***********");
for node in nodes {
info!("{:?}", node);
}
info!("ADDR = {}", entrypoint_addr);

for node in nodes {
//let node = &nodes[1];
if node.gossip == entrypoint_addr {
info!("{}", node.gossip);
target = match mode.as_str() {
"gossip" => Some(node.gossip),
"tvu" => Some(node.tvu),
Expand Down Expand Up @@ -219,6 +228,8 @@ fn run_dos(
panic!("transaction parameters are not specified");
}
let tp = transaction_params.unwrap();
info!("{:?}", tp);

trans_gen = Some(TransactionGenerator::new(tp));
let tx = trans_gen.as_mut().unwrap().generate(payer, &rpc_client);
info!("{:?}", tx);
Expand All @@ -231,6 +242,8 @@ fn run_dos(
}
}

info!("TARGET = {}, NODE = {}", target, nodes[1].rpc);

let mut last_log = Instant::now();
let mut count = 0;
let mut error_count = 0;
Expand Down

0 comments on commit a63dee8

Please sign in to comment.