File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,13 @@ Config.prototype.loadBlockchainConfigFile = function() {
7575
7676Config . prototype . loadContractsConfigFile = function ( ) {
7777
78- var configObject = { } ;
78+ var configObject = {
79+ "deployment" : {
80+ "host" : "localhost" ,
81+ "port" : 8545 ,
82+ "type" : "rpc"
83+ }
84+ } ;
7985
8086 var configPlugins = this . plugins . getPluginsFor ( 'contractsConfig' ) ;
8187 if ( configPlugins . length > 0 ) {
Original file line number Diff line number Diff line change @@ -220,8 +220,12 @@ class Engine {
220220 this . web3 = options . web3 ;
221221 if ( this . web3 === undefined ) {
222222 this . web3 = new Web3 ( ) ;
223- let web3Endpoint = 'http://' + this . config . blockchainConfig . rpcHost + ':' + this . config . blockchainConfig . rpcPort ;
224- this . web3 . setProvider ( new this . web3 . providers . HttpProvider ( web3Endpoint ) ) ;
223+ if ( this . config . contractsConfig . deployment . type === "rpc" ) {
224+ let web3Endpoint = 'http://' + this . config . contractsConfig . deployment . host + ':' + this . config . contractsConfig . deployment . port ;
225+ this . web3 . setProvider ( new this . web3 . providers . HttpProvider ( web3Endpoint ) ) ;
226+ } else {
227+ throw new Error ( "contracts config error: unknown deployment type " + this . config . contractsConfig . deployment . type ) ;
228+ }
225229 }
226230
227231 self . servicesMonitor . addCheck ( 'Ethereum' , function ( cb ) {
Original file line number Diff line number Diff line change 66 },
77 "deployment" : {
88 "host" : " localhost" ,
9- "port" : 8545
9+ "port" : 8545 ,
10+ "type" : " rpc"
1011 },
1112 "dappConnection" : [
1213 " $WEB3" ,
You can’t perform that action at this time.
0 commit comments