Skip to content

Commit

Permalink
feat: subgraph and subgraph version entities feature parity (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
sahra-karakoc committed Nov 1, 2023
1 parent eef2782 commit 3c7cf17
Show file tree
Hide file tree
Showing 12 changed files with 3,559 additions and 2,650 deletions.
866 changes: 518 additions & 348 deletions abis/gns.json

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions proto/erc20.proto
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@ message RewardsDenyListUpdatedEvents {
repeated RewardsDenyListUpdated rewards_deny_list_updated_events = 1;
}

message SubgraphPublished1Events {
repeated SubgraphPublished1 subgraph_published1_events = 1;
}
message SubgraphPublished2Events {
repeated SubgraphPublished2 subgraph_published2_events = 1;
}

message SubgraphVersionUpdatedEvents {
repeated SubgraphVersionUpdated subgraph_version_updated_events = 1;
}

message IndexerStakes {
repeated IndexerStake indexer_stakes = 1;
}
Expand Down Expand Up @@ -124,6 +135,9 @@ message Events {
PartialPauseChangedEvents partial_pause_changed_events = 15;
EpochLengthUpdatedEvents epoch_length_updated_events = 16;
RewardsDenyListUpdatedEvents rewards_deny_list_updated_events = 17;
SubgraphPublished1Events subgraph_published1_events = 18;
SubgraphPublished2Events subgraph_published2_events = 19;
SubgraphVersionUpdatedEvents subgraph_version_updated_events = 20;
}

message Transfer {
Expand Down Expand Up @@ -287,6 +301,31 @@ message RewardsDenyListUpdated {
uint64 ordinal = 3;
}

message SubgraphPublished1 {
string id = 1;
bytes graph_account = 2;
string subgraph_number = 3;
bytes subgraph_deployment_id = 4;
bytes version_metadata = 5;
uint64 ordinal = 6;
}

message SubgraphPublished2 {
string id = 1;
string subgraph_id = 2;
bytes subgraph_deployment_id = 3;
string reserve_ratio = 4;
uint64 ordinal = 5;
}

message SubgraphVersionUpdated {
string id = 1;
string subgraph_id = 2;
bytes subgraph_deployment_id = 3;
bytes version_metadata = 4;
uint64 ordinal = 5;
}

message IndexerStake {
string id = 1;
bytes indexer = 2;
Expand Down
22 changes: 22 additions & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,25 @@ type Epoch @entity {
"Total indexing rewards earned in this epoch by delegators"
totalDelegatorRewards: BigInt!
}

type Subgraph @entity {
"Subgraph ID - which is derived from the Organization/Individual graph accountID"
id: ID!
"List of all the subgraph versions included the current one"
versions: [SubgraphVersion!]! @derivedFrom(field: "subgraph")
"Version counter"
versionCount: BigInt!
}

type SubgraphVersion @entity {
"Concatenation of subgraph, subgraph deployment, and version ID"
id: ID!
"Subgraph of this version"
subgraph: Subgraph!
"Subgraph deployment of this version"
subgraphDeployment: SubgraphDeployment!
"Version number"
version: Int!
"Creation timestamp"
createdAt: Int!
}
Loading

0 comments on commit 3c7cf17

Please sign in to comment.