-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.mjs
38 lines (36 loc) · 870 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
import { DaemonConfig, CeramicDaemon } from "@ceramicnetwork/cli";
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.DB_URL);
CeramicDaemon.create(config);