Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions bin/dipper-service/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ pub struct Config {
pub admin_rpc: AdminRpcConfig,
/// The database configuration
pub db: DbConfig,
/// The network service configuration
pub network: NetworkConfig,
/// The indexer URLs service configuration
pub indexer_urls: IndexerUrlsConfig,
/// The signer configuration
pub signer: SignerConfig,
/// The IISA (Indexing Indexer Selection Algorithm) service configuration
Expand Down Expand Up @@ -982,10 +982,10 @@ pub struct DbConfig {
pub max_connections: Option<u32>,
}

/// The network service configuration
/// The indexer URLs service configuration
#[serde_as]
#[derive(custom_debug::CustomDebug, serde::Deserialize)]
pub struct NetworkConfig {
pub struct IndexerUrlsConfig {
/// The indexing-payments subgraph query endpoint used to look up
/// registered indexer URLs. Same form as `chain_listener.subgraph_endpoint`:
/// a full query URL, gateway-served or self-hosted.
Expand Down
8 changes: 4 additions & 4 deletions bin/dipper-service/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ pub async fn main() -> anyhow::Result<()> {

//- The network services
let (indexer_urls_handle, indexer_urls_service) = {
let subgraph_endpoint = conf.network.subgraph_endpoint;
let api_key = conf.network.api_key.map(|key| key.into_inner());
let subgraph_endpoint = conf.indexer_urls.subgraph_endpoint;
let api_key = conf.indexer_urls.api_key.map(|key| key.into_inner());

// Fetch the initial snapshot with bounded exponential-backoff retries.
// The subgraph may be temporarily unavailable (e.g. during a chain halt).
Expand All @@ -195,7 +195,7 @@ pub async fn main() -> anyhow::Result<()> {
.await
{
Ok(s) if !s.is_empty() => break s,
Ok(s) if conf.network.allow_empty_at_startup => {
Ok(s) if conf.indexer_urls.allow_empty_at_startup => {
tracing::warn!(
"subgraph reports 0 registered indexers; starting with an empty \
snapshot (network.allow_empty_at_startup)"
Expand Down Expand Up @@ -236,7 +236,7 @@ pub async fn main() -> anyhow::Result<()> {
network::service::indexer_urls::Ctx {
endpoint: subgraph_endpoint,
api_key,
update_interval: conf.network.update_interval,
update_interval: conf.indexer_urls.update_interval,
},
init_snapshot,
)
Expand Down
8 changes: 4 additions & 4 deletions k8s/configmap-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ data:
"password": "REPLACE_ME",
"max_connections": 10
},
"network": {
"subgraph_endpoint": "https://gateway.thegraph.com/api/deployments/id/REPLACE_ME",
"api_key": "REPLACE_ME",
"indexer_urls": {
"subgraph_endpoint": "https://api.studio.thegraph.com/query/REPLACE_ME_USER_ID/REPLACE_ME_INDEXING_PAYMENTS_SLUG/version/latest",
"api_key": "REPLACE_ME_OR_REMOVE_IF_ENDPOINT_NEEDS_NO_AUTH",
"update_interval": 60,
"allow_empty_at_startup": false
},
Expand Down Expand Up @@ -75,7 +75,7 @@ data:
},
"chain_listener": {
"enabled": true,
"subgraph_endpoint": "REPLACE_ME",
"subgraph_endpoint": "https://api.studio.thegraph.com/query/REPLACE_ME_USER_ID/REPLACE_ME_INDEXING_PAYMENTS_SLUG/version/latest",
"chain_id": 42161,
"poll_interval": 30,
"request_timeout": 30,
Expand Down
Loading