-
Notifications
You must be signed in to change notification settings - Fork 29
Conversation
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. Suggested an easy change or two.
bin/batnode-sample.js
Outdated
const PERSONAL_DIR = require('../utils/file').PERSONAL_DIR; | ||
const HOSTED_DIR = require('../utils/file').HOSTED_DIR; | ||
const fileSystem = require('../utils/file').fileSystem; | ||
const fs = require('fs'); | ||
|
||
const BatNode = require('../kad-bat-plugin/batnode.js').BatNode; |
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.
Hm, one of the differences with my branch is I was working with the /batnode.js
file and not /kad-bat-plugin/batnode.js
. I'm not sure having multiple version of BatNode going forward will help us. Since /kad-bat-plugin/batnode.js
seems to work here, I think it might help if we copy it's contents, paste over what's in /batnode.js
. Then moving forward there won't be confusion about which batnode
file to reference. How does that sound?
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.
In "index.js", we will use the global batnode.js
(the one in home dir).
I actually test the global one in batchain-sample.js
and the audit still works, would you suggest I should change this require file back to the global one?
It shouldn't create errors with the updated batnode.js
.
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.
Huh cool I guess that wasn't my issue. Yeah if works with the global one then it seems like we should point the batchain-sample
file and related testing nodes to the global one. I really want to delete kad-bat-plugin.js
haha, but we don't necessarily need to do it in this PR - not actively using it is probably good enough.
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.
Once that's done it'll be good to merge for me.
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.
Require batnode.js in home dir: 2a78289
bat_sample | ||
.description("Demo connection for kad nodes and bat nodes") | ||
.option('-u, --upload <filePath>', 'upload files from specified file path') | ||
.option('-d, --download <manifestPath>', 'retrieve files from manifest file path') | ||
.option('-a, --audit <manifestPath>', 'audit files from manifest file path') |
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.
When we run a non-local demo we'll want to use the batchain
command and not batchain-sample
, so I'm thinking that we should include these changes from batnode-sample
in bin/index.js
as well.
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.
client = cliNode.connect(1800, 'localhost'); | ||
|
||
console.log(chalk.yellow('You can audit file to make sure file integrity')); |
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 was thinking that messages like this could live in a constants folder. So it might look like constants/messages.js
. We don't necessarily need to do this now, so I created an issue for it.
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.
Agree with it. Thanks for the issue and will need to move the logs later.
In constants.js, I commented out the network testing seed and uncommented the local testing seed. We will need to switch back to network seed by commenting the local seed again.
Note: I only add the audit test in
batnote-sample.js
so you will need to issue the command withbatnode-sample -a <manifestPath>
for the audit test