Use maxmind to store node locations

This commit is contained in:
softsimon committed 2022-07-11 17:52:38 +02:00
1 parent 9fce787105
commit 519494668b
9 files changed
+171 -3

No files matched your search

+11
View File
@@ -13,6 +13,17 @@ class NodesApi {
}
}
public async $getAllNodes(): Promise<any> {
try {
const query = `SELECT * FROM nodes`;
const [rows]: any = await DB.query(query);
return rows;
} catch (e) {
logger.err('$getAllNodes error: ' + (e instanceof Error ? e.message : e));
throw e;
}
}
public async $getNodeStats(public_key: string): Promise<any> {
try {
const query = `SELECT UNIX_TIMESTAMP(added) AS added, capacity, channels FROM node_stats WHERE public_key = ? ORDER BY added DESC`;