-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
30 lines (22 loc) · 975 Bytes
/
index.js
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
import "dotenv/config";
import { initialiseOrgAgent } from "./aries/initialiseOrgAgent.js";
import { createNewInvitation } from "./aries/createNewInvitation.js";
import { setupConnectionListener } from "./aries/setupConnectionListener.js";
import { registerTestCredential } from "./aries/registerTestCredential.js";
const onConnection = () =>
console.log(
"We now have an active connection to use in the following tutorials"
);
const startServer = async () => {
console.log("Init Aries agent");
const agent = await initialiseOrgAgent();
console.log("Registering credential definition");
await registerTestCredential(agent);
console.log("Creating invite for new credential");
const { outOfBandRecord, invitationUrl } = await createNewInvitation(agent);
console.log(invitationUrl);
console.log("Listening for connection changes...");
setupConnectionListener(agent, outOfBandRecord, onConnection);
};
export default startServer;
startServer();