Skip to content
Snippets Groups Projects
Commit 163d506c authored by Robert Martin-Legene's avatar Robert Martin-Legene
Browse files

Primeros cambios para cambiar para utilizar ipc en lugar de RPC

parent 372a352e
No related branches found
No related tags found
No related merge requests found
......@@ -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(',');
......
......@@ -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
......
......@@ -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"]
......
......@@ -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"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment