add connectToProvider method

This commit is contained in:
Iuri Matias 2018-11-26 23:05:35 -05:00
parent 198ba4d21d
commit b8d7b8404b
1 changed files with 16 additions and 2 deletions

View File

@ -51,10 +51,24 @@ class StatusJS {
const net = require('net');
web3.setProvider(new Web3.providers.IpcProvider(url, net));
}
this.shh = web3.shh;
this.mailservers = new mailservers(web3);
await web3.shh.setMinPoW(POW_TARGET);
_sig.set(
this,
privateKey ? await this.generateWhisperKeyFromWallet(privateKey) : await web3.shh.newKeyPair()
);
}
async connectToProvider(provider, privateKey) {
let web3 = new Web3();
web3.setProvider(provider);
this.shh = web3.shh;
this.mailservers = new mailservers(web3);
await web3.shh.setMinPoW(POW_TARGET);
_sig.set(
this,