-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.mjs
44 lines (41 loc) · 977 Bytes
/
run.mjs
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
import { DaemonConfig } from "@ceramicnetwork/cli";
import { writeFile } from "fs";
const generateConfig = (adminDid, dbUrl) => {
return DaemonConfig.fromObject({
anchor: {},
"http-api": {
"cors-allowed-origins": [".*"],
"admin-dids": [adminDid],
},
ipfs: {
mode: "bundled",
},
logger: {
"log-level": 2,
"log-to-files": false,
},
metrics: {
"metrics-exporter-enabled": false,
"metrics-port": 9090,
},
network: {
name: "inmemory",
},
node: {},
"state-store": {
mode: "fs",
"local-directory": `${process.cwd()}/.ceramic/.ceramic/statestore/`,
},
indexing: {
db: dbUrl,
"allow-queries-before-historical-sync": true,
models: [],
},
});
};
const config = generateConfig(process.env.ADMIN_DID, process.env.AWS_RDS_URL);
writeFile("./daemon.config.json", JSON.stringify(config), (err) => {
if (err) {
console.error(err);
}
});