From 32d63514bf3a98b6e25533cc8939dd6ab3c4e91c Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 17 Jan 2018 11:23:32 -0500 Subject: [PATCH] increase default gas value; add parameters --- boilerplate/config/blockchain.json | 1 + boilerplate/config/development/genesis.json | 2 +- demo/config/blockchain.json | 1 + demo/config/development/genesis.json | 2 +- lib/cmds/blockchain/blockchain.js | 3 ++- lib/cmds/blockchain/geth_commands.js | 6 ++++++ test_app/config/blockchain.json | 1 + test_app/config/development/genesis.json | 2 +- 8 files changed, 14 insertions(+), 4 deletions(-) diff --git a/boilerplate/config/blockchain.json b/boilerplate/config/blockchain.json index 961c8be6..c6d47142 100644 --- a/boilerplate/config/blockchain.json +++ b/boilerplate/config/blockchain.json @@ -13,6 +13,7 @@ "account": { "password": "config/development/password" }, + "targetGasLimit": 8000000, "wsOrigins": "http://localhost:8000", "wsRPC": true, "wsHost": "localhost", diff --git a/boilerplate/config/development/genesis.json b/boilerplate/config/development/genesis.json index 4a50a438..4b6ce0db 100644 --- a/boilerplate/config/development/genesis.json +++ b/boilerplate/config/development/genesis.json @@ -12,5 +12,5 @@ "timestamp": "0x00", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "extraData": "0x", - "gasLimit": "0x4c4b40" + "gasLimit": "0x7a1200" } diff --git a/demo/config/blockchain.json b/demo/config/blockchain.json index 215b68c4..1d02efce 100644 --- a/demo/config/blockchain.json +++ b/demo/config/blockchain.json @@ -13,6 +13,7 @@ "account": { "password": "config/development/password" }, + "targetGasLimit": 8000000, "wsOrigins": "http://localhost:8000", "wsRPC": true, "wsHost": "localhost", diff --git a/demo/config/development/genesis.json b/demo/config/development/genesis.json index 4a50a438..4b6ce0db 100644 --- a/demo/config/development/genesis.json +++ b/demo/config/development/genesis.json @@ -12,5 +12,5 @@ "timestamp": "0x00", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "extraData": "0x", - "gasLimit": "0x4c4b40" + "gasLimit": "0x7a1200" } diff --git a/lib/cmds/blockchain/blockchain.js b/lib/cmds/blockchain/blockchain.js index 524cba5a..9c9d600f 100644 --- a/lib/cmds/blockchain/blockchain.js +++ b/lib/cmds/blockchain/blockchain.js @@ -37,7 +37,8 @@ var Blockchain = function(options) { wsPort: this.blockchainConfig.wsPort || 8546, wsOrigins: this.blockchainConfig.wsOrigins || false, wsApi: (this.blockchainConfig.wsApi || ['eth', 'web3', 'net', 'shh']), - vmdebug: this.blockchainConfig.vmdebug || false + vmdebug: this.blockchainConfig.vmdebug || false, + targetGasLimit: this.blockchainConfig.targetGasLimit || false }; if (this.blockchainConfig === {} || JSON.stringify(this.blockchainConfig) === '{"enabled":true}') { diff --git a/lib/cmds/blockchain/geth_commands.js b/lib/cmds/blockchain/geth_commands.js index 2e25f2ef..e28e559c 100644 --- a/lib/cmds/blockchain/geth_commands.js +++ b/lib/cmds/blockchain/geth_commands.js @@ -193,6 +193,12 @@ class GethCommands { } callback(null, ""); }, + function gasLimit(callback) { + if (config.targetGasLimit) { + return callback(null, "--targetgaslimit " + config.targetGasLimit); + } + callback(null, ""); + }, function mineWhenNeeded(callback) { if (config.mineWhenNeeded) { return callback(null, "js .embark/" + self.env + "/js/mine.js"); diff --git a/test_app/config/blockchain.json b/test_app/config/blockchain.json index b23fea5f..41400449 100644 --- a/test_app/config/blockchain.json +++ b/test_app/config/blockchain.json @@ -13,6 +13,7 @@ "account": { "password": "config/development/password" }, + "targetGasLimit": 8000000, "wsOrigins": "http://localhost:8000", "wsRPC": true, "wsHost": "localhost", diff --git a/test_app/config/development/genesis.json b/test_app/config/development/genesis.json index 4a50a438..4b6ce0db 100644 --- a/test_app/config/development/genesis.json +++ b/test_app/config/development/genesis.json @@ -12,5 +12,5 @@ "timestamp": "0x00", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "extraData": "0x", - "gasLimit": "0x4c4b40" + "gasLimit": "0x7a1200" }