From 3214b6dd5a404414855001b0c60ebb5814d818f8 Mon Sep 17 00:00:00 2001 From: juanmardefago Date: Mon, 19 Feb 2024 02:32:32 -0300 Subject: [PATCH] feat: add pruning hints and modified metadata id to be in line with core --- package.json | 6 +++--- src/mappings/ethereumDIDRegistry.ts | 3 ++- subgraph.template.yaml | 9 ++++++++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index e198771..ec7d349 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/mappings/ethereumDIDRegistry.ts b/src/mappings/ethereumDIDRegistry.ts index 7a10303..561acf2 100644 --- a/src/mappings/ethereumDIDRegistry.ts +++ b/src/mappings/ethereumDIDRegistry.ts @@ -17,7 +17,8 @@ export function handleDIDAttributeChanged(event: DIDAttributeChanged): void { // called it directly, it could crash the subgraph let hexHash = changetype(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() diff --git a/subgraph.template.yaml b/subgraph.template.yaml index 6d76d63..422d8bd 100644 --- a/subgraph.template.yaml +++ b/subgraph.template.yaml @@ -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: