Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ The environment is a specific blockchain configuration that can be managed at co
chains: chains_staging.json
network_id: 0
console: true
geth_extra_opts: --vmdebug
account:
init: false
address: 0x123
Expand Down
2 changes: 1 addition & 1 deletion boilerplate/Gruntfile.coffee
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = (grunt) ->

grunt.option 'stack', true
grunt.loadNpmTasks "grunt-embark"
grunt.loadTasks "tasks"

Expand Down Expand Up @@ -111,4 +112,3 @@ module.exports = (grunt) ->

grunt.registerTask "deploy", ["coffee", "deploy_contracts", "concat", "copy", "server", "watch"]
grunt.registerTask "build", ["clean", "deploy_contracts", "coffee", "concat", "uglify", "copy"]

4 changes: 4 additions & 0 deletions lib/blockchain.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Blockchain.prototype.generate_basic_command = function() {
cmd += "--logfile=\"" + config.datadir + ".log\" ";
}

if (config.geth_extra_opts) {
cmd += config.geth_extra_opts + " ";
}

cmd += "--port " + config.port + " ";
cmd += "--rpc ";
cmd += "--rpcport " + config.rpcPort + " ";
Expand Down
6 changes: 5 additions & 1 deletion lib/chain_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ ChainManager.prototype.loadConfig = function(config) {
ChainManager.prototype.init = function(env, config) {
web3.setProvider(new web3.providers.HttpProvider("http://" + config.rpcHost + ":" + config.rpcPort));

var chainId = web3.eth.getBlock(0).hash;
var block = web3.eth.getBlock(0);
if(!block){
throw new Error("Cannot get the genesis block, is embark blockchain running ?");
}
var chainId = block.hash;

if (this.chainManagerConfig[chainId] === undefined) {
this.chainManagerConfig[chainId] = {contracts: {}};
Expand Down
3 changes: 2 additions & 1 deletion lib/config/blockchain.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ BlockchainConfig.prototype.config = function(env) {
console_toggle: config.console || false,
mine_when_needed: config.mine_when_needed || false,
whisper: config.whisper || false,
account: config.account
account: config.account,
geth_extra_opts: config.geth_extra_opts
}

return config;
Expand Down