pub fn spend_and_verify_all_nodes(
    entry_point_info: &ContactInfo,
    funding_keypair: &Keypair,
    nodes: usize,
) {
    let (cluster_nodes, _) = discover_cluster(&entry_point_info.gossip, nodes).unwrap();
    assert!(cluster_nodes.len() >= nodes);
    for ingress_node in &cluster_nodes {
        let random_keypair = Keypair::new();
        let client = create_client(ingress_node.client_facing_addr(), FULLNODE_PORT_RANGE);
        let bal = client
            .poll_get_balance(&funding_keypair.pubkey())
            .expect("balance in source");
        assert!(bal > 0);
        let (blockhash, _fee_calculator) = client.get_recent_blockhash().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, 5, confs)
            .unwrap();
        for validator in &cluster_nodes {
            let client = create_client(validator.client_facing_addr(), FULLNODE_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
Spend and verify from every node in the network
pub fn spend_and_verify_all_nodes(
    entry_point_info: &ContactInfo,
    funding_keypair: &Keypair,
    nodes: usize,
) {
    let (cluster_nodes, _) = discover_cluster(&entry_point_info.gossip, nodes).unwrap();
    assert!(cluster_nodes.len() >= nodes);
    for ingress_node in &cluster_nodes {
        let random_keypair = Keypair::new();
        let client = create_client(ingress_node.client_facing_addr(), FULLNODE_PORT_RANGE);
        let bal = client
            .poll_get_balance(&funding_keypair.pubkey())
            .expect("balance in source");
        assert!(bal > 0);
        let (blockhash, _fee_calculator) = client.get_recent_blockhash().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, 5, confs)
            .unwrap();
        for validator in &cluster_nodes {
            let client = create_client(validator.client_facing_addr(), FULLNODE_PORT_RANGE);
            client.poll_for_signature_confirmation(&sig, confs).unwrap();
        }
    }
}
pub fn spend_and_verify_all_nodes ( entry_point_info : & ContactInfo , funding_keypair : & Keypair , nodes : usize , ) { let ( cluster_nodes , _ ) = discover_cluster ( & entry_point_info . gossip , nodes ) . unwrap ( ) ; assert ! ( cluster_nodes len ( ) nodes ) ; for ingress_node in & cluster_nodes { let random_keypair = Keypair :: new ( ) ; let client = create_client ( ingress_node . client_facing_addr ( ) , FULLNODE_PORT_RANGE ) ; let bal = client . poll_get_balance ( & funding_keypair . pubkey ( ) ) . expect ( " " ) ; assert ! ( bal 0 ) ; let ( blockhash , _fee_calculator ) = client . get_recent_blockhash ( ) . 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 , 5 , confs ) . unwrap ( ) ; for validator in & cluster_nodes { let client = create_client ( validator . client_facing_addr ( ) , FULLNODE_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
entry_point_info
&ContactInfo
funding_keypair
&Keypair
nodes
usize