-
Notifications
You must be signed in to change notification settings - Fork 21
/
setup.js
103 lines (92 loc) · 2.5 KB
/
setup.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
const express = require("express");
const router = express.Router();
// setupPhase is "done" if setup is finished, otherwise step in the setup process
router.get("/status", function (req, res) {
console.info(`call to ${req.originalUrl}`);
res.status(200).send(
JSON.stringify({
setupPhase: "done",
state: "waitfinal",
message: "Node Running",
initialsync: "",
}),
);
// basic setup
// res.status(200).send(
// JSON.stringify({
// setupPhase: "",
// state: "waitsetup",
// message: "Node Running",
// initialsync: "",
// }),
// );
// Setupscreen
// res.status(200).send(
// JSON.stringify({
// setupPhase: "",
// state: "waitfinal",
// message: "Node Running",
// initialsync: "",
// })
// );
// Syncscreen
// res.status(200).send(
// JSON.stringify({
// setupPhase: "",
// state: "ready",
// message: "Node Running",
// initialsync: "running",
// })
// );
});
router.get("/setup-start-info", function (req, res) {
console.info(`call to ${req.originalUrl}`);
res.status(200).send(
JSON.stringify({
// send something else than "done" to route to setup
setupPhase: "recovery",
hddGotBlockchain: "0",
hddGotMigrationData: null,
migrationMode: null,
}),
);
});
router.post("/setup-start-done", function (req, res) {
console.info(`call to ${req.originalUrl}`);
res.send("STATUS");
});
router.get("/setup-final-info", function (req, res) {
console.info(`call to ${req.originalUrl}`);
res.send(
JSON.stringify({
seedwordsNEW:
"Never, gonna, give, you, up, Never, gonna, let, you, down, Never, gonna, run, around, and, desert, you, Never, gonna, make, you, cry, happy, day",
}),
);
});
router.get("/setup-final-done", function (req, res) {
console.info(`call to ${req.originalUrl}`);
res.send("STATUS");
});
router.get("/shutdown", function (req, res) {
console.info(`call to ${req.originalUrl}`);
res.send("STATUS");
});
router.post("/setup-sync-info", function (req, res) {
console.info(`call to ${req.originalUrl}`);
res.status(200).send(
JSON.stringify({
initialsync: "",
btc_default: "1",
btc_default_ready: "1",
btc_default_sync_percentage: "20",
btc_default_peers: "3",
system_count_start_blockchain: "1",
ln_default: "1",
ln_default_ready: "1",
ln_default_locked: "1",
system_count_start_lightning: "3",
}),
);
});
module.exports = router;