-
Notifications
You must be signed in to change notification settings - Fork 24
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
Use newer js-ipfs proxy libraries #288
Conversation
This might be due to js-ipfs's change to a new CID library. They've now moved on to the |
I think you ment to say "doesn't garbage collect", right? |
Nah it's fine, we'll power through until your
Yeah, for me pinning is synonymous to "don't garbage collect". |
169bdfb
to
8756d33
Compare
@@ -17,5 +17,5 @@ export const setup = { | |||
user: "fission.name" | |||
}, | |||
|
|||
shouldPin: true, | |||
shouldPin: false, |
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 think we can just remove this now, right?
I'm not 100% sure. There might be a use-case for pinning for users who're providing their own IPFS instance.
... But at the same time I think there's noone who's actually doing that. 😄
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.
Can't hurt to keep it around I guess? In case js-ipfs does turn on GC, like how it's supposed to work 😅
1832b3f
to
0686984
Compare
return new dagPb.DAGLink(raw.Name, raw.Tsize, raw.Hash) | ||
const h = raw.Hash | ||
const c = new OldCID(h.version, h.code, h.multihash.bytes) | ||
return new dagPb.DAGLink(raw.Name, raw.Tsize, c) |
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 is a bit dumb, but I didn't want to put too much work in here, since this is getting replaced soon anyway by WNFS v2.
fs.mkdirSync(dir) | ||
|
||
const memoryDs = new MemoryDatastore() | ||
const memoryBs = new MemoryBlockstore() |
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.
@matheus23 Bit of double effort here, but needed to replace this to get the tests working with the new ipfs-core
.
Ready for review. Goes hand in hand with this lobby PR: fission-codes/auth-lobby#92 Which I'll need to deploy to staging to get all the tests passing. |
tests/helpers/loadCAR.ts
Outdated
@@ -13,7 +13,7 @@ export async function loadCAR(filepath: string, ipfs: IPFS): Promise<{ roots: CI | |||
const blockIterator = await CarBlockIterator.fromIterable(inStream) | |||
for await (const block of blockIterator) { | |||
cids.push(block.cid) | |||
await ipfs.block.put(block.bytes, { cid: block.cid }) | |||
await ipfs.block.put(block.bytes, { version: 1, mhtype: "sha2-256" }) |
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 think this code has issues, because it'll strip away the IPLD codec from all CIDs and turn all blocks to "raw" blocks implicitly (this code is probably from the wnfs2 branch).
We should totally get rid of this whole thing and just use the newly implemented ipfs.dag.import
api.
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.
Aight! I'll see if I can use that import
function 👀
The tests are failing because, ... uh. They depend on staging infrastructure lol. |
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.
Finally no more forks 🤩 🎉 🥳 AND updated js-ipfs :) 👍
Gets rid of our
ipfs-message-port-*
forks and versions the ipfs worker, because said libraries aren't backwards compatible (due toCID
implementation changes).How the versioning works:
ipfs.html
path, so older webnative clients know where to look.ipfs/v2.html
which works as before, but with the new message-port libraries.Will update to stable version which comes out soon.
Closes #250