Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/envio'
Browse files Browse the repository at this point in the history
  • Loading branch information
johannafransn committed Nov 22, 2024
2 parents d4cc804 + 9f2d3df commit ed0eb20
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
Binary file removed .cache/cache.db
Binary file not shown.
3 changes: 1 addition & 2 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,8 @@ networks:
# - 0x24b3fDCdD9fef844fB3094ef43c0A6Ac23a6dF9E
# - name: WrappedERC20
- id: 100
#start_block: 12529458
start_block: 12529458
# start_block: 36486013
start_block: 37148256
contracts:
- name: HubV2
address:
Expand Down
10 changes: 5 additions & 5 deletions src/ipfs.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import multihash from "multihashes";
import { Profile } from "./types";
import { ProfileCache } from "./cache";
import { Avatar, eventLog } from "generated";
/* import { ProfileCache } from "./cache";
*/ import { Avatar, eventLog } from "generated";
import { uint8ArrayToCidV0 } from "./utils";

// Simple config with only needed values
Expand Down Expand Up @@ -80,12 +80,12 @@ export async function getProfileMetadataFromIpfs(
}
const slicedDigest = metadataDigest.slice(2, metadataDigest.length);

const cache = await ProfileCache.init();
/* const cache = await ProfileCache.init();
const cacheResult = await cache.read(slicedDigest);
if (cacheResult) {
return cacheResult;
}
} */

const cidV0 = uint8ArrayToCidV0(
Uint8Array.from(Buffer.from(slicedDigest, "hex"))
Expand All @@ -97,7 +97,7 @@ export async function getProfileMetadataFromIpfs(
console.log(`IPFS fetch from ${endpoint} took ${timeTaken.toFixed(2)}ms`);
if (data) {
console.log("Adding IPFS data to cache", data);
await cache.add(slicedDigest, cidV0, data);
//await cache.add(slicedDigest, cidV0, data);
return { cidV0, data };
}
}
Expand Down
1 change: 0 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import multihash from "multihashes";
import { Profile } from "./types";
import { ProfileCache } from "./cache";
import { Avatar, eventLog } from "generated";

/**
Expand Down

0 comments on commit ed0eb20

Please sign in to comment.