diff --git a/Cargo.lock b/Cargo.lock index 8dc14a5bbc788..c6d1885121d90 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2158,6 +2158,19 @@ dependencies = [ "uuid", ] +[[package]] +name = "aptos-indexer-grpc-data-service-v2" +version = "1.0.0" +dependencies = [ + "anyhow", + "aptos-indexer-grpc-server-framework", + "async-trait", + "clap 4.5.21", + "jemallocator", + "serde", + "tokio", +] + [[package]] name = "aptos-indexer-grpc-file-checker" version = "1.0.0" @@ -2288,6 +2301,19 @@ dependencies = [ "tokio", ] +[[package]] +name = "aptos-indexer-grpc-manager" +version = "1.0.0" +dependencies = [ + "anyhow", + "aptos-indexer-grpc-server-framework", + "async-trait", + "clap 4.5.21", + "jemallocator", + "serde", + "tokio", +] + [[package]] name = "aptos-indexer-grpc-server-framework" version = "1.0.0" diff --git a/Cargo.toml b/Cargo.toml index 4cda3a84951df..2a0f83a54a280 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -121,11 +121,13 @@ members = [ "dkg", "ecosystem/indexer-grpc/indexer-grpc-cache-worker", "ecosystem/indexer-grpc/indexer-grpc-data-service", + "ecosystem/indexer-grpc/indexer-grpc-data-service-v2", "ecosystem/indexer-grpc/indexer-grpc-file-checker", "ecosystem/indexer-grpc/indexer-grpc-file-store", "ecosystem/indexer-grpc/indexer-grpc-file-store-backfiller", "ecosystem/indexer-grpc/indexer-grpc-fullnode", "ecosystem/indexer-grpc/indexer-grpc-in-memory-cache-benchmark", + "ecosystem/indexer-grpc/indexer-grpc-manager", "ecosystem/indexer-grpc/indexer-grpc-server-framework", "ecosystem/indexer-grpc/indexer-grpc-table-info", "ecosystem/indexer-grpc/indexer-grpc-utils", @@ -362,11 +364,13 @@ aptos-id-generator = { path = "crates/aptos-id-generator" } aptos-indexer = { path = "crates/indexer" } aptos-indexer-grpc-cache-worker = { path = "ecosystem/indexer-grpc/indexer-grpc-cache-worker" } aptos-indexer-grpc-data-service = { path = "ecosystem/indexer-grpc/indexer-grpc-data-service" } +aptos-indexer-grpc-data-service-v2 = { path = "ecosystem/indexer-grpc/indexer-grpc-data-service-v2" } aptos-indexer-grpc-file-store = { path = "ecosystem/indexer-grpc/indexer-grpc-file-store" } aptos-indexer-grpc-file-checker = { path = "ecosystem/indexer-grpc/indexer-grpc-file-checker" } aptos-indexer-grpc-file-store-backfiller = { path = "ecosystem/indexer-grpc/indexer-grpc-file-store-backfiller" } aptos-indexer-grpc-fullnode = { path = "ecosystem/indexer-grpc/indexer-grpc-fullnode" } aptos-indexer-grpc-in-memory-cache-benchmark = { path = "ecosystem/indexer-grpc/indexer-grpc-in-memory-cache-benchmark" } +aptos-indexer-grpc-manager = { path = "ecosystem/indexer-grpc/indexer-grpc-manager" } aptos-indexer-grpc-table-info = { path = "ecosystem/indexer-grpc/indexer-grpc-table-info" } aptos-indexer-test-transactions = { path = "ecosystem/indexer-grpc/indexer-test-transactions" } aptos-indexer-grpc-utils = { path = "ecosystem/indexer-grpc/indexer-grpc-utils" } diff --git a/ecosystem/indexer-grpc/indexer-grpc-data-service-v2/Cargo.toml b/ecosystem/indexer-grpc/indexer-grpc-data-service-v2/Cargo.toml new file mode 100644 index 0000000000000..533ac675464a0 --- /dev/null +++ b/ecosystem/indexer-grpc/indexer-grpc-data-service-v2/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "aptos-indexer-grpc-data-service-v2" +description = "Aptos Indexer gRPC data service to serve the data from in-memory cache and file store." +version = "1.0.0" + +# Workspace inherited keys +authors = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } +publish = { workspace = true } +repository = { workspace = true } +rust-version = { workspace = true } + +[dependencies] +anyhow = { workspace = true } +aptos-indexer-grpc-server-framework = { workspace = true } +async-trait = { workspace = true } +clap = { workspace = true } +serde = { workspace = true } +tokio = { workspace = true } + +[target.'cfg(unix)'.dependencies] +jemallocator = { workspace = true } diff --git a/ecosystem/indexer-grpc/indexer-grpc-data-service-v2/src/config.rs b/ecosystem/indexer-grpc/indexer-grpc-data-service-v2/src/config.rs new file mode 100644 index 0000000000000..7f81be313ec48 --- /dev/null +++ b/ecosystem/indexer-grpc/indexer-grpc-data-service-v2/src/config.rs @@ -0,0 +1,21 @@ +// Copyright © Aptos Foundation +// SPDX-License-Identifier: Apache-2.0 + +use anyhow::Result; +use aptos_indexer_grpc_server_framework::RunnableConfig; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Deserialize, Serialize)] +#[serde(deny_unknown_fields)] +pub struct IndexerGrpcDataServiceConfig {} + +#[async_trait::async_trait] +impl RunnableConfig for IndexerGrpcDataServiceConfig { + async fn run(&self) -> Result<()> { + Ok(()) + } + + fn get_server_name(&self) -> String { + "indexer_grpc_data_service_v2".to_string() + } +} diff --git a/ecosystem/indexer-grpc/indexer-grpc-data-service-v2/src/lib.rs b/ecosystem/indexer-grpc/indexer-grpc-data-service-v2/src/lib.rs new file mode 100644 index 0000000000000..36d88a8c1b06b --- /dev/null +++ b/ecosystem/indexer-grpc/indexer-grpc-data-service-v2/src/lib.rs @@ -0,0 +1,4 @@ +// Copyright © Aptos Foundation +// SPDX-License-Identifier: Apache-2.0 + +pub mod config; diff --git a/ecosystem/indexer-grpc/indexer-grpc-data-service-v2/src/main.rs b/ecosystem/indexer-grpc/indexer-grpc-data-service-v2/src/main.rs new file mode 100644 index 0000000000000..93b224c2d24ea --- /dev/null +++ b/ecosystem/indexer-grpc/indexer-grpc-data-service-v2/src/main.rs @@ -0,0 +1,17 @@ +// Copyright © Aptos Foundation +// SPDX-License-Identifier: Apache-2.0 + +use anyhow::Result; +use aptos_indexer_grpc_data_service_v2::config::IndexerGrpcDataServiceConfig; +use aptos_indexer_grpc_server_framework::ServerArgs; +use clap::Parser; + +#[cfg(unix)] +#[global_allocator] +static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; + +#[tokio::main] +async fn main() -> Result<()> { + let args = ServerArgs::parse(); + args.run::().await +} diff --git a/ecosystem/indexer-grpc/indexer-grpc-manager/Cargo.toml b/ecosystem/indexer-grpc/indexer-grpc-manager/Cargo.toml new file mode 100644 index 0000000000000..a902d64701d28 --- /dev/null +++ b/ecosystem/indexer-grpc/indexer-grpc-manager/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "aptos-indexer-grpc-manager" +description = "Aptos Indexer gRPC Manager" +version = "1.0.0" + +# Workspace inherited keys +authors = { workspace = true } +edition = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } +publish = { workspace = true } +repository = { workspace = true } +rust-version = { workspace = true } + +[dependencies] +anyhow = { workspace = true } +aptos-indexer-grpc-server-framework = { workspace = true } +async-trait = { workspace = true } +clap = { workspace = true } +serde = { workspace = true } +tokio = { workspace = true } + +[target.'cfg(unix)'.dependencies] +jemallocator = { workspace = true } diff --git a/ecosystem/indexer-grpc/indexer-grpc-manager/src/config.rs b/ecosystem/indexer-grpc/indexer-grpc-manager/src/config.rs new file mode 100644 index 0000000000000..d457db0f2b1b2 --- /dev/null +++ b/ecosystem/indexer-grpc/indexer-grpc-manager/src/config.rs @@ -0,0 +1,21 @@ +// Copyright © Aptos Foundation +// SPDX-License-Identifier: Apache-2.0 + +use anyhow::Result; +use aptos_indexer_grpc_server_framework::RunnableConfig; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, Deserialize, Serialize)] +#[serde(deny_unknown_fields)] +pub struct IndexerGrpcManagerConfig {} + +#[async_trait::async_trait] +impl RunnableConfig for IndexerGrpcManagerConfig { + async fn run(&self) -> Result<()> { + Ok(()) + } + + fn get_server_name(&self) -> String { + "grpc_manager".to_string() + } +} diff --git a/ecosystem/indexer-grpc/indexer-grpc-manager/src/lib.rs b/ecosystem/indexer-grpc/indexer-grpc-manager/src/lib.rs new file mode 100644 index 0000000000000..36d88a8c1b06b --- /dev/null +++ b/ecosystem/indexer-grpc/indexer-grpc-manager/src/lib.rs @@ -0,0 +1,4 @@ +// Copyright © Aptos Foundation +// SPDX-License-Identifier: Apache-2.0 + +pub mod config; diff --git a/ecosystem/indexer-grpc/indexer-grpc-manager/src/main.rs b/ecosystem/indexer-grpc/indexer-grpc-manager/src/main.rs new file mode 100644 index 0000000000000..385fba1d10bea --- /dev/null +++ b/ecosystem/indexer-grpc/indexer-grpc-manager/src/main.rs @@ -0,0 +1,17 @@ +// Copyright © Aptos Foundation +// SPDX-License-Identifier: Apache-2.0 + +use anyhow::Result; +use aptos_indexer_grpc_manager::config::IndexerGrpcManagerConfig; +use aptos_indexer_grpc_server_framework::ServerArgs; +use clap::Parser; + +#[cfg(unix)] +#[global_allocator] +static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; + +#[tokio::main] +async fn main() -> Result<()> { + let args = ServerArgs::parse(); + args.run::().await +}