Allow IPFS URLs to Contain Path Elements#12
Allow IPFS URLs to Contain Path Elements#12dysbulic wants to merge 5 commits intoquest-chains:devfrom
Conversation
| @@ -1,5 +1,5 @@ | |||
| export * from './constants'; | |||
| export * from './ipfs'; | |||
| export { Metadata } from './ipfs'; | |||
There was a problem hiding this comment.
Barrel files that don't use named exports will break tree-shaking in bundlers.
| }; | ||
|
|
||
| return networkMap[network] || 'unknown'; | ||
| if (network === 'mainnet') return '0x1'; |
There was a problem hiding this comment.
It bitched alot about the eight different ways I tried to type the object literal & the AIs said they don't exist in AssemblyScript.
| fetchMetadata, | ||
| getUser, | ||
| } from '../helpers'; | ||
| import { ADDRESS_ZERO, removeFromArray, Metadata, getUser } from '../helpers'; |
| "@graphprotocol/graph-cli": "^0.91.1", | ||
| "@graphprotocol/graph-ts": "^0.36.0", |
There was a problem hiding this comment.
I updated these trying to get the yarn deploy-local task to run.
There was a problem hiding this comment.
This repo is using really old versions of graphprotocol as you can see, so lot of things might break as you upgrade since they often introduce some breaking changes
There was a problem hiding this comment.
If AssemblyScript doesn't support iterators, it seems like it never would have supported itertators. It'd be weird to remove support for something like that…
In any case, I replaced the iterators with a for loop & the AssemblyScript will now compile to WASM. I deployed the code to the Subgraph Studio & everything seems to work, if you'd like use it.
We're about to redeploy the contracts so the spurious entries will stop showing up in questchains.xyz.
@dan13ram, @Innkeeping & @dysbulic are in the process of developing dAcademy (source) which is an extension & revamping of the Quest Chains architecture.
For storage, we are using Storacha which is the successor to Web3.Storage. (It uses UCAN delegation to permission clients to directly upload to the service.)
The issue is that the artifacts it produces aren't simple CIDs. They include a file name, even for single resource uploads. So, the strings we are submitting when creating Chains & whatnot look like:
ipfs://bafybeibydxuwx57bkertjywkshcikwodskt33pjc4rumnzhu4moirnjj5a/frontmatter.2024-12-04T20:33:13.156Z.json.As it stands, Quest Chains URL parser assumes that the last element in the URL split by
/s is the CID. This PR changes that behavior to instead strip off the protocol part of the URL and send the rest of it toipfs.cat.If the programmatic version of the command works the same as the CLI tool,
ipfs.catshould correctly resolve the resource and download the correct file.AssemblyScript is truly a horror to work with. 😹 I tried running the
yarn deploy-localscript, but I am getting a couple errors like:That's not my code, and if iterators aren't allowed, I don't understand how this ever compiled.
Because of those errors we weren't able to verify that the code actually performs as desired. I'm about 90% sure it's fine, since I only changed what needed to be changed to fix the issue, but you never know. 🐞