Skip to content
This repository was archived by the owner on Aug 23, 2021. It is now read-only.

Adds new api endpoint api/retrieval-client/retrieve-piece #66

Conversation

hazmatzo
Copy link
Contributor

@hazmatzo hazmatzo commented Aug 6, 2019

Adds an endpoint to retrieve piece data stored by a miner on the network. This endpoint is modeled on cat and is similar in functionality.

Solves issue #40

Endpoint
api/retrieval-client/retrieve-piece

Description
Read out piece data stored by a miner on the network

Arguments

  • arg [string]: Retrieval miner actor address Required: yes.
  • arg [string]: Content identifier of piece to read Required: yes.

Response
On success, the call to this endpoint will return with 200 and the following body:

This endpoint returns binary data.

resolves #40

* api/retrieval-client/retrieve-piece

    Read out piece data stored by a miner on the network

    Arguments
    * arg [string]: Retrieval miner actor address Required: yes.
    * arg [string]: Content identifier of piece to read Required: yes.

    Response
    On success, the call to this endpoint will return with 200 and the following body:
    This endpoint returns binary data.
@hazmatzo hazmatzo changed the title Adds new api endpoint api/retrieval-client/retrieve-piece WIP -- Adds new api endpoint api/retrieval-client/retrieve-piece Aug 6, 2019
@hazmatzo hazmatzo changed the title WIP -- Adds new api endpoint api/retrieval-client/retrieve-piece Adds new api endpoint api/retrieval-client/retrieve-piece Aug 6, 2019
@hazmatzo
Copy link
Contributor Author

hazmatzo commented Aug 6, 2019

@alanshaw Hey! Here is the endpoint for retrieval-client/retrieve-piece. Thanks!

@hazmatzo hazmatzo force-pushed the api/retrieval-client/retrieve-piece branch 2 times, most recently from fc8a4b9 to c04e88c Compare August 6, 2019 22:04
@hazmatzo
Copy link
Contributor Author

hazmatzo commented Aug 6, 2019

Also, I had one outstanding question, which is whether this ever returns type <UInt8Array> for the browser, since this is what cat says it returns and as far as I can tell, cat and retrievePiece return basically the same thing.

@mishmosh mishmosh requested a review from alanshaw August 7, 2019 18:19
@hazmatzo hazmatzo force-pushed the api/retrieval-client/retrieve-piece branch from c04e88c to 89c908c Compare August 7, 2019 21:14
Copy link
Member

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alanshaw alanshaw merged commit 9e2a637 into filecoin-shipyard:master Aug 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add command retrievalClient.retrievePiece
2 participants