Removing minPow to be able to receive messages from mailserver
This commit is contained in:
parent
173dafe1e7
commit
c1161730d9
|
@ -123,7 +123,6 @@ class StatusJS {
|
|||
}
|
||||
|
||||
this.channels[channelName].subscription = this.shh.subscribe("messages", {
|
||||
minPow: POW_TARGET,
|
||||
symKeyID: this.channels[channelName].channelKey,
|
||||
topics: [this.channels[channelName].channelCode],
|
||||
allowP2P: true
|
||||
|
|
|
@ -15,7 +15,7 @@ class MailServers {
|
|||
}
|
||||
|
||||
this.symKeyID = await this.web3.shh.generateSymKeyFromPassword("status-offline-inbox");
|
||||
|
||||
|
||||
this.web3.currentProvider.send({
|
||||
method: "admin_addPeer",
|
||||
params: [enode],
|
||||
|
@ -33,13 +33,12 @@ class MailServers {
|
|||
}
|
||||
|
||||
setTimeout(() => {
|
||||
this.web3.shh.markTrustedPeer(enode)
|
||||
this.web3.shh.markTrustedPeer(enode)
|
||||
.then(res => {
|
||||
this.mailserver = enode;
|
||||
if (!cb) return true;
|
||||
cb(null, true);
|
||||
}).catch((e) => {
|
||||
console.log(e);
|
||||
if (!cb) return;
|
||||
cb(e, false);
|
||||
});
|
||||
|
@ -55,6 +54,7 @@ class MailServers {
|
|||
|
||||
const topics = [this.web3.utils.sha3(topic).slice(0, 10)];
|
||||
const mailserverPeer = this.mailserver;
|
||||
|
||||
const timeout = options.timeout || 30; // seconds
|
||||
const symKeyID = this.symKeyID;
|
||||
const from = options.from || 0; // unix timestamp
|
||||
|
|
|
@ -9,11 +9,13 @@ var status = new StatusJS();
|
|||
await status.joinChat(channel);
|
||||
|
||||
status.onMessage(channel, (err, data) => {
|
||||
console.dir(data.payload);
|
||||
console.log(data.payload);
|
||||
});
|
||||
|
||||
status.mailservers.useMailserver("mail-02.gc-us-central1-a.eth.beta", (err, res) => {
|
||||
status.mailservers.requestMessages(channel, {}, (err, res) => { if(err) console.log(err); });
|
||||
status.mailservers.requestMessages(channel, {}, (err, res) => {
|
||||
if(err) console.log(err);
|
||||
});
|
||||
});
|
||||
|
||||
setInterval(() => { }, 3000);
|
||||
|
|
Loading…
Reference in New Issue