forked from bitpay/bitcore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwallet-genkey
executable file
·24 lines (21 loc) · 1012 Bytes
/
wallet-genkey
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/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('-c, --coin <coin>', 'coin (btc/bch)')
.option('-p, --password', 'Encrypt wallet. Will ask password interactively')
.parse(process.argv);
var args = program.args;
var network = program.testnet ? 'testnet' : 'livenet';
var coin = program.coin ? 'btc' : 'bch';
utils.getClient(program, { doNotComplete: true, mustBeNew: true }, function (client) {
client.seedFromRandom({network:network, coin:coin});
utils.saveClient(program, client, function () {
console.log(' * ' + _.capitalize(network) + '/' + coin + ' 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`.');
});
});