configurable deploy timeout per environment. fixes #63
This commit is contained in:
parent
14b4cabb1b
commit
1d54018d2e
|
@ -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