-
Notifications
You must be signed in to change notification settings - Fork 2
/
seed.js
49 lines (35 loc) · 1.03 KB
/
seed.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
var fibos = require('fibos');
var fs = require("fs");
var config = require('./config');
console.notice("start FIBOS seed node");
fibos.config_dir = config.config_dir;
fibos.data_dir = config.data_dir;
console.notice("config_dir:", fibos.config_dir);
console.notice("data_dir:", fibos.data_dir);
fibos.load("http", {
"http-server-address": "0.0.0.0:8870",
"access-control-allow-origin": "*",
"http-validate-host": false,
"verbose-http-errors": true //打开报错
});
fibos.load("net", {
"p2p-peer-address": config.p2p_peer_address,
"max-clients": 100,
"p2p-listen-endpoint": "0.0.0.0:9870",
"p2p-max-nodes-per-host": 20
});
var chain_config = {
"contracts-console": true,
'chain-state-db-size-mb': 8 * 1024,
// "delete-all-blocks": true
};
if (!fs.exists(fibos.data_dir) && !fs.exists(fibos.config_dir)) {
chain_config['genesis-json'] = "genesis.json";
}
fibos.load("producer", {
// 'enable-stale-production': true,
'max-transaction-time': 3000
});
fibos.load("chain", chain_config);
fibos.load("chain_api");
fibos.start();