-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
35 lines (22 loc) · 801 Bytes
/
Copy pathindex.js
File metadata and controls
35 lines (22 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { Models } from './src/Models/Models.js';
import { Nostr } from './src/nostr/Nostr.js';
import { Agent } from './src/Agent/Agent.js';
import event from 'events';
async function main() {
// step 1 init nostr
const nostrObj = new Nostr();
nostrObj.showKeys();
// step 2 init models
const modelsObj = new Models();
await modelsObj.initModel();
// step 3 init and test agent
const agentObj = new Agent();
let agentTest = await agentObj.testAgent();
// step 4 if test is successful subscribe to nostr relays and listen for incoming messages
nostrObj.subscribeToDmEvents();
const customEvent = new event();
customEvent.on("nostrDmRecevied", (data) => {
console.log("event recevied from nostr " + data);
});
}
main();