diff --git a/aptos-node/src/lib.rs b/aptos-node/src/lib.rs index 3eadc3f0b2a26..abf6e340e6c4d 100644 --- a/aptos-node/src/lib.rs +++ b/aptos-node/src/lib.rs @@ -578,7 +578,7 @@ where let config = OnChainJWKConsensusConfig::default_enabled(); println!("Flag `INITIALIZE_JWK_CONSENSUS` detected, will enable JWK Consensus for all default OIDC providers in genesis: {:?}", config); Some(config) - }, + } _ => None, }; }))) @@ -704,6 +704,7 @@ pub fn setup_environment_and_start_node( indexer_runtime, indexer_grpc_runtime, internal_indexer_db_runtime, + mempool_client_sender, ) = services::bootstrap_api_and_indexer( &node_config, db_rw.clone(), @@ -714,6 +715,9 @@ pub fn setup_environment_and_start_node( indexer_grpc_port_tx, )?; + // Set mempool client sender in order to enable the Mempool API in the admin service + admin_service.set_mempool_client_sender(mempool_client_sender); + // Create mempool and get the consensus to mempool sender let (mempool_runtime, consensus_to_mempool_sender) = services::start_mempool_runtime_and_get_consensus_sender( diff --git a/aptos-node/src/services.rs b/aptos-node/src/services.rs index dce92c0088e79..9537f4ea3ef9f 100644 --- a/aptos-node/src/services.rs +++ b/aptos-node/src/services.rs @@ -19,7 +19,9 @@ use aptos_indexer_grpc_table_info::runtime::{ bootstrap as bootstrap_indexer_table_info, bootstrap_internal_indexer_db, }; use aptos_logger::{debug, telemetry_log_writer::TelemetryLog, LoggerFilterUpdater}; -use aptos_mempool::{network::MempoolSyncMsg, MempoolClientRequest, QuorumStoreRequest}; +use aptos_mempool::{ + network::MempoolSyncMsg, MempoolClientRequest, MempoolClientSender, QuorumStoreRequest, +}; use aptos_mempool_notifications::MempoolNotificationListener; use aptos_network::application::{interface::NetworkClientInterface, storage::PeersAndMetadata}; use aptos_network_benchmark::{run_netbench_service, NetbenchMessage}; @@ -59,6 +61,7 @@ pub fn bootstrap_api_and_indexer( Option, Option, Option, + MempoolClientSender, )> { // Create the mempool client and sender let (mempool_client_sender, mempool_client_receiver) = @@ -120,7 +123,7 @@ pub fn bootstrap_api_and_indexer( node_config, chain_id, db_rw.reader.clone(), - mempool_client_sender, + mempool_client_sender.clone(), )?; Ok(( @@ -130,6 +133,7 @@ pub fn bootstrap_api_and_indexer( indexer_runtime, indexer_grpc, db_indexer_runtime, + mempool_client_sender, )) }