come off the pin/unpin channels.
Also fix a race condition in the operationTracker.
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
to the ipfscluster.IPFSConnector interface and then
to the implementation of that interface in ipfsconn/ipfshttp.
This allows calls from MapPinTracker to cancel requests made
to the local IPFS node.
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
The TrackerStatuses were starting to be used to convey the inflight
status of an 'operation', instead of just the status of the Pin.
I have separated out any thing related to 'operations' and
an operation's 'phases'.
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
ipfshttp: cancel POST request when timeout reached
ipfshttp/config: fix config test
ipfshttp: use struct styling for multi-line func calls
ipfshttp/config: add general ClientTimeout
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
query args correctly, requiring both a trailing slash and
non-trailing slash handle pattern to be defined for the
pin and unpin handlers.
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
The extractCid function was added to enable the extraction of
a cid argument from either the url path or query string.
This puts the proxy behaviour on par with the current IPFS API.
The function does rely on the fact that ipfs-cluster doesn't
intercept any command that has more than one subcommand.
If that changes, this function will have to be updated.
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
This uses the PeerAdd endpoint which should NOT be used as the current
workflow states that the way to adding peers is bootstrapping.
Adding peers manually with this endpoint leads to split-head states very
easily. The fact that this operation is visible in ipfs-cluster-ctl
is only leading the users to bad places.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
`basic_auth_credentials` in `api` part of the config accepts a map, with username as key and password as value.
License: MIT
Signed-off-by: Sina Mahmoodi <itz.s1na@gmail.com>
* Test case creates a bunch of clusters, assigns a pin with replica factor
of n-1 to them, and removes one of the peers randomly. It then tests
to check that the number of clusters pinning the cid is n-2.
* Add warn log to let user know that due to disable_repinning option,
the cluster won't attempt to re-assign the pin.
License: MIT
Signed-off-by: Sina Mahmoodi <itz.s1na@gmail.com>
It should provide a way to speed up peer list updates when
peers join/part. It was hardcoded.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
The --wait flag was being completely ignored unless --no-status was passed
too, which makes no sense because then it would print the wait status.
This waits when --wait and prints the status when --no-status is not passed.
If we have been waiting, the status comes from that. Otherwise we request it.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
Refactor daemon() to reduce code complexity.
Refactor configuration in ipfs-cluster-service.
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
The rest/client does things like "return id.ToID(), err" which is nice.
But when there's an error the ID has Cid set to nil etc. This is now
causing error messages on the console which are very misleading because
they do not correspond to the actual error of the request.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>