Coder Social home page Coder Social logo

Comments (8)

danazkari avatar danazkari commented on June 9, 2024 3

I'm also having issues if I try to send just the buffer, instead I had to send an object with a path key, eventhough that key value is not used for anything useful in the IPFS context

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!

from js-cluster-client.

vasa-develop avatar vasa-develop commented on June 9, 2024 1

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.

add-test

from js-cluster-client.

hsanjuan avatar hsanjuan commented on June 9, 2024

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).

from js-cluster-client.

d7laungani avatar d7laungani commented on June 9, 2024

i am having this same issue in v0.09 @vasa-develop

from js-cluster-client.

marwyn-the-developer avatar marwyn-the-developer commented on June 9, 2024

I am also facing the same issue in v0.0.9. The answers provided are not comprehensive since the link returns a 404 message.

from js-cluster-client.

hsanjuan avatar hsanjuan commented on June 9, 2024

@vasa-develop any ideas?

from js-cluster-client.

vasa-develop avatar vasa-develop commented on June 9, 2024

sorry guys, my notifications were turned off. So I missed the messages

from js-cluster-client.

NadeeraM avatar NadeeraM commented on June 9, 2024

I commented following if condition in FileResultStreamConverter and then it works. But not sure why that constrain is there.
In _transform ->

if (!obj.name) {
return callback()
}

Then it returns object with empty path attribute.

[ { path: '',
hash: 'QmRHza6PjWyFpCdPZcafRybrjyaqQC2fnNfNesd7oEirid',
size: 22 } ]

from js-cluster-client.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.