diff --git a/backend/src/api/explorer/nodes.api.ts b/backend/src/api/explorer/nodes.api.ts index 3bfa4d50e..c3b3f8124 100644 --- a/backend/src/api/explorer/nodes.api.ts +++ b/backend/src/api/explorer/nodes.api.ts @@ -96,10 +96,12 @@ class NodesApi { public async $getNodesAsShare() { try { - let query = `SELECT names, COUNT(*) as nodesCount from nodes + let query = `SELECT names, COUNT(DISTINCT nodes.public_key) as nodesCount, SUM(capacity) as capacity + FROM nodes JOIN geo_names ON geo_names.id = nodes.as_number + JOIN channels ON channels.node1_public_key = nodes.public_key OR channels.node2_public_key = nodes.public_key GROUP BY as_number - ORDER BY COUNT(*) DESC + ORDER BY COUNT(DISTINCT nodes.public_key) DESC `; const [nodesCountPerAS]: any = await DB.query(query); @@ -112,6 +114,7 @@ class NodesApi { name: JSON.parse(as.names), count: as.nodesCount, share: Math.floor(as.nodesCount / nodesWithAS[0].total * 10000) / 100, + capacity: as.capacity, }) } diff --git a/frontend/src/app/lightning/nodes-per-as-chart/nodes-per-as-chart.component.html b/frontend/src/app/lightning/nodes-per-as-chart/nodes-per-as-chart.component.html index 16ba4fea6..3ea6f1e29 100644 --- a/frontend/src/app/lightning/nodes-per-as-chart/nodes-per-as-chart.component.html +++ b/frontend/src/app/lightning/nodes-per-as-chart/nodes-per-as-chart.component.html @@ -21,18 +21,20 @@
Rank | -Name | -Hashrate | -Nodes | +Rank | +Name | +Share | +Nodes | +Capacity |
---|---|---|---|---|---|---|---|---|
{{ asEntry.rank }} | +{{ asEntry.rank }} | {{ asEntry.name }} | -{{ asEntry.share }}% | -{{ asEntry.count }} | +{{ asEntry.share }}% | +{{ asEntry.count }} | +