Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

CLI for local audit test #21

Merged
merged 5 commits into from
Mar 28, 2018
Merged

CLI for local audit test #21

merged 5 commits into from
Mar 28, 2018

Conversation

floalex
Copy link
Member

@floalex floalex commented Mar 28, 2018

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 with batnode-sample -a <manifestPath> for the audit test

Copy link
Member

@dylankb dylankb left a 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.

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;
Copy link
Member

@dylankb dylankb Mar 28, 2018

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?

Copy link
Member Author

@floalex floalex Mar 28, 2018

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.

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member Author

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')
Copy link
Member

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.

Copy link
Member Author

@floalex floalex Mar 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem! Updated with new commits f0b1b55
457618e and for index.js.

client = cliNode.connect(1800, 'localhost');

console.log(chalk.yellow('You can audit file to make sure file integrity'));
Copy link
Member

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.

Copy link
Member Author

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.

@floalex floalex merged commit b6cd2d7 into master Mar 28, 2018
@WilfredTA WilfredTA deleted the cli-localaudit branch September 29, 2018 03:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants