23 lines
887 B
JavaScript
Executable File
23 lines
887 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
var _ = require('lodash');
|
|
var program = require('commander');
|
|
var fs = require('fs');
|
|
var utils = require('./cli-utils');
|
|
program = utils.configureCommander(program);
|
|
|
|
program
|
|
.option('-t, --testnet', 'Create a Testnet Extended Private Key')
|
|
.option('-p, --password', 'Encrypt wallet. Will ask password interactively')
|
|
.parse(process.argv);
|
|
|
|
var args = program.args;
|
|
var network = program.testnet ? 'testnet' : 'livenet';
|
|
utils.getClient(program, { doNotComplete: true, mustBeNew: true }, function (client) {
|
|
client.seedFromRandom(network);
|
|
utils.saveClient(program, client, function () {
|
|
console.log(' * ' + _.capitalize(network) + ' Extended Private Key Created.');
|
|
console.log(' To operate with the corresponding public keys from a proxy device, please run `wallet-export --nosign` and then on the proxy device `wallet-import`.');
|
|
});
|
|
});
|