Skip to content

Commit

Permalink
WIP: rewrite subgraph service using new framework
Browse files Browse the repository at this point in the history
  • Loading branch information
Jannis committed Nov 14, 2023
1 parent c6f220b commit 848c5e9
Show file tree
Hide file tree
Showing 25 changed files with 570 additions and 2,324 deletions.
90 changes: 84 additions & 6 deletions Cargo.lock

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

10 changes: 8 additions & 2 deletions common/src/indexer_service/http/indexer_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,14 @@ impl IndexerService {
{
let metrics = IndexerServiceMetrics::new(options.metrics_prefix);

let http_client = reqwest::Client::builder()
.tcp_nodelay(true)
.timeout(Duration::from_secs(30))
.build()
.expect("Failed to init HTTP client");

let network_subgraph = Box::leak(Box::new(SubgraphClient::new(
reqwest::Client::new(),
http_client.clone(),
options
.config
.graph_node
Expand Down Expand Up @@ -223,7 +229,7 @@ impl IndexerService {
);

let escrow_subgraph = Box::leak(Box::new(SubgraphClient::new(
reqwest::Client::new(),
http_client,
options
.config
.graph_node
Expand Down
8 changes: 6 additions & 2 deletions service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@ tracing = "0.1.34"
thiserror = "1.0.49"
serde = { version = "1.0", features = ["rc", "derive"] }
serde_json = "1"
axum = "0.5"
axum = "0.6.20"
hyper = "0.14.27"
tower = { version = "0.4", features = ["util", "timeout", "limit"] }
tower-http = { version = "0.4.0", features = [
"add-extension",
"trace",
"cors",
] }
toml = "0.7.4"
once_cell = "1.17"
async-graphql = "4.0.16"
async-graphql-axum = "4.0.16"
Expand Down Expand Up @@ -62,6 +61,11 @@ toolshed = { git = "https://github.com/edgeandnode/toolshed", branch = "main", f
"graphql",
] }
build-info = "0.0.34"
figment = { version = "0.10", features = ["toml", "env"] }

# FIXME: Needed due to a serde_spanned version conflict between
# `ethers` and `figment`.
serde_spanned = "=0.6.4"

[dev-dependencies]
faux = "0.1.10"
Expand Down
9 changes: 9 additions & 0 deletions service/src/cli.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
use std::path::PathBuf;

use clap::Parser;

#[derive(Parser)]
pub struct Cli {
#[arg(long, value_name = "FILE")]
pub config: PathBuf,
}
30 changes: 0 additions & 30 deletions service/src/common/address.rs

This file was deleted.

34 changes: 0 additions & 34 deletions service/src/common/database.rs

This file was deleted.

Loading

0 comments on commit 848c5e9

Please sign in to comment.