Comments (8)
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.
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.
from js-cluster-client.
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.
i am having this same issue in v0.09 @vasa-develop
from js-cluster-client.
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.
@vasa-develop any ideas?
from js-cluster-client.
sorry guys, my notifications were turned off. So I missed the messages
from js-cluster-client.
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)
- improve documentation HOT 1
- changing the repo name to `js-cluster-api` HOT 2
- addFromFS HOT 5
- cluster.recover local=true limitation? HOT 4
- Cloud add typescript types? HOT 1
- Add function return [] when pass Buffer. HOT 1
- cluster.pin.ls throws error when used with 'filter' option HOT 1
- [NodeJs] Not able to import
- Not able to ADD peer to a cluster using HTTP endpoint
- Add GLOBAL options HOT 1
- Add more tests HOT 1
- remove `peers.add`
- Release 0.0.7 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-cluster-client.