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: "*"
|
rpc_whitelist: "*"
|
||||||
datadir: default
|
datadir: default
|
||||||
network_id: 0
|
network_id: 0
|
||||||
|
deploy_timeout: 45
|
||||||
console: true
|
console: true
|
||||||
account:
|
account:
|
||||||
init: false
|
init: false
|
||||||
|
|
|
@ -41,6 +41,7 @@ BlockchainConfig.prototype.config = function(env) {
|
||||||
genesisBlock: config.genesis_block,
|
genesisBlock: config.genesis_block,
|
||||||
datadir: config.datadir,
|
datadir: config.datadir,
|
||||||
chains: config.chains,
|
chains: config.chains,
|
||||||
|
deployTimeout: config.deploy_timeout || 20,
|
||||||
networkId: networkId,
|
networkId: networkId,
|
||||||
maxPeers: 4,
|
maxPeers: 4,
|
||||||
port: config.port || "30303",
|
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) {
|
while ((receipt = web3.eth.getTransactionReceipt(transactionHash)) === null || receipt.contractAddress === null) {
|
||||||
sleep(1000);
|
sleep(1000);
|
||||||
time += 1;
|
time += 1;
|
||||||
if (time >= 20) {
|
if (time >= this.blockchainConfig.deployTimeout) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -176,4 +176,3 @@ Deploy.prototype.generate_and_write_abi_file = function(destFile) {
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = Deploy;
|
module.exports = Deploy;
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,7 @@ describe('embark.config.blockchain', function() {
|
||||||
genesis_block: 'config/genesis.json',
|
genesis_block: 'config/genesis.json',
|
||||||
datadir: '/tmp/embark',
|
datadir: '/tmp/embark',
|
||||||
chains: 'chains_development.json',
|
chains: 'chains_development.json',
|
||||||
|
deploy_timeout: 45,
|
||||||
mine_when_needed: true,
|
mine_when_needed: true,
|
||||||
gas_limit: 123,
|
gas_limit: 123,
|
||||||
gas_price: 100,
|
gas_price: 100,
|
||||||
|
@ -69,6 +70,7 @@ describe('embark.config.blockchain', function() {
|
||||||
genesisBlock: 'config/genesis.json',
|
genesisBlock: 'config/genesis.json',
|
||||||
datadir: '/tmp/embark',
|
datadir: '/tmp/embark',
|
||||||
chains: 'chains_development.json',
|
chains: 'chains_development.json',
|
||||||
|
deployTimeout: 45,
|
||||||
networkId: 0,
|
networkId: 0,
|
||||||
maxPeers: 4,
|
maxPeers: 4,
|
||||||
port: "30303",
|
port: "30303",
|
||||||
|
@ -114,6 +116,7 @@ describe('embark.config.blockchain', function() {
|
||||||
genesisBlock: undefined,
|
genesisBlock: undefined,
|
||||||
datadir: '/tmp/embark',
|
datadir: '/tmp/embark',
|
||||||
chains: undefined,
|
chains: undefined,
|
||||||
|
deployTimeout: 20,
|
||||||
networkId: 0,
|
networkId: 0,
|
||||||
maxPeers: 4,
|
maxPeers: 4,
|
||||||
port: "30303",
|
port: "30303",
|
||||||
|
|
Loading…
Reference in New Issue