-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Conversation
> **Will come soon** | ||
```js | ||
var fs = require('fs'); | ||
var promisify = require('promisify-es6') |
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.
The variable promisify
does not seem to be used anywhere below in your examples.
(Should you decide to delete this line?)
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.
I will remove that line. Thank you.
stream.pipe(process.stdout, { end : false }); | ||
}); | ||
} | ||
``` |
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.
please change the code style to be consistent with our code base, i.e standard
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.
Thanks for your feedback. I will read the standard and apply.
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.
Thank you :)
} | ||
|
||
function startDaemon() { | ||
node.goOnline(function(msg) {}); |
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 should probably call addFile
in the callback to trigger the interaction once the node is online.
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.
I will fix this up.
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.
Is the idea that you would go online do some work and then go offline.
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.
That was my thought at least, did you have something else in mind?
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.
Looks good to me, but I would change one thing. Right now, the example is not actually doing anything but setting up some functions for future need. I think it would be useful to have the whole dance of init -> add file to IPFS, get hash -> get file via hash and print it out.
I'll will make it dance. |
I'm not able to get Node.id() to work. Am I missing something? The promise doesn't ever return, It appears to hang. node.id().then(function(data) { |
Let me know what you guys think about this example! |
@SidHarder looks great! Thanks a lot for adding this. Got two minor points.
|
@victorbjelkholm I would also prefer to use callbacks but for example when I use this: node.files.add(readStream, function(data) { There is no data. I don't seem to get the hash from the call back. When I do: node.files.add(readStream).then(function (data) { I get the hash back and can proceed. I am missing something? This is what led me to mix callback with promises. Thanks for your help. |
@SidHarder Node.js callbacks tend to have the signature |
@Mithgol I forgot, error first. Thanks. |
@victorbjelkholm I'm afraid I don't get your point on this "Probably want to change the default path to the repo, instead of using ~/.ipfs". |
I see that someone made some changes to the readme.md and did a much better job. This pr can be closed. Thanks for everyone's help. |
Oh, apologies @SidHarder, should have had continued on top of your PR, but ended up just completing the Readme as I was updating it with the awesome IPLD PR as I wanted to open this discussion #556 Nevertheless, your example has way more information, could you PR the example as working code into the examples folder? |
Closing in favor of #576 |
test: add missing tests
No description provided.