diff --git a/bin/libbfa.js b/bin/libbfa.js index 6cdd2e99ee9e3af22086bd9b680924e0c1c65454..02a7aeb56f770c138ceab8dfde97cf17d4378235 100644 --- a/bin/libbfa.js +++ b/bin/libbfa.js @@ -9,6 +9,7 @@ module.exports = class Libbfa constructor() { this.fs = require('fs'); this.Web3 = require('web3'); + var net = require('net'); // // BFAHOME if ( undefined == process.env.BFAHOME ) @@ -47,6 +48,8 @@ module.exports = class Libbfa // this.netport = Number.parseInt( this.setfromfile( this.nodedir+'/netport', 30303 )); this.rpcport = Number.parseInt( this.setfromfile( this.nodedir+'/rpcport', 8545 )); + //this.provider = 'http://127.0.0.1:' + this.rpcport; // old + this.provider = new this.Web3.providers.IpcProvider(this.nodedir+'/geth.ipc', net) this.account = process.env.BFAACCOUNT; } @@ -78,8 +81,7 @@ module.exports = class Libbfa newweb3() { - var provider = 'http://127.0.0.1:' + this.rpcport; - var w3 = new this.Web3( provider ); + var w3 = new this.Web3( this.provider ); w3.rpcreq = function( opname, params, callback ) { var extra = params.join(','); diff --git a/bin/libbfa.sh b/bin/libbfa.sh index c451c55b793c19605158164fc4204805baecba25..6ee139d8aea2debb94e883848140e41cd1b7198f 100644 --- a/bin/libbfa.sh +++ b/bin/libbfa.sh @@ -194,7 +194,7 @@ test -n "$BFANODEDIR" || BFANODEDIR="${BFANETWORKDIR}/node" if [ ! -d "${BFANODEDIR}" -o ! -d "${BFANODEDIR}/geth/chaindata" ] then echo "Node is not initialised. Initialising with genesis." - geth --cache 0 --datadir "${BFANODEDIR}" init "${BFANETWORKDIR}/genesis.json" + geth --cache 0 --datadir "${BFANODEDIR}" --networkid ${BFANETWORKID} init "${BFANETWORKDIR}/genesis.json" fi # # netport diff --git a/network/config.toml b/network/config.toml index a414c48626596514c5fe46215a1753fda1fc7ecd..3c85b8b76d7e21a10f27b320aadfd3a00914b4d1 100644 --- a/network/config.toml +++ b/network/config.toml @@ -60,10 +60,10 @@ omitempty = "" IPCPath = "geth.ipc" HTTPPort = 8545 HTTPVirtualHosts = ["localhost"] -HTTPModules = ["net", "web3", "eth", "shh", "clique", "admin", "miner", "personal"] +HTTPModules = ["net", "web3", "eth", "clique"] WSHost = "127.0.0.1" WSPort = 8546 -WSModules = ["net", "web3", "eth", "shh", "clique", "admin", "miner", "personal"] +WSModules = ["net", "web3", "eth", "clique"] GraphQLPort = 8547 GraphQLVirtualHosts = ["localhost"] diff --git a/test2network/config.toml b/test2network/config.toml index e94490c8fec451628446f3767b82b9e161f0e3c7..31d7a6154a179a7eefb7cdfc4abd56ed8a3d4771 100644 --- a/test2network/config.toml +++ b/test2network/config.toml @@ -60,10 +60,10 @@ omitempty = "" IPCPath = "geth.ipc" HTTPPort = 8545 HTTPVirtualHosts = ["localhost"] -HTTPModules = ["net", "web3", "eth", "shh", "clique", "admin", "miner", "personal"] +HTTPModules = ["net", "web3", "eth", "clique"] WSHost = "127.0.0.1" WSPort = 8546 -WSModules = ["net", "web3", "eth", "shh", "clique", "admin", "miner", "personal"] +WSModules = ["net", "web3", "eth", "clique"] GraphQLPort = 8547 GraphQLVirtualHosts = ["localhost"]