Skip to content

Commit

Permalink
refactor: Use eventuals for monitoring network data
Browse files Browse the repository at this point in the history
Specifically, use one eventual for monitoring the indexer's active and
recently closed allocations, and one for establishing attestation signers
for these allocations.
  • Loading branch information
Jannis committed Sep 21, 2023
1 parent 513d1ad commit 1611cfb
Show file tree
Hide file tree
Showing 16 changed files with 375 additions and 620 deletions.
88 changes: 88 additions & 0 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@ eip-712-derive = { git = "https://github.com/graphprotocol/eip-712-derive" }
ethereum-types = "0.14.1"
ethers = "2.0.10"
ethers-core = "2.0.10"
eventuals = "0.6.7"
faux = { version = "0.1.10", optional = true }
keccak-hash = "0.10.0"
lazy_static = "1.4.0"
log = "0.4.20"
lru = "0.11.1"
reqwest = "0.11.20"
secp256k1 = { version = "0.27.0", features = ["recovery"] }
serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0.107"
tokio = { version = "1.32.0", features = ["full", "macros", "rt"] }
toolshed = { git = "https://github.com/edgeandnode/toolshed", tag = "v0.2.2", features = ["graphql"] }

[dev-dependencies]
env_logger = "0.9.0"
Expand Down
6 changes: 3 additions & 3 deletions common/src/allocations/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::types::SubgraphDeploymentID;

pub mod monitor;

#[derive(Debug, Eq, PartialEq)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Allocation {
pub id: Address,
pub status: AllocationStatus,
Expand All @@ -31,7 +31,7 @@ pub struct Allocation {
pub query_fees_collected: Option<U256>,
}

#[derive(Debug, Eq, PartialEq)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum AllocationStatus {
Null,
Active,
Expand All @@ -40,7 +40,7 @@ pub enum AllocationStatus {
Claimed,
}

#[derive(Debug, Eq, PartialEq, Deserialize)]
#[derive(Clone, Debug, Eq, PartialEq, Deserialize)]
pub struct SubgraphDeployment {
pub id: SubgraphDeploymentID,
#[serde(rename = "deniedAt")]
Expand Down
Loading

0 comments on commit 1611cfb

Please sign in to comment.