mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-01-11 06:25:57 +00:00
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() {
|
Config.prototype.loadContractsConfigFile = function() {
|
||||||
|
|
||||||
var configObject = {};
|
var configObject = {
|
||||||
|
"deployment": {
|
||||||
|
"host": "localhost",
|
||||||
|
"port": 8545,
|
||||||
|
"type": "rpc"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
var configPlugins = this.plugins.getPluginsFor('contractsConfig');
|
var configPlugins = this.plugins.getPluginsFor('contractsConfig');
|
||||||
if (configPlugins.length > 0) {
|
if (configPlugins.length > 0) {
|
||||||
|
@ -220,8 +220,12 @@ class Engine {
|
|||||||
this.web3 = options.web3;
|
this.web3 = options.web3;
|
||||||
if (this.web3 === undefined) {
|
if (this.web3 === undefined) {
|
||||||
this.web3 = new Web3();
|
this.web3 = new Web3();
|
||||||
let web3Endpoint = 'http://' + this.config.blockchainConfig.rpcHost + ':' + this.config.blockchainConfig.rpcPort;
|
if (this.config.contractsConfig.deployment.type === "rpc") {
|
||||||
this.web3.setProvider(new this.web3.providers.HttpProvider(web3Endpoint));
|
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) {
|
self.servicesMonitor.addCheck('Ethereum', function (cb) {
|
||||||
|
@ -6,7 +6,8 @@
|
|||||||
},
|
},
|
||||||
"deployment": {
|
"deployment": {
|
||||||
"host": "localhost",
|
"host": "localhost",
|
||||||
"port": 8545
|
"port": 8545,
|
||||||
|
"type": "rpc"
|
||||||
},
|
},
|
||||||
"dappConnection": [
|
"dappConnection": [
|
||||||
"$WEB3",
|
"$WEB3",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user