From b3b1b13795a8deaf7eee08f40e2ea4d27696d418 Mon Sep 17 00:00:00 2001 From: Chris Hitchcott Date: Mon, 31 Aug 2015 00:48:38 +0800 Subject: [PATCH] implement `getStartBlockchainCommand` to return geth CLI string --- lib/blockchain.js | 5 +++++ lib/index.js | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/lib/blockchain.js b/lib/blockchain.js index 45c8bd9e..9ab37a5c 100644 --- a/lib/blockchain.js +++ b/lib/blockchain.js @@ -126,4 +126,9 @@ Blockchain.prototype.execGeth = function(args) { exec(cmd); } +Blockchain.prototype.getStartChainCommand = function(use_tmp) { + var address = this.get_address(); + return this.run_command(address, use_tmp); +} + module.exports = Blockchain diff --git a/lib/index.js b/lib/index.js index e81dcc4b..07797fb2 100644 --- a/lib/index.js +++ b/lib/index.js @@ -35,6 +35,11 @@ Embark = { chain.startChain(use_tmp); }, + getStartBlockchainCommand: function(env, use_tmp) { + var chain = new Blockchain(this.blockchainConfig.config(env)); + return chain.getStartChainCommand(use_tmp); + }, + deployContracts: function(env, contractFiles, destFile, chainFile) { this.contractsConfig.init(contractFiles, env);