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", {
|
this.channels[channelName].subscription = this.shh.subscribe("messages", {
|
||||||
minPow: POW_TARGET,
|
|
||||||
symKeyID: this.channels[channelName].channelKey,
|
symKeyID: this.channels[channelName].channelKey,
|
||||||
topics: [this.channels[channelName].channelCode],
|
topics: [this.channels[channelName].channelCode],
|
||||||
allowP2P: true
|
allowP2P: true
|
||||||
|
|
|
@ -15,7 +15,7 @@ class MailServers {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.symKeyID = await this.web3.shh.generateSymKeyFromPassword("status-offline-inbox");
|
this.symKeyID = await this.web3.shh.generateSymKeyFromPassword("status-offline-inbox");
|
||||||
|
|
||||||
this.web3.currentProvider.send({
|
this.web3.currentProvider.send({
|
||||||
method: "admin_addPeer",
|
method: "admin_addPeer",
|
||||||
params: [enode],
|
params: [enode],
|
||||||
|
@ -33,13 +33,12 @@ class MailServers {
|
||||||
}
|
}
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.web3.shh.markTrustedPeer(enode)
|
this.web3.shh.markTrustedPeer(enode)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.mailserver = enode;
|
this.mailserver = enode;
|
||||||
if (!cb) return true;
|
if (!cb) return true;
|
||||||
cb(null, true);
|
cb(null, true);
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.log(e);
|
|
||||||
if (!cb) return;
|
if (!cb) return;
|
||||||
cb(e, false);
|
cb(e, false);
|
||||||
});
|
});
|
||||||
|
@ -55,6 +54,7 @@ class MailServers {
|
||||||
|
|
||||||
const topics = [this.web3.utils.sha3(topic).slice(0, 10)];
|
const topics = [this.web3.utils.sha3(topic).slice(0, 10)];
|
||||||
const mailserverPeer = this.mailserver;
|
const mailserverPeer = this.mailserver;
|
||||||
|
|
||||||
const timeout = options.timeout || 30; // seconds
|
const timeout = options.timeout || 30; // seconds
|
||||||
const symKeyID = this.symKeyID;
|
const symKeyID = this.symKeyID;
|
||||||
const from = options.from || 0; // unix timestamp
|
const from = options.from || 0; // unix timestamp
|
||||||
|
|
|
@ -9,11 +9,13 @@ var status = new StatusJS();
|
||||||
await status.joinChat(channel);
|
await status.joinChat(channel);
|
||||||
|
|
||||||
status.onMessage(channel, (err, data) => {
|
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.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);
|
setInterval(() => { }, 3000);
|
||||||
|
|
Loading…
Reference in New Issue