-
Notifications
You must be signed in to change notification settings - Fork 119
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
Add status endpoint to check pin and deal info per cid #78
Comments
@ribasushi is |
also, i'd be reaching for |
As for the enpoint path |
As far as I am concerned - 100%, and this is what the corresponding lotus CLI/API part is called filecoin-project/lotus#6393 (comment). Caveat emptor: opinions differ on this somewhat
I'd use activation yeah. In corner cases it can be weeks between a specific piece-cid<=>miner deal being "conceived" and it actually landing on chain. |
@ribasushi thanks! Should we include the batchCID here too? is it the batch cid or the piece cid that one would need to apply the dataModelSelector ? |
Errrr wait... I didn't read this close enough :(
|
And that Data Cid Is what we (internally) store as the Batch cid, right? |
love it! |
I think Apart from the missing batchCid/dataCid/rootCid the response looks great. If this is authenticated then we can also include the upload I originally thought we'd only have a public status API but I'm struggling to think of use cases where this is beneficial - help? |
I think the benefit to a public status api is contingent on what you’re
building - no?
it feels like especially since web3 is supposed to be open we might run
into cases where this comes up more frequently - valist as an example may
want to act as the “storer” for their users packages, but wouldn’t
necessarily want each relay mode to need to proxy through them to check on
the deal info / status of a cid right? Like in the ideal version this info
would not be maintained by us but queryable out of a public deal index - so
maybe better form to map to that?
I guess my reaction is slightly the reverse - where if these are all stored
on a public network wouldn’t it make more sense for the status api to be
public? I think making this api scoped to users might (slightly further)
remove of us from being permissionless
…On Tue, Jul 13, 2021 at 6:52 PM Alan Shaw ***@***.***> wrote:
I think GET /user/uploads/:cid/status is good... if it's scoped to the
user's uploads.
Apart from the missing batchCid/dataCid/rootCid the response looks great.
If this is authenticated then we can also include the upload name (and
created date?), which might be helpful.
I originally thought we'd only have a *public* status API but I'm
struggling to think of use cases where this is beneficial - help?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#78 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFAHCS3QNNWJJNSMQKKC6LLTXS7UDANCNFSM5AKADQ7A>
.
|
@olizilla correct! |
@jnthnvctr i'm inclinded to start with "a user can ask about the status of CIDs they have stored". It would then not be much work to open that api to allow anyone to check the status of a CID. |
@ribasushi just for my context, when you said
...what do you refer to a batch as now? |
@olizilla I call it |
For the scope of this enpoint we could
I assumed I was building 1. where a user could check on their stuff. But it is simpler to build the public version. The concern there would be folks hammering the api, and a nebulous concern about leaking info about what our users are storing. Filecoin deal info is public, but I don't think it's currently possible for anyone to determine which CIDs are contained within which deals. On the flip side, you'd also have to already have the content or be given the CID to ask about it, so this may not be a concern. |
The above is 100% the desired endstate, be it M1 or M2. |
@olizilla every deal our aggregator makes carries a complete manifest of what is contained therein, as the first entry of the first directory, by design. This is to allow indexers and plain curious bystanders to attempt a retrieval of |
Agreed with @ribasushi I think we want to do (3) - but this is a good reminder that in the docs (cc @terichadbourne ) we should be heavily emphasizing that these are public open networks and the onus is on users to be encrypting before sticking into these systems. @olizilla re: your last comment - I think the last bit is right, for a lot of these concerns they require knowledge about a CID already (if they had the CID they could also just request teh content out of IPFS), so its not necessarily leaking additional information. In the end state of what a deal indexing should surface, you would be able to come with a CID to request deal info (which miners have X CID) - so I'd nudge us to mirror that (eventual) world. I think that does mean that the info contained in the Status API should only be the public network info (so not exposing user defined names, creation time) - as even in the end state of a public deal index we wouldn't have those. |
@jnthnvctr GOOD NEWS. I read the vibe. You and everyone commented in favour of option 3, so that is what I have implemented in #82 |
- add **Unauthenticated** enpoint for checking pin and deal status by CID. - adds mock and fixture for testing. - only show pins and deals that are queued or active. **Example reponse** `GET /status/testcid` ```json { "cid": "testcid", "dagSize": 101, "pins": [{ "peerId": "12D3KooWR1Js", "peerName": "who?", "region": "where?", "status": "Pinned" }], "deals": [{ "dealId": 12345, "miner": "f99", "status": "Active", "activation": "<iso timestamp>", "pieceCid": "baga", "dataCid": "bafy", "dataModelSelector": "Links/0/Links" }] } ``` Fixes #78 License: (Apache-2.0 AND MIT) Signed-off-by: Oli Evans <oli@tableflip.io>
Is it possible to get the timestamp of when the CID was first written to web3.storage and when each deal completed? we want metrics on this anyway, so we want to make sure we capture all that data. if we have the data we might as well expose it here too. |
Yes! we have a |
- add `created` denoting when we first saw this content - add `pins.updated` for when the pin status last changed - add `deals.created` and `deals.updated` to the filecoin deal status - updated tests and docs - fix 404 logic fixes #78 (comment) **Example status response** ```json { "cid": "testcid", "created": "2021-07-14T19:27:14.934572Z", "dagSize": 101, "pins": [{ "peerId": "12D3KooWR1Js", "peerName": "who?", "region": "where?", "status": "Pinned", "created": "2021-07-14T19:27:14.934572Z", }], "deals": [{ "dealId": 12345, "miner": "f99", "status": "Active", "pieceCid": "baga", "dataCid": "bafy", "dataModelSelector": "Links/0/Links", "activation": "<iso timestamp>", "created": "2021-07-14T19:27:14.934572Z", "updated": "2021-07-14T19:27:14.934572Z" }] } ``` License: (Apache-2.0 AND MIT) Signed-off-by: Oli Evans <oli@tableflip.io>
GET /user/uploads/:cid
Proposed respsonse shape:
This is the subset of properties in the current w3 schema that have some relevance to the user, flattened. Most
Batch
info is removed, apart from thepieceCid
, thedataCid
(the cid of the batch) thedataModelSelector
, which, I'm told, could be used to extract the cid from the Piece.The full shape of the schema that is available can be seen in the Fauna GraphQL explorer below for comparison
The text was updated successfully, but these errors were encountered: