Skip to content
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

"ipfs-cluster-ctl add --local" adds to the local peer #848

Closed
hsanjuan opened this issue Jul 23, 2019 · 3 comments · Fixed by #907
Closed

"ipfs-cluster-ctl add --local" adds to the local peer #848

hsanjuan opened this issue Jul 23, 2019 · 3 comments · Fixed by #907
Assignees
Labels
exp/intermediate Prior experience is likely helpful help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature P1 High: Likely tackled by core team if no one steps up status/ready Ready to be worked

Comments

@hsanjuan
Copy link
Collaborator

hsanjuan commented Jul 23, 2019

Describe the feature you are proposing

A --local flag to "ipfs-cluster-ctl add" should allow to add and pin only on the local peer (with replication-factor=1).

Additional context

Adding may be cumbersome if trying to reach a high replication factor with unavailable peers. This should allow users add to their local node only (they can then re-pin if they want to increase the replication factor).

This is almost the equivalent of adding with ReplicationFactor=1 + UserAllocations=LocalPeer. However, it might be probably best to carry it as a new, separate add option (to cover the case where there are no local metrics. In that case, the given UserAllocations would be ignored in favour of some other peer).

@hsanjuan hsanjuan added kind/enhancement A net-new feature or improvement to an existing feature help wanted Seeking public contribution on this issue exp/intermediate Prior experience is likely helpful status/ready Ready to be worked P1 High: Likely tackled by core team if no one steps up labels Jul 23, 2019
@hsanjuan
Copy link
Collaborator Author

Edit:

The local flag should specify that the blocks are added locally, regardless of the Allocations they are given. They will be added to the local IPFS peer rather than being sent to remote allocations. Pinning will proceed as normal, with the normal pin allocations, meaning rather than putting content directly at the location, it will have to be copied when pinning.

@hsanjuan hsanjuan changed the title "ipfs-cluster-ctl add --local" adds and allocates to the local peer only "ipfs-cluster-ctl add --local" adds to the local peer Jul 24, 2019
@kishansagathiya
Copy link
Contributor

I am thinking of not using adder for this.

A method for AddLocal could be added to cluster and IPFSConnector for this, which would accept a struct (not AddParams) containing file/dir path and some parameters.
And from handler just call rpc methods for AddLocal and then Pin

@hsanjuan
Copy link
Collaborator Author

Use the adder for this. Handle a new Local AdderParam in the adders.

What you are thinking does not work. The adding happens through a multipart upload in the API, not by reading a file from disk (ctl does the reading). And that would only be an option if you could stream from the API component to the IPFS component. So use the existing adder, which is way simpler, apart from being the only way I see to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/intermediate Prior experience is likely helpful help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature P1 High: Likely tackled by core team if no one steps up status/ready Ready to be worked
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants