/// Submits a proposal for creating an application subnet.
///
/// # Arguments
///
/// * `governance`      - Governance canister
/// * `node_ids`        - IDs of (currently, unassigned) nodes that should join
///   the new subnet
/// * `replica_version` - Replica software version to install to the new subnet
///   nodes (see `get_software_version`)
///
/// Eventually returns the identifier of the newly submitted proposal.
Submits a proposal for creating an application subnet.
Submits a proposal for creating an application subnet .
pub async fn submit_create_application_subnet_proposal(
    governance: &Canister<'_>,
    node_ids: Vec<NodeId>,
    replica_version: ReplicaVersion,
) -> ProposalId {
    let config =
        subnet_configuration::get_default_config_params(SubnetType::Application, node_ids.len());
    let gossip = p2p::build_default_gossip_config();
    let scheduler = SchedulerConfig::application_subnet();
    let payload = CreateSubnetPayload {
        node_ids,
        subnet_id_override: None,
        ingress_bytes_per_block_soft_cap: config.ingress_bytes_per_block_soft_cap,
        max_ingress_bytes_per_message: config.max_ingress_bytes_per_message,
        max_ingress_messages_per_block: config.max_ingress_messages_per_block,
        max_block_payload_size: config.max_block_payload_size,
        replica_version_id: replica_version.to_string(),
        unit_delay_millis: duration_to_millis(config.unit_delay),
        initial_notary_delay_millis: duration_to_millis(config.initial_notary_delay),
        dkg_interval_length: config.dkg_interval_length.get(),
        dkg_dealings_per_block: config.dkg_dealings_per_block as u64,
        gossip_max_artifact_streams_per_peer: gossip.max_artifact_streams_per_peer,
        gossip_max_chunk_wait_ms: gossip.max_chunk_wait_ms,
        gossip_max_duplicity: gossip.max_duplicity,
        gossip_max_chunk_size: gossip.max_chunk_size,
        gossip_receive_check_cache_size: gossip.receive_check_cache_size,
        gossip_pfn_evaluation_period_ms: gossip.pfn_evaluation_period_ms,
        gossip_registry_poll_period_ms: gossip.registry_poll_period_ms,
        gossip_retransmission_request_ms: gossip.retransmission_request_ms,
        advert_best_effort_percentage: gossip.advert_config.map(|gac| gac.best_effort_percentage),
        start_as_nns: false,
        subnet_type: SubnetType::Application,
        is_halted: false,
        max_instructions_per_message: scheduler.max_instructions_per_message.get(),
        max_instructions_per_round: scheduler.max_instructions_per_round.get(),
        max_instructions_per_install_code: scheduler.max_instructions_per_install_code.get(),
        features: SubnetFeatures::default(),
        max_number_of_canisters: 3,
        ssh_readonly_access: vec![],
        ssh_backup_access: vec![],
    };
    submit_external_proposal_with_test_id(governance, NnsFunction::CreateSubnet, payload).await
}
pub async fn submit_create_application_subnet_proposal ( governance : & Canister < ' _ > , node_ids : Vec < NodeId > , replica_version : ReplicaVersion , ) -> ProposalId { let config = subnet_configuration :: get_default_config_params ( SubnetType :: Application , node_ids . len ( ) ) ; let gossip = p2p :: build_default_gossip_config ( ) ; let scheduler = SchedulerConfig :: application_subnet ( ) ; let payload = CreateSubnetPayload { node_ids , subnet_id_override : None , ingress_bytes_per_block_soft_cap : config . ingress_bytes_per_block_soft_cap , max_ingress_bytes_per_message : config . max_ingress_bytes_per_message , max_ingress_messages_per_block : config . max_ingress_messages_per_block , max_block_payload_size : config . max_block_payload_size , replica_version_id : replica_version . to_string ( ) , unit_delay_millis : duration_to_millis ( config . unit_delay ) , initial_notary_delay_millis : duration_to_millis ( config . initial_notary_delay ) , dkg_interval_length : config . dkg_interval_length . get ( ) , dkg_dealings_per_block : config . dkg_dealings_per_block as u64 , gossip_max_artifact_streams_per_peer : gossip . max_artifact_streams_per_peer , gossip_max_chunk_wait_ms : gossip . max_chunk_wait_ms , gossip_max_duplicity : gossip . max_duplicity , gossip_max_chunk_size : gossip . max_chunk_size , gossip_receive_check_cache_size : gossip . receive_check_cache_size , gossip_pfn_evaluation_period_ms : gossip . pfn_evaluation_period_ms , gossip_registry_poll_period_ms : gossip . registry_poll_period_ms , gossip_retransmission_request_ms : gossip . retransmission_request_ms , advert_best_effort_percentage : gossip . advert_config . map ( | gac | gac . best_effort_percentage ) , start_as_nns : false , subnet_type : SubnetType :: Application , is_halted : false , max_instructions_per_message : scheduler . max_instructions_per_message . get ( ) , max_instructions_per_round : scheduler . max_instructions_per_round . get ( ) , max_instructions_per_install_code : scheduler . max_instructions_per_install_code . get ( ) , features : SubnetFeatures :: default ( ) , max_number_of_canisters : 3 , ssh_readonly_access : vec ! [ ] , ssh_backup_access : vec ! [ ] , } ; submit_external_proposal_with_test_id ( governance , NnsFunction :: CreateSubnet , payload ) . await }
Submits a proposal for creating an application subnet.
Submits a proposal for creating an application subnet .
governance
&Canister<'_>
node_ids
Vec<NodeId>
replica_version
ReplicaVersion