From ae3f5246eaf91d7fd69b1267b474fdbfaa5d5ea5 Mon Sep 17 00:00:00 2001 From: Chris <34682781+monkins1010@users.noreply.github.com> Date: Thu, 13 Jul 2023 16:13:47 +0100 Subject: [PATCH 1/2] Add load bridgekeeper conf file --- routes/api/native/verusbridge/verusbridge.js | 35 ++++++++++++++++++++ routes/workers/openExternalSafe.js | 1 + 2 files changed, 36 insertions(+) diff --git a/routes/api/native/verusbridge/verusbridge.js b/routes/api/native/verusbridge/verusbridge.js index 53f8fd6e..8afe66b8 100644 --- a/routes/api/native/verusbridge/verusbridge.js +++ b/routes/api/native/verusbridge/verusbridge.js @@ -1,4 +1,5 @@ const server = require("verus_bridgekeeper"); +const confFile = require("verus_bridgekeeper/confFile"); module.exports = (api) => { @@ -67,6 +68,18 @@ module.exports = (api) => { }); }; + api.native.bridgekeeper_getconf = (chainTicker) => { + return new Promise(async (resolve, reject) => { + if (chainTicker !== "VRSCTEST") + reject(new Error("bridgekeeper not currently supported outside of VRSCTEST")); + + const result = confFile.loadConfFile(chainTicker); + + if (result) resolve(result); + else reject(result); + }); + }; + api.setPost("/native/start_bridgekeeper", (req, res, next) => { const { chainTicker } = req.body; @@ -158,5 +171,27 @@ module.exports = (api) => { }); }, true); + api.setPost("/native/bridgekeeper_getconf", (req, res, next) => { + const { chainTicker } = req.body; + api.native + .bridgekeeper_getconf(chainTicker) + .then((reply) => { + const retObj = { + msg: "success", + result: reply, + }; + + res.send(JSON.stringify(retObj)); + }) + .catch((error) => { + const retObj = { + msg: "error", + result: error, + }; + + res.send(JSON.stringify(retObj)); + }); + }, true); + return api; }; diff --git a/routes/workers/openExternalSafe.js b/routes/workers/openExternalSafe.js index 77e63355..1efd33b4 100644 --- a/routes/workers/openExternalSafe.js +++ b/routes/workers/openExternalSafe.js @@ -135,6 +135,7 @@ const allowedOrigins = [ '35.204.174.237:3001/insight/tx/', 'etherscan.io/tx/', 'ropsten.etherscan.io/tx/', + 'www.infura.io' ] function generateOpenExternalSafe(shell, url) { From a2a41d08ace7e7e5d4cb497398ddcefb53eecb0a Mon Sep 17 00:00:00 2001 From: Chris <34682781+monkins1010@users.noreply.github.com> Date: Thu, 13 Jul 2023 16:15:00 +0100 Subject: [PATCH 2/2] Add getconf file --- gui/Verus-Desktop-GUI | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/Verus-Desktop-GUI b/gui/Verus-Desktop-GUI index ea643a7d..957a2977 160000 --- a/gui/Verus-Desktop-GUI +++ b/gui/Verus-Desktop-GUI @@ -1 +1 @@ -Subproject commit ea643a7de1da4c40ab0cbf0776f8e0fa8c1730a1 +Subproject commit 957a297750cc9a9a940e9d1e653d3aad62d146fd