Commit f13ad272 authored by inso's avatar inso
Browse files

New url to get preview of pubkey

parent c6c6740d
......@@ -69,6 +69,14 @@ function WebAdmin (dbConf, overConf) {
};
});
this.previewPubkey = (req) => co(function *() {
let conf = http2raw.conf(req);
let pair = yield Q.nbind(crypto.getKeyPair, crypto)(conf.idty_entropy, conf.idty_password);
return {
"pubkey": base58.encode(pair.publicKey)
};
});
this.startHTTP = () => co(function *() {
yield pluggedDALP;
return bmapi.openConnections();
......
......@@ -410,3 +410,7 @@ dtos.AdminSummary = {
"current": dtos.Block,
"pubkey": String
};
dtos.PreviewPubkey = {
"pubkey": String
};
......@@ -16,6 +16,7 @@ module.exports = function(dbConf, overConf, interfaces, httpLogs) {
return network.createServersAndListen('uCoin web admin', interfaces, httpLogs, fullPath, (app, httpMethods) => {
httpMethods.httpGET( '/webmin/summary', webminCtrl.summary, dtos.AdminSummary);
httpMethods.httpPOST( '/webmin/key/preview', webminCtrl.previewPubkey, dtos.PreviewPubkey);
httpMethods.httpGET( '/webmin/server/http/start', webminCtrl.startHTTP, dtos.Boolean);
httpMethods.httpGET( '/webmin/server/http/stop', webminCtrl.stopHTTP, dtos.Boolean);
httpMethods.httpGET( '/webmin/server/preview_next', webminCtrl.previewNext, dtos.Block);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment