forked from OpenZeppelin/ethernaut-leaderboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.cjs
29 lines (23 loc) · 1.2 KB
/
index.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const refreshEthernautBasedData = require("./refreshEthernautBasedData.cjs");
const crawlForFreshEntriesAndUpdateNetworkBoard = require("../crawlers/crawlNewData/index.cjs");
const writeLeaderBoards = require("./writeLeaderBoards.cjs");
const consoleCustomiser = require("../../utils/consoleCustomiser.cjs");
const { logger } = consoleCustomiser({ delay: 50, randomized: true });
const axios = require('axios');
const trigger = async () => {
/**
* trigger this script to run the entire leaderboard update process. run $ yarn "leaderboard:triggerNextCrawl"
* NB fetchAndAddAliases is not yet functional, contained within scripts/crawlers/crawlNewData/crawlForFreshEntriesAndUpdateNetworkBoard()
*/
await setGameData()
await refreshEthernautBasedData();
await crawlForFreshEntriesAndUpdateNetworkBoard();
await writeLeaderBoards(logger);
// await logger("gather round, all ye faithful! The crawl was a success! See you next cron job, git hubber!")
};
const setGameData = async () => {
const response = await axios.get('https://raw.githubusercontent.com/OpenZeppelin/ethernaut/master/client/src/gamedata/gamedata.json')
const gameData = response.data
globalThis.gameData = gameData
}
trigger();