-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Simplify merkledag package interface to ease IPLD inclusion #2359
Conversation
Is there a way to manually trigger the build so I could test what does wrong incrementally? |
You mean on MacOS as Travis runs on MacOS and Linux. |
the appveyor one is now better, its moved on to failing on sharness tests. The travis one is weird... its hanging while contacting the gateways for some reason. That aside, I think now is a good opportunity to, if not remove, at least unexport the |
if nlink.Node == nil { | ||
// fetch object for link and assign to nd | ||
ctx, cancel := context.WithTimeout(ctx, time.Minute) | ||
if nlink.GetCachedNode() == nil { |
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 doesnt seem right now... We should probably just drop this timeout logic altogether
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 tried not to change the code logic at all, but you are right, this could be simplified.
c39d5ae
to
fd0b079
Compare
Made the Node field private, and simplified path/resolver.go as you suggested. |
@whyrusleeping I'm removing AddRecursive and RemoveRecursive so I can finally remove the |
These past weeks, I have been thinking on how to include IPLD in IPFS, and my last idea is to transform the Get() methods on DAGService and NodeGetter to GetPB() methods. And add a Get() method that returns an IPLDNode instead of a protocol buffer Node. Then gradually phase out the GetPB() method in favor of the Get() method. |
This prepares for inclusion of IPLD where the Node pointer won't be there. License: MIT Signed-off-by: Mildred Ki'Lya <mildred-pub.git@mildred.fr>
License: MIT Signed-off-by: Mildred Ki'Lya <mildred-pub.git@mildred.fr>
License: MIT Signed-off-by: Mildred Ki'Lya <mildred-pub.git@mildred.fr>
This function work only with protocol buffer encoding. To make this clear, rename the function. License: MIT Signed-off-by: Mildred Ki'Lya <mildred-pub.git@mildred.fr>
License: MIT Signed-off-by: Mildred Ki'Lya <mildred-pub.git@mildred.fr>
License: MIT Signed-off-by: Mildred Ki'Lya <mildred-pub.git@mildred.fr>
License: MIT Signed-off-by: Mildred Ki'Lya <mildred-pub.git@mildred.fr>
License: MIT Signed-off-by: Mildred Ki'Lya <mildred-pub.git@mildred.fr>
4a5d25e
to
34f8327
Compare
Tests are failing since commit "merkledag: Remove cached Node.node …". |
I don't know how onboard i am with the |
@whyrusleeping makes sense. I'll leave this commit out for the moment (in my next branch update). Also, I'd need to discuss how integration of IPLD could be done. Is there an issue for that ? Also, I'll need some review on ipld/go-ipld-deprecated#19 |
if err := i.node.DAG.AddRecursive(newnode); err != nil { | ||
webError(w, "Could not add recursively new node", err, http.StatusInternalServerError) | ||
if _, err := i.node.DAG.Add(newnode); err != nil { | ||
webError(w, "Could not add recursively root node", err, http.StatusInternalServerError) |
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.
should probably remove the word recursively here
one minor comment and then LGTM |
License: MIT Signed-off-by: Mildred Ki'Lya <mildred-pub.git@mildred.fr>
License: MIT Signed-off-by: Mildred Ki'Lya <mildred-pub.git@mildred.fr>
License: MIT Signed-off-by: Mildred Ki'Lya <mildred-pub.git@mildred.fr>
License: MIT Signed-off-by: Mildred Ki'Lya <mildred-pub.git@mildred.fr>
Corrected. |
Thanks! |
Simplify merkledag package interface to ease IPLD inclusion
Simplify merkledag package interface to ease IPLD inclusion This commit was moved from ipfs/kubo@91c6f0f
Obsoletes #1916 and #1902.
This prepares for inclusion of IPLD where the Node pointer might not be publicly accessible of even be there. We should probably move away from using the struct attributes and use functions to access them instead. This will make it easier to plug in IPLD in place of merkledag.