-
Notifications
You must be signed in to change notification settings - Fork 21
Adds endpoint for client.queryStorageDeal #67
Adds endpoint for client.queryStorageDeal #67
Conversation
1554803
to
9a042cc
Compare
9a042cc
to
627ee20
Compare
"PieceInclusionProof":"EiAbbOy4pChsCYqFYA6qJaUJYStlnwYMdQPHZX7YBkVXDD6vgmGTPnWrcdA9M0oAXQCzOq735YKySLUoTI6pAw==" | ||
}, | ||
"Signature":"c2lnbmF0dXJycmVlZQ==" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make this more idiomatic for JS users we should convert the root and ProofInfo
to camel case using the toCamel
utility.
e.g. res.ProofInfo.PieceInclusionProof
should be accessed like res.proofInfo.pieceInclusionProof
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
API.md
Outdated
"Message":"", | ||
"ProposalCid": | ||
{ | ||
"/":"zDPWYqFD8CNXu7Mo9qPSUANbTK2vi9vJBnvavF9S1pVGPHafVHpT" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an artifact of CID encoding in IPLD, to make it easier to work with we replace CID objects like this with the CID string. e.g.
It would be nice to get an e2e test for this (and other commands you're submitting). The current ones run against an already started daemon. It would be even more rad if you were to tackle #69 |
* '/api/client/query-storage-deal' Query a storage deal's status Arguments * arg [string]: CID of deal to query Required: yes. Response On success, the call to this endpoint will return with 200 and the following body: { "State":7, "Message":"", "ProposalCid": { "/":"zDPWYqFD8CNXu7Mo9qPSUANbTK2vi9vJBnvavF9S1pVGPHafVHpT" }, "ProofInfo": { "SectorID":1, "CommitmentMessage": { "/":"zDPWYqFCtHkWNkE2p6t6TeV1sPP5kbnKc5ajUhMVV8xvrw1u5F1R" }, "PieceInclusionProof":"EiAbbOy4pChsCYqFYA6qJaUJYStlnwYMdQPHZX7YBkVXDD6vgmGTPnWrcdA9M0oAXQCzOq735YKySLUoTI6pAw==" }, "Signature":"c2lnbmF0dXJycmVlZQ==" }
627ee20
to
de388a3
Compare
Hey @alanshaw, I'd be happy to tackle it but would probably need some additional context. I'm happy to start comments on the issue, but any chance you can chat? |
cbeff10
to
68b7174
Compare
* In order to be more idiomatic for JavaScript * Modified the incoming proposalCid, which was historically encoded in IPLD
68b7174
to
8b896fb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nearly there!
|
||
if (storageDeal.proofInfo) { | ||
storageDeal.proofInfo = toCamel(storageDeal.proofInfo) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to fix the CID here too!
} | |
} | |
if (storageDeal.proofInfo && storageDeal.proofInfo.commitmentMessage) { | |
storageDeal.proofInfo.commitmentMessage = storageDeal.proofInfo.commitmentMessage['/'] | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added it as part of the commit.
I'm in #filecoin on freenode if you'd like to discuss! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any chance you can fix up the linting warnings also? 🙏 https://circleci.com/gh/filecoin-project/js-filecoin-api-client/94
Fixed up the linting and added the commitmentMessage in the new format. That had been an outstanding question in my mind. I'm on #filecoin as |
Oh, I'm on #filecoin Slack. I haven't joined the IRC... |
@alanshaw Hey! Is there anything else? Relatedly, I looked into doing the e2e tests for any of these new endpoints, but to me it seems like I'd need the ability to spin up a new daemon for any of them? |
@mishmosh I made some progress towards this today and published https://www.npmjs.com/package/go-filecoin-dep. The AI is for me to document in #69 the requirements for a module that is a utility to spawn a fresh filecoin node that we can use for e2e testing. @hazmatzo this is great - thanks a lot ❤️ |
Adds endpoint to query a storage deal
Solves issue #16
Endpoint
/api/client/query-storage-deal
Description
Query a storage deal's status
Arguments
Response
On success, the call to this endpoint will return with 200 and the following body:
resolves #16