mirror of https://github.com/embarklabs/embark.git
Merge pull request #80 from jorisbontje/deploy-timeout-config
configurable deploy timeout per environment
This commit is contained in:
commit
c39c9b6c38
|
@ -19,6 +19,7 @@ staging:
|
|||
rpc_whitelist: "*"
|
||||
datadir: default
|
||||
network_id: 0
|
||||
deploy_timeout: 45
|
||||
console: true
|
||||
account:
|
||||
init: false
|
||||
|
|
|
@ -41,6 +41,7 @@ BlockchainConfig.prototype.config = function(env) {
|
|||
genesisBlock: config.genesis_block,
|
||||
datadir: config.datadir,
|
||||
chains: config.chains,
|
||||
deployTimeout: config.deploy_timeout || 20,
|
||||
networkId: networkId,
|
||||
maxPeers: 4,
|
||||
port: config.port || "30303",
|
||||
|
|
|
@ -39,7 +39,7 @@ Deploy.prototype.deploy_contract = function(contractObject, contractParams) {
|
|||
while ((receipt = web3.eth.getTransactionReceipt(transactionHash)) === null || receipt.contractAddress === null) {
|
||||
sleep(1000);
|
||||
time += 1;
|
||||
if (time >= 20) {
|
||||
if (time >= this.blockchainConfig.deployTimeout) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -176,4 +176,3 @@ Deploy.prototype.generate_and_write_abi_file = function(destFile) {
|
|||
};
|
||||
|
||||
module.exports = Deploy;
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ describe('embark.config.blockchain', function() {
|
|||
genesis_block: 'config/genesis.json',
|
||||
datadir: '/tmp/embark',
|
||||
chains: 'chains_development.json',
|
||||
deploy_timeout: 45,
|
||||
mine_when_needed: true,
|
||||
gas_limit: 123,
|
||||
gas_price: 100,
|
||||
|
@ -69,6 +70,7 @@ describe('embark.config.blockchain', function() {
|
|||
genesisBlock: 'config/genesis.json',
|
||||
datadir: '/tmp/embark',
|
||||
chains: 'chains_development.json',
|
||||
deployTimeout: 45,
|
||||
networkId: 0,
|
||||
maxPeers: 4,
|
||||
port: "30303",
|
||||
|
@ -114,6 +116,7 @@ describe('embark.config.blockchain', function() {
|
|||
genesisBlock: undefined,
|
||||
datadir: '/tmp/embark',
|
||||
chains: undefined,
|
||||
deployTimeout: 20,
|
||||
networkId: 0,
|
||||
maxPeers: 4,
|
||||
port: "30303",
|
||||
|
|
Loading…
Reference in New Issue