From 72af532a853dff59be7e243a783e6621e82f923d Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 2 Oct 2024 16:41:39 +0700 Subject: [PATCH 1/3] new rpc cert --- www/rpc-server/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/www/rpc-server/index.js b/www/rpc-server/index.js index 0117d492f..3d24bac1a 100644 --- a/www/rpc-server/index.js +++ b/www/rpc-server/index.js @@ -126,14 +126,14 @@ setInterval(reset_pending, load_balance_tick); console.log("Listening on port 80 ..."); } -const cert_path = '/etc/letsencrypt/live/rpc.mmx.network/'; +const cert_path = '/root/.acme.sh/rpc.mmx.network_ecc/'; if(fs.existsSync(cert_path)) { var options = { - key: fs.readFileSync(cert_path + 'privkey.pem'), - cert: fs.readFileSync(cert_path + 'fullchain.pem'), - ca: fs.readFileSync(cert_path + 'chain.pem') + key: fs.readFileSync(cert_path + 'rpc.mmx.network.key'), + cert: fs.readFileSync(cert_path + 'fullchain.cer'), + ca: fs.readFileSync(cert_path + 'ca.cer') }; https.createServer(options, app).listen(443); From 25947a6c4d0e34581b1d977486bf1a3fe4454316 Mon Sep 17 00:00:00 2001 From: Max Wittal Date: Wed, 2 Oct 2024 17:01:26 +0700 Subject: [PATCH 2/3] added /wapi/chain/info --- src/WebAPI.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/WebAPI.cpp b/src/WebAPI.cpp index 5a8d4adaf..5aaadc50c 100644 --- a/src/WebAPI.cpp +++ b/src/WebAPI.cpp @@ -1178,6 +1178,9 @@ void WebAPI::http_request_async(std::shared_ptr ((WebAPI*)this)->shutdown(); respond_status(request_id, 200); } + else if(sub_path == "/chain/info") { + respond(request_id, render(params)); + } else if(sub_path == "/node/info") { node->get_network_info( [this, request_id](std::shared_ptr info) { @@ -2731,7 +2734,7 @@ void WebAPI::http_request_async(std::shared_ptr } else { std::vector options = { - "config/get", "config/set", "farmer", "farmers", + "config/get", "config/set", "farmer", "farmers", "chain/info", "node/info", "node/log", "header", "headers", "block", "blocks", "transaction", "transactions", "address", "contract", "address/history", "wallet/balance", "wallet/contracts", "wallet/address" "wallet/history", "wallet/history/memo", "wallet/send", "wallet/send_many", "wallet/send_off", From 97f2ffd39e3ca6a201c9d8827951cf0d65646bd2 Mon Sep 17 00:00:00 2001 From: Max Wittal Date: Sun, 13 Oct 2024 12:12:45 +0700 Subject: [PATCH 3/3] wapi decimals --- src/WebAPI.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/WebAPI.cpp b/src/WebAPI.cpp index 5aaadc50c..c373c5e0a 100644 --- a/src/WebAPI.cpp +++ b/src/WebAPI.cpp @@ -360,6 +360,7 @@ class Render { } else { out["symbol"] = info->symbol; out["value"] = to_value_128(amount, info->decimals); + out["decimals"] = info->decimals; } } out["is_native"] = contract == addr_t();