Skip to content

Commit

Permalink
feat: add pruning hints and modified metadata id to be in line with core
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmardefago committed Feb 26, 2024
1 parent 9380019 commit 3214b6d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
"prettier-write": "prettier --write '**/*.ts'"
},
"devDependencies": {
"@graphprotocol/contracts": "5.3.3",
"@graphprotocol/graph-cli": "^0.51.0",
"@graphprotocol/graph-ts": "^0.31.0",
"@graphprotocol/contracts": "6.2.0",
"@graphprotocol/graph-cli": "0.68.0",
"@graphprotocol/graph-ts": "0.32.0",
"@types/node": "^14.0.13",
"@typescript-eslint/eslint-plugin": "^3.3.0",
"@typescript-eslint/parser": "^3.3.0",
Expand Down
3 changes: 2 additions & 1 deletion src/mappings/ethereumDIDRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export function handleDIDAttributeChanged(event: DIDAttributeChanged): void {
// called it directly, it could crash the subgraph
let hexHash = changetype<Bytes>(addQm(event.params.value))
let base58Hash = hexHash.toBase58()
let metadataId = graphAccount.id.concat('-').concat(base58Hash)
let uniqueTxID = event.transaction.hash.toHexString().concat('-').concat(event.logIndex.toString())
let metadataId = uniqueTxID.concat('-').concat(graphAccount.id.concat('-').concat(base58Hash))
graphAccount.metadata = metadataId
graphAccount.save()

Expand Down
9 changes: 8 additions & 1 deletion subgraph.template.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
specVersion: 0.0.2
specVersion: 1.0.0
description: Graph Network analytics subgraph
repository: https://github.com/graphprotocol/graph-network-analytics-subgraph
features:
- fullTextSearch
indexerHints:
{{#isL1}}
prune: 400
{{/isL1}}
{{^isL1}}
prune: 15000
{{/isL1}}
schema:
file: ./schema.graphql
dataSources:
Expand Down

0 comments on commit 3214b6d

Please sign in to comment.