-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
37 lines (28 loc) · 846 Bytes
/
server.js
File metadata and controls
37 lines (28 loc) · 846 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
36
37
var q = require("bluebird");
/** 初始化全局配置 */
var config = require("./lib/config.js");
/** 网络接口 */
var endpoint = require("./lib/endpoint.js");
/** UNL结点集群管理 */
var unls = require("./lib/unls.js");
/** 密钥证书及签名验签工具类 */
var pki = require("./lib/pki.js");
/** 区块链数据库 */
var block = require("./lib/block.js");
/** 信息数据库 */
var data = require("./lib/data.js");
/** 同步协商协议 */
var rpca = require("./lib/rpca.js");
q.resolve(null)
.then(config.init)
.then(block.init)
.then(endpoint.init)
.then(unls.init)
.then(data.init)
.then(rpca.init)
.done(function() {
process.on('uncaughtException', function(err) {
console.error(`${err}\n${err.stack}`);
});
console.log("ready.");
});