Feature Request: 'dag.Copy' function
Similar to io.Copy, I want a dag.Copy (or ipld.Copy) function that transfers a given graph from a source dagservice to a target dagservice.
hello @whyrusleeping , i am interested in this issue.Can u explain more clear about how ipld.Copy use?Thx
Hey @kjzz, I'm imagining the function signature would look like:
func Copy(from, to DAGService, root *cid.Cid) error
And the function would just recursively load each object from the from dagservice, and write it to the to dagservice.
Something a bit more idempotent might be nice.
func EnsureReplicated(root Cid, at DAGService, from ...DAGService)
?
@warpfork I think the implementation could be smart, but Copy has better textual semantics (people more easily understand 'copy'). Though maybe theres a middle ground here?
hey @whyrusleeping , i have open a pr about the featiure.Can you help me check it if my pr #41 meet the requirements?any question ,please ping me. Thx a lot.