Skip to content

Commit

Permalink
[Indexer-Grpc-V2] Create two new folders for new binaries. (#15690)
Browse files Browse the repository at this point in the history
  • Loading branch information
grao1991 authored Jan 9, 2025
1 parent 996a804 commit 979e285
Show file tree
Hide file tree
Showing 10 changed files with 162 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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" }
Expand Down
24 changes: 24 additions & 0 deletions ecosystem/indexer-grpc/indexer-grpc-data-service-v2/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 }
21 changes: 21 additions & 0 deletions ecosystem/indexer-grpc/indexer-grpc-data-service-v2/src/config.rs
Original file line number Diff line number Diff line change
@@ -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()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Copyright © Aptos Foundation
// SPDX-License-Identifier: Apache-2.0

pub mod config;
17 changes: 17 additions & 0 deletions ecosystem/indexer-grpc/indexer-grpc-data-service-v2/src/main.rs
Original file line number Diff line number Diff line change
@@ -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::<IndexerGrpcDataServiceConfig>().await
}
24 changes: 24 additions & 0 deletions ecosystem/indexer-grpc/indexer-grpc-manager/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 }
21 changes: 21 additions & 0 deletions ecosystem/indexer-grpc/indexer-grpc-manager/src/config.rs
Original file line number Diff line number Diff line change
@@ -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()
}
}
4 changes: 4 additions & 0 deletions ecosystem/indexer-grpc/indexer-grpc-manager/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Copyright © Aptos Foundation
// SPDX-License-Identifier: Apache-2.0

pub mod config;
17 changes: 17 additions & 0 deletions ecosystem/indexer-grpc/indexer-grpc-manager/src/main.rs
Original file line number Diff line number Diff line change
@@ -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::<IndexerGrpcManagerConfig>().await
}

0 comments on commit 979e285

Please sign in to comment.