-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.js
33 lines (29 loc) · 1.36 KB
/
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
31
32
33
'use strict';
exports.wallet = require('./src/wallet');
exports.connections = require('./src/connections');
exports.credentials = require('./src/credentials');
exports.crypto = require('./src/crypto');
exports.did = require('./src/did');
exports.handler = require('./src/handler');
exports.issuer = require('./src/issuer');
exports.messages = require('./src/messages');
exports.pairwise = require('./src/pairwise');
exports.pool = require('./src/pool');
exports.proofs = require('./src/proofs');
exports.utils = require('./src/utils');
let store = require('./src/store');
let config = require('./config');
exports.setupAgent = async function(externalConfig, externalStore, genesisPoolTransactions) {
// Rewrite config values if external configuration is given
if (externalConfig) config = Object.assign({}, config, externalConfig);
store = store.setUp(externalStore);
console.log(store);
await exports.pool.setup(config, genesisPoolTransactions);
await exports.wallet.setup(config);
// TODO: FIXME: Depending on the environment maybe we can not self-onboard trust-anchor impersonating steward
let endpointDid = await exports.did.getEndpointDid(config); // Creates it if it doesn't exist
await exports.pool.setEndpointForDid(endpointDid, config.endpointDidEndpoint);
return Promise.resolve();
};
exports.models = store.models;
exports.store = store;