mirror of https://github.com/embarklabs/embark.git
use deployment config from contracts.json instead of blockchain.json
This commit is contained in:
parent
408090a643
commit
f882b3486b
|
@ -75,7 +75,13 @@ Config.prototype.loadBlockchainConfigFile = function() {
|
|||
|
||||
Config.prototype.loadContractsConfigFile = function() {
|
||||
|
||||
var configObject = {};
|
||||
var configObject = {
|
||||
"deployment": {
|
||||
"host": "localhost",
|
||||
"port": 8545,
|
||||
"type": "rpc"
|
||||
}
|
||||
};
|
||||
|
||||
var configPlugins = this.plugins.getPluginsFor('contractsConfig');
|
||||
if (configPlugins.length > 0) {
|
||||
|
|
|
@ -220,8 +220,12 @@ class Engine {
|
|||
this.web3 = options.web3;
|
||||
if (this.web3 === undefined) {
|
||||
this.web3 = new Web3();
|
||||
let web3Endpoint = 'http://' + this.config.blockchainConfig.rpcHost + ':' + this.config.blockchainConfig.rpcPort;
|
||||
this.web3.setProvider(new this.web3.providers.HttpProvider(web3Endpoint));
|
||||
if (this.config.contractsConfig.deployment.type === "rpc") {
|
||||
let web3Endpoint = 'http://' + this.config.contractsConfig.deployment.host + ':' + this.config.contractsConfig.deployment.port;
|
||||
this.web3.setProvider(new this.web3.providers.HttpProvider(web3Endpoint));
|
||||
} else {
|
||||
throw new Error("contracts config error: unknown deployment type " + this.config.contractsConfig.deployment.type);
|
||||
}
|
||||
}
|
||||
|
||||
self.servicesMonitor.addCheck('Ethereum', function (cb) {
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
},
|
||||
"deployment": {
|
||||
"host": "localhost",
|
||||
"port": 8545
|
||||
"port": 8545,
|
||||
"type": "rpc"
|
||||
},
|
||||
"dappConnection": [
|
||||
"$WEB3",
|
||||
|
|
Loading…
Reference in New Issue