add transaction parameters dump

This commit is contained in:
klykov 2022-02-28 16:15:38 +01:00 committed by kirill lykov
parent 1b0c9ad4c0
commit a63dee87ec
3 changed files with 18 additions and 3 deletions

1
Cargo.lock generated
View File

@ -4749,6 +4749,7 @@ dependencies = [
"clap 2.33.3",
"log",
"rand 0.7.3",
"serde",
"solana-client",
"solana-core",
"solana-gossip",

View File

@ -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" }

View File

@ -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,
@ -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
@ -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),
@ -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);
@ -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;