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' command doesn't return the CID for the added data. #3
Comments
|
I think the problem is here: https://github.com/ipfs/js-ipfs-http-client/blob/master/src/utils/file-result-stream-converter.js#L38 That converter is expecting "add" objects as IPFS returns them, but cluster returns slightly different ones ("hash" is "cid" and "size" is a number and not a string). |
What a coincidence...I just found this too ;) It's working now! BTW, thanks for the quick response. |
|
i am having this same issue in v0.09 @vasa-develop |
|
I am also facing the same issue in v0.0.9. The answers provided are not comprehensive since the link returns a 404 message. |
|
@vasa-develop any ideas? |
|
I'm also having issues if I try to send just the buffer, instead I had to send an object with a const res = await ipfs.add({path:'dummy-name', content: fileBuffer})
// res -> [ { path: 'dummy-name', hash: '...', size: 15 } ]So for now that's what I'm doing, because if I give it just the buffer, then it just returns an empty array. Hope this helps someone! |
|
sorry guys, my notifications were turned off. So I missed the messages |
|
I commented following if condition in FileResultStreamConverter and then it works. But not sure why that constrain is there. if (!obj.name) { Then it returns object with empty path attribute. |

vasa-develop commentedMay 8, 2019
•
edited
In v0.0.3 when we do:
We get an empty array:
[]Somehow we aren't getting the CID object(which can be accessed using a normal POST request).
Here is what I have found:
The text was updated successfully, but these errors were encountered: