fn run_replicator_startup_basic(num_nodes: usize, num_replicators: usize) {
    morgan_logger::setup();
    // info!("{}", Info(format!("starting replicator test").to_string()));
    println!("{}",
        printLn(
            format!("starting replicator test").to_string(),
            module_path!().to_string()
        )
    );
    let mut validator_config = ValidatorConfig::default();
    validator_config.storage_rotate_count = STORAGE_ROTATE_TEST_COUNT;
    let config = ClusterConfig {
        validator_config,
        num_replicators,
        node_stakes: vec![100; num_nodes],
        cluster_difs: 10_000,
        ..ClusterConfig::default()
    };
    let cluster = LocalCluster::new(&config);

    let (cluster_nodes, cluster_replicators) = discover_cluster(
        &cluster.entry_point_info.gossip,
        num_nodes + num_replicators,
    )
    .unwrap();
    assert_eq!(
        cluster_nodes.len() + cluster_replicators.len(),
        num_nodes + num_replicators
    );
    let mut replicator_count = 0;
    let mut replicator_info = ContactInfo::default();
    for node in &cluster_replicators {
        // info!("{}", Info(format!("storage: {:?} rpc: {:?}", node.storage_addr, node.rpc).to_string()));
        println!("{}",
            printLn(
                format!("storage: {:?} rpc: {:?}", node.storage_addr, node.rpc).to_string(),
                module_path!().to_string()
            )
        );
        if ContactInfo::is_valid_address(&node.storage_addr) {
            replicator_count += 1;
            replicator_info = node.clone();
        }
    }
    assert_eq!(replicator_count, num_replicators);

    download_from_replicator(&replicator_info);
}
/// Start the cluster with the given configuration and wait till the replicators are discovered
/// Then download blobs from one of them.
Start the cluster with the given configuration and wait till the replicators are discovered
Then download blobs from one of them.
Start the cluster with the given configuration and wait till the replicators are discovered Then download blobs from one of them .
fn run_replicator_startup_basic(num_nodes: usize, num_replicators: usize) {
    morgan_logger::setup();
    // info!("{}", Info(format!("starting replicator test").to_string()));
    println!("{}",
        printLn(
            format!("starting replicator test").to_string(),
            module_path!().to_string()
        )
    );
    let mut validator_config = ValidatorConfig::default();
    validator_config.storage_rotate_count = STORAGE_ROTATE_TEST_COUNT;
    let config = ClusterConfig {
        validator_config,
        num_replicators,
        node_stakes: vec![100; num_nodes],
        cluster_difs: 10_000,
        ..ClusterConfig::default()
    };
    let cluster = LocalCluster::new(&config);
    let (cluster_nodes, cluster_replicators) = discover_cluster(
        &cluster.entry_point_info.gossip,
        num_nodes + num_replicators,
    )
    .unwrap();
    assert_eq!(
        cluster_nodes.len() + cluster_replicators.len(),
        num_nodes + num_replicators
    );
    let mut replicator_count = 0;
    let mut replicator_info = ContactInfo::default();
    for node in &cluster_replicators {
        // info!("{}", Info(format!("storage: {:?} rpc: {:?}", node.storage_addr, node.rpc).to_string()));
        println!("{}",
            printLn(
                format!("storage: {:?} rpc: {:?}", node.storage_addr, node.rpc).to_string(),
                module_path!().to_string()
            )
        );
        if ContactInfo::is_valid_address(&node.storage_addr) {
            replicator_count += 1;
            replicator_info = node.clone();
        }
    }
    assert_eq!(replicator_count, num_replicators);
    download_from_replicator(&replicator_info);
}
fn run_replicator_startup_basic ( num_nodes : usize , num_replicators : usize ) { morgan_logger :: setup ( ) ; // info!("{}", Info(format!("starting replicator test").to_string())); println ! ( " " printLn ( format ( " " ) to_string ( ) module_path ( ) to_string ( ) ) ) ; let mut validator_config = ValidatorConfig :: default ( ) ; validator_config . storage_rotate_count = STORAGE_ROTATE_TEST_COUNT ; let config = ClusterConfig { validator_config , num_replicators , node_stakes : vec ! [ 100 num_nodes ] , cluster_difs : 10_000 , .. ClusterConfig :: default ( ) } ; let cluster = LocalCluster :: new ( & config ) ; let ( cluster_nodes , cluster_replicators ) = discover_cluster ( & cluster . entry_point_info . gossip , num_nodes + num_replicators , ) . unwrap ( ) ; assert_eq ! ( cluster_nodes len ( ) cluster_replicators len ( ) num_nodes num_replicators ) ; let mut replicator_count = 0 ; let mut replicator_info = ContactInfo :: default ( ) ; for node in & cluster_replicators { // info!("{}", Info(format!("storage: {:?} rpc: {:?}", node.storage_addr, node.rpc).to_string())); println ! ( " " printLn ( format ( " " node storage_addr node rpc ) to_string ( ) module_path ( ) to_string ( ) ) ) ; if ContactInfo :: is_valid_address ( & node . storage_addr ) { replicator_count += 1 ; replicator_info = node . clone ( ) ; } } assert_eq ! ( replicator_count num_replicators ) ; download_from_replicator ( & replicator_info ) ; }
Start the cluster with the given configuration and wait till the replicators are discovered
Then download blobs from one of them.
Start the cluster with the given configuration and wait till the replicators are discovered Then download blobs from one of them .
num_nodes
usize
num_replicators
usize
num_nodes
usize
num_replicators
usize