/// Spend and verify from every node in the network
Spend and verify from every node in the network
Spend and verify from every node in the network
pub fn spend_and_verify_all_nodes<S: ::std::hash::BuildHasher>(
    entry_point_info: &ContactInfo,
    funding_keypair: &Keypair,
    nodes: usize,
    ignore_nodes: HashSet<Pubkey, S>,
) {
    let (cluster_nodes, _) = discover_cluster(&entry_point_info.gossip, nodes).unwrap();
    assert!(cluster_nodes.len() >= nodes);
    for ingress_node in &cluster_nodes {
        if ignore_nodes.contains(&ingress_node.id) {
            continue;
        }
        let random_keypair = Keypair::new();
        let client = create_client(ingress_node.client_facing_addr(), VALIDATOR_PORT_RANGE);
        let bal = client
            .poll_get_balance_with_commitment(&funding_keypair.pubkey(), CommitmentConfig::recent())
            .expect("balance in source");
        assert!(bal > 0);
        let (blockhash, _fee_calculator) = client
            .get_recent_blockhash_with_commitment(CommitmentConfig::recent())
            .unwrap();
        let mut transaction =
            system_transaction::transfer(&funding_keypair, &random_keypair.pubkey(), 1, blockhash);
        let confs = VOTE_THRESHOLD_DEPTH + 1;
        let sig = client
            .retry_transfer_until_confirmed(&funding_keypair, &mut transaction, 10, confs)
            .unwrap();
        for validator in &cluster_nodes {
            if ignore_nodes.contains(&validator.id) {
                continue;
            }
            let client = create_client(validator.client_facing_addr(), VALIDATOR_PORT_RANGE);
            client.poll_for_signature_confirmation(&sig, confs).unwrap();
        }
    }
}
pub fn spend_and_verify_all_nodes < S : :: std :: hash :: BuildHasher > ( entry_point_info : & ContactInfo , funding_keypair : & Keypair , nodes : usize , ignore_nodes : HashSet < Pubkey , S > , ) { let ( cluster_nodes , _ ) = discover_cluster ( & entry_point_info . gossip , nodes ) . unwrap ( ) ; assert ! ( cluster_nodes len ( ) nodes ) ; for ingress_node in & cluster_nodes { if ignore_nodes . contains ( & ingress_node . id ) { continue ; } let random_keypair = Keypair :: new ( ) ; let client = create_client ( ingress_node . client_facing_addr ( ) , VALIDATOR_PORT_RANGE ) ; let bal = client . poll_get_balance_with_commitment ( & funding_keypair . pubkey ( ) , CommitmentConfig :: recent ( ) ) . expect ( " " ) ; assert ! ( bal 0 ) ; let ( blockhash , _fee_calculator ) = client . get_recent_blockhash_with_commitment ( CommitmentConfig :: recent ( ) ) . unwrap ( ) ; let mut transaction = system_transaction :: transfer ( & funding_keypair , & random_keypair . pubkey ( ) , 1 , blockhash ) ; let confs = VOTE_THRESHOLD_DEPTH + 1 ; let sig = client . retry_transfer_until_confirmed ( & funding_keypair , & mut transaction , 10 , confs ) . unwrap ( ) ; for validator in & cluster_nodes { if ignore_nodes . contains ( & validator . id ) { continue ; } let client = create_client ( validator . client_facing_addr ( ) , VALIDATOR_PORT_RANGE ) ; client . poll_for_signature_confirmation ( & sig , confs ) . unwrap ( ) ; } } }
Spend and verify from every node in the network
Spend and verify from every node in the network
entry_point_info
&ContactInfo
funding_keypair
&Keypair
nodes
usize
ignore_nodes
HashSet<Pubkey, S>