cli: set network.
This commit is contained in:
parent
e324e08bef
commit
883700ea37
14
bin/cli
14
bin/cli
@ -36,8 +36,8 @@ CLI.prototype.createWallet = function createWallet(callback) {
|
|||||||
if (this.config.master)
|
if (this.config.master)
|
||||||
options.master = this.config.master;
|
options.master = this.config.master;
|
||||||
|
|
||||||
if (this.config.keys)
|
if (this.config.key)
|
||||||
options.keys = this.config.keys.split(/[,:]/);
|
options.key = this.config.key;
|
||||||
|
|
||||||
if (this.config.m)
|
if (this.config.m)
|
||||||
options.m = this.config.m >>> 0;
|
options.m = this.config.m >>> 0;
|
||||||
@ -396,7 +396,8 @@ CLI.prototype.handleWallet = function handleWallet(callback) {
|
|||||||
|
|
||||||
this.wallet = new Wallet({
|
this.wallet = new Wallet({
|
||||||
uri: this.config.url || this.config.uri,
|
uri: this.config.url || this.config.uri,
|
||||||
apiKey: this.config.apiKey
|
apiKey: this.config.apiKey,
|
||||||
|
network: this.config.network
|
||||||
});
|
});
|
||||||
|
|
||||||
this.wallet.open(options, function(err) {
|
this.wallet.open(options, function(err) {
|
||||||
@ -473,7 +474,8 @@ CLI.prototype.handleNode = function handleNode(callback) {
|
|||||||
|
|
||||||
this.client = new Client({
|
this.client = new Client({
|
||||||
uri: this.config.url || this.config.uri,
|
uri: this.config.url || this.config.uri,
|
||||||
apiKey: this.config.apiKey
|
apiKey: this.config.apiKey,
|
||||||
|
network: this.config.network
|
||||||
});
|
});
|
||||||
|
|
||||||
this.client.getInfo(function(err, info) {
|
this.client.getInfo(function(err, info) {
|
||||||
@ -543,9 +545,9 @@ CLI.prototype.open = function open(callback) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
CLI.prototype.destroy = function destroy(callback) {
|
CLI.prototype.destroy = function destroy(callback) {
|
||||||
if (this.wallet)
|
if (this.wallet && !this.wallet.client.loading)
|
||||||
this.wallet.client.destroy();
|
this.wallet.client.destroy();
|
||||||
if (this.client)
|
if (this.client && !this.client.loading)
|
||||||
this.client.destroy();
|
this.client.destroy();
|
||||||
callback();
|
callback();
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user