-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow IPFS URLs to Contain Path Elements #12
base: dev
Are you sure you want to change the base?
Conversation
@@ -1,5 +1,5 @@ | |||
export * from './constants'; | |||
export * from './ipfs'; | |||
export { Metadata } from './ipfs'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prettier squished this line.
"@graphprotocol/graph-cli": "^0.91.1", | ||
"@graphprotocol/graph-ts": "^0.36.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated these trying to get the yarn deploy-local
task to run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.cat
should correctly resolve the resource and download the correct file.AssemblyScript is truly a horror to work with. 😹 I tried running the
yarn deploy-local
script, 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. 🐞