status-js-api/test-mailserver.js

23 lines
536 B
JavaScript
Raw Normal View History

var StatusJS = require('./src/index.js');
(async () => {
var status = new StatusJS();
2018-11-16 20:28:19 +00:00
await status.connect("/home/richard/.statusd/geth.ipc");
2018-11-16 20:28:19 +00:00
const channel = "mytest";
2018-11-14 17:51:12 +00:00
2018-11-16 20:28:19 +00:00
await status.joinChat(channel);
2018-11-14 17:51:12 +00:00
2018-11-16 20:28:19 +00:00
status.onMessage(channel, (err, data) => {
console.log(data.payload);
2018-11-16 20:28:19 +00:00
});
2018-11-14 17:51:12 +00:00
2018-11-16 20:28:19 +00:00
status.mailservers.useMailserver("mail-02.gc-us-central1-a.eth.beta", (err, res) => {
status.mailservers.requestMessages(channel, {}, (err, res) => {
if(err) console.log(err);
});
});
2018-11-16 20:28:19 +00:00
setInterval(() => { }, 3000);
})()