/// Create and return a `Player` from a replica configuration object for
/// subnet recovery.
Create and return a `Player` from a replica configuration object for
subnet recovery.
Create and return a ` Player ` from a replica configuration object for subnet recovery .
pub async fn new(cfg: Config, subnet_id: SubnetId) -> Self {
        let logger = LoggerImpl::new(&cfg.logger, "ic-replay".to_string());
        let log = new_replica_logger(logger.root.clone(), &cfg.logger);
        let metrics_registry = MetricsRegistry::global();
        let registry = setup_registry(cfg.clone(), Some(&metrics_registry));
        let mut replica_version = Default::default();
        let consensus_pool = if cfg.artifact_pool.consensus_pool_path.exists() {
            let mut artifact_pool_config = ArtifactPoolConfig::from(cfg.artifact_pool.clone());
            // We don't want to modify the original consensus pool during the subnet
            // recovery.
            artifact_pool_config.persistent_pool_read_only = true;
            let consensus_pool = ConsensusPoolImpl::from_uncached(
                UncachedConsensusPoolImpl::new(artifact_pool_config, log.clone()),
                MetricsRegistry::global(),
            );
            // Use the replica version from the finalized tip in the pool.
            replica_version = PoolReader::new(&consensus_pool)
                .get_finalized_tip()
                .version()
                .clone();
            Some(consensus_pool)
        } else {
            None
        };
        println!("Using replica version {}", replica_version);
        Player::new_with_params(
            cfg,
            Arc::new(backup::MockVerifier {}),
            registry,
            subnet_id,
            consensus_pool,
            log,
            None,
            replica_version,
        )
        .await
    }
pub async fn new ( cfg : Config , subnet_id : SubnetId ) -> Self { let logger = LoggerImpl :: new ( & cfg . logger , " " . to_string ( ) ) ; let log = new_replica_logger ( logger . root . clone ( ) , & cfg . logger ) ; let metrics_registry = MetricsRegistry :: global ( ) ; let registry = setup_registry ( cfg . clone ( ) , Some ( & metrics_registry ) ) ; let mut replica_version = Default :: default ( ) ; let consensus_pool = if cfg . artifact_pool . consensus_pool_path . exists ( ) { let mut artifact_pool_config = ArtifactPoolConfig :: from ( cfg . artifact_pool . clone ( ) ) ; // We don't want to modify the original consensus pool during the subnet // recovery. artifact_pool_config . persistent_pool_read_only = true ; let consensus_pool = ConsensusPoolImpl :: from_uncached ( UncachedConsensusPoolImpl :: new ( artifact_pool_config , log . clone ( ) ) , MetricsRegistry :: global ( ) , ) ; // Use the replica version from the finalized tip in the pool. replica_version = PoolReader :: new ( & consensus_pool ) . get_finalized_tip ( ) . version ( ) . clone ( ) ; Some ( consensus_pool ) } else { None } ; println ! ( " " replica_version ) ; Player :: new_with_params ( cfg , Arc :: new ( backup :: MockVerifier { } ) , registry , subnet_id , consensus_pool , log , None , replica_version , ) . await }
Create and return a `Player` from a replica configuration object for
subnet recovery.
Create and return a ` Player ` from a replica configuration object for subnet recovery .
cfg
Config
subnet_id
SubnetId