From 48fe09c1cb2b3bcdb2ff4a4bf958640d5c088b1a Mon Sep 17 00:00:00 2001 From: ditatompel Date: Fri, 31 May 2024 16:28:21 +0700 Subject: [PATCH] Adding table `tbl_fee` This table used to store majority fee of monero nettype. By calculating majority fee via "cron" every 300s, the function to get majority fee for nettypes can be done with single query. The frontend majority static data in the frontend removed and now use `/api/v1/fees` endpoint to get majority fee value. Note: Don't know if it works well with `onload` method or not. Let see. --- frontend/src/routes/remote-nodes/+page.js | 22 +------ frontend/src/routes/remote-nodes/+page.svelte | 32 ++++++---- .../src/routes/remote-nodes/api-handler.js | 12 +++- internal/cron/cron.go | 48 +++++++++++++++ internal/database/schema.go | 60 ++++++++++++++++++- internal/monero/monero.go | 57 +++++++----------- 6 files changed, 159 insertions(+), 72 deletions(-) diff --git a/frontend/src/routes/remote-nodes/+page.js b/frontend/src/routes/remote-nodes/+page.js index 358fccd..f2ff510 100644 --- a/frontend/src/routes/remote-nodes/+page.js +++ b/frontend/src/routes/remote-nodes/+page.js @@ -6,26 +6,6 @@ export async function load() { title: 'Public Monero Remote Nodes List', description: 'List of public Monero remote nodes that you can use with your favourite Monero wallet. You can filter by country, protocol, or CORS capable nodes.', keywords: 'monero remote nodes,public monero nodes,monero public nodes,monero wallet,tor monero node,monero cors rpc' - }, - /** - * Array containing network fees. - * For now, I use static data to reduce the amount of API calls. - * See the values from `/api/v1/fees` - * @type {{ nettype: string, estimate_fee: number }[]} - */ - netFees: [ - { - nettype: 'mainnet', - estimate_fee: 20000 - }, - { - nettype: 'stagenet', - estimate_fee: 56000 - }, - { - nettype: 'testnet', - estimate_fee: 20000 - } - ] + } }; } diff --git a/frontend/src/routes/remote-nodes/+page.svelte b/frontend/src/routes/remote-nodes/+page.svelte index 6aa1db6..1bc3b68 100644 --- a/frontend/src/routes/remote-nodes/+page.svelte +++ b/frontend/src/routes/remote-nodes/+page.svelte @@ -1,7 +1,7 @@