Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions container-manager/src/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ app.get("/gen", (req, res) => {
res.render("generator/index.pug", {});
});

app.get("/gen_xdpos", (req, res) => {
res.render("xdpos_generator/index.pug", {});
});

app.post("/submit", (req, res) => {
console.log("/submit called");
const [valid, genOut] = exec.generate(req.body);
Expand All @@ -136,6 +140,23 @@ app.post("/submit", (req, res) => {
}
});

app.post("/submit_xdpos", (req, res) => {
console.log("/submit_xdpos called");
const [valid, genOut] = exec.generateXdpos(req.body);
if (!valid) {
res.render("xdpos_generator/submit.pug", {
message: "failed, please try again",
error: genOut,
});
} else {
res.render("xdpos_generator/submit.pug", {
message:
"Config generation success, please continue with 'cd generated;' then './docker-up.sh machine1;'",
});
process.exit(0);
}
});

app.post("/submit_preconfig", (req, res) => {
console.log("/submit called");
const [valid, genOut] = exec.generate(req.body);
Expand Down
7 changes: 7 additions & 0 deletions container-manager/src/gen/config_gen.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ const config = {
generator: {
output_path: `${__dirname}/../../mount/generated/`,
},
xdpos: {
xdposnode: process.env.VERSION_NODE_IMAGE || "xinfinorg/xdposchain:v2.6.4-beta",
stake_threshold: parseInt(process.env.MASTERNODE_MINIMUM_STAKE) || "",
reward_yield: parseInt(process.env.REWARDS_YIELD) || "",
foundation_addr: "",
foundation_pk: process.env.FOUNDATION_PK || ""
}
};

// if (configSanityCheck(config) === true) {
Expand Down
Loading