Skip to content

Commit

Permalink
Add manual MNN known accounts instead of fetch (service is now down)
Browse files Browse the repository at this point in the history
  • Loading branch information
tombertrand committed Aug 24, 2023
1 parent bbe2590 commit 33baf54
Show file tree
Hide file tree
Showing 2 changed files with 2,259 additions and 3 deletions.
5 changes: 2 additions & 3 deletions server/cron/knownAccounts.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const fetch = require("node-fetch");
const cron = require("node-cron");
const uniqBy = require("lodash/uniqBy");
const BigNumber = require("bignumber.js");
Expand All @@ -9,13 +8,13 @@ const { nodeCache } = require("../client/cache");
const { Sentry } = require("../sentry");
const { KNOWN_ACCOUNTS, KNOWN_ACCOUNTS_BALANCE, EXPIRE_48H } = require("../constants");
const extraKnownAccounts = require("./knownAccounts.json");
const knownAccountsMNN = require("./knownAccounts_mnn.json");
const faucetAccounts = require("../../src/pages/Faucets/faucets.json");

const doKnownAccountsCron = async () => {
let knownAccounts = [];
try {
const res = await fetch("https://mynano.ninja/api/accounts/aliases");
knownAccounts = (await res.json()) || [];
knownAccounts = knownAccountsMNN;

// Merge knownAccounts.json list
knownAccounts = uniqBy(knownAccounts.concat(extraKnownAccounts), "account");
Expand Down
Loading

0 comments on commit 33baf54

Please sign in to comment.