mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-02-17 01:37:26 +00:00
Add option to run geth with any command
This commit is contained in:
parent
6b3cce3cbf
commit
92173c9907
13
bin/embark
13
bin/embark
@ -139,6 +139,18 @@ program.command('blockchain [env]').description('run blockchain').action(functio
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
program.command('geth <env> [args...]').description('run geth with specified arguments').action(function(env_, args_) {
|
||||||
|
var env = env_ || 'development';
|
||||||
|
var embarkConfig = readYaml.sync("./embark.yml");
|
||||||
|
var args = args_.join(' ');
|
||||||
|
|
||||||
|
Embark.init()
|
||||||
|
Embark.blockchainConfig.loadConfigFile(embarkConfig.blockchainConfig)
|
||||||
|
Embark.contractsConfig.loadConfigFile(embarkConfig.contractsConfig)
|
||||||
|
|
||||||
|
Embark.geth(env, args);
|
||||||
|
});
|
||||||
|
|
||||||
program.command('demo').description('create a working dapp with a SimpleStorage contract').action(function() {
|
program.command('demo').description('create a working dapp with a SimpleStorage contract').action(function() {
|
||||||
var boilerPath = path.join(__dirname + '/../boilerplate');
|
var boilerPath = path.join(__dirname + '/../boilerplate');
|
||||||
var demoPath = path.join(__dirname + '/../demo');
|
var demoPath = path.join(__dirname + '/../demo');
|
||||||
@ -169,4 +181,3 @@ if (!process.argv.slice(2).length) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exit();
|
exit();
|
||||||
|
|
||||||
|
@ -57,6 +57,10 @@ Blockchain.prototype.init_command = function() {
|
|||||||
return this.generate_basic_command() + "account new ";
|
return this.generate_basic_command() + "account new ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Blockchain.prototype.geth_command = function(geth_args) {
|
||||||
|
return this.generate_basic_command() + geth_args;
|
||||||
|
}
|
||||||
|
|
||||||
Blockchain.prototype.run_command = function(address, use_tmp) {
|
Blockchain.prototype.run_command = function(address, use_tmp) {
|
||||||
var cmd = this.generate_basic_command();
|
var cmd = this.generate_basic_command();
|
||||||
var config = this.config;
|
var config = this.config;
|
||||||
@ -116,4 +120,10 @@ Blockchain.prototype.startChain = function(use_tmp) {
|
|||||||
exec(this.run_command(address, use_tmp));
|
exec(this.run_command(address, use_tmp));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Blockchain.prototype.execGeth = function(args) {
|
||||||
|
var cmd = this.geth_command(args);
|
||||||
|
console.log("executing: " + cmd);
|
||||||
|
exec(cmd);
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = Blockchain
|
module.exports = Blockchain
|
||||||
|
@ -44,8 +44,12 @@ Embark = {
|
|||||||
return deploy.generate_abi_file(destFile);
|
return deploy.generate_abi_file(destFile);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
geth: function(env, args) {
|
||||||
|
var chain = new Blockchain(this.blockchainConfig.config(env));
|
||||||
|
chain.execGeth(args);
|
||||||
|
},
|
||||||
|
|
||||||
release: Release
|
release: Release
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Embark;
|
module.exports = Embark;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user