From fa3a26cbfa23c6b680bae4cec2394794759519ea Mon Sep 17 00:00:00 2001 From: jvaleskadevs Date: Sun, 9 Feb 2025 16:24:39 +0100 Subject: [PATCH 1/2] Unpause Cron tasks, fix clanker rewards address --- apps/weeklyhackathon-core/src/cron/index.ts | 6 +++--- packages/agents/src/lib/tools/claimClankerRewardsTool.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/weeklyhackathon-core/src/cron/index.ts b/apps/weeklyhackathon-core/src/cron/index.ts index d6d5f5e..243d501 100644 --- a/apps/weeklyhackathon-core/src/cron/index.ts +++ b/apps/weeklyhackathon-core/src/cron/index.ts @@ -8,11 +8,11 @@ import { refreshMissingPRAnalyses } from './refreshMissingPRAnalyses'; export function startCronJobs() { log.info('Starting cron jobs'); // Evaluate submissions every day at 00:00 UTC - //cron.schedule('0 0 * * *', evaluateSubmissions); + cron.schedule('0 0 * * *', evaluateSubmissions); // Distribute Prizes every Friday at 00:00 UTC - //cron.schedule('0 0 * * 5', distributePrizes); + cron.schedule('0 0 * * 5', distributePrizes); // Analyse PRs every hour - //cron.schedule('0 * * * *', refreshMissingPRAnalyses); + cron.schedule('0 * * * *', refreshMissingPRAnalyses); } /* export async function startDemo() { diff --git a/packages/agents/src/lib/tools/claimClankerRewardsTool.ts b/packages/agents/src/lib/tools/claimClankerRewardsTool.ts index 92fe4dc..83390b3 100644 --- a/packages/agents/src/lib/tools/claimClankerRewardsTool.ts +++ b/packages/agents/src/lib/tools/claimClankerRewardsTool.ts @@ -15,7 +15,7 @@ const CLAIM_REWARDS_PROMPT = 'Call the "claimRewards" function to claim the trad const ClaimRewardsInput = z.object({}); type ClaimRewardsSchema = z.infer; -const clankerRewardsAddress = process.env.NETWORK_ID === 'base-mainnet' ? '0x901776E42A8286525849c67825c758ddbB1d94F7' : '0x732560fa1d1A76350b1A500155BA978031B53833'; +const clankerRewardsAddress = process.env.NETWORK_ID === 'base-mainnet' ? '0x732560fa1d1A76350b1A500155BA978031B53833' : '0x901776E42A8286525849c67825c758ddbB1d94F7'; const claimRewardsAbi: Abi = [ { 'inputs': [{ From 73318f3bcc17a6a8d65e84b69c1f4b87e10685b2 Mon Sep 17 00:00:00 2001 From: jvaleskadevs Date: Sun, 9 Feb 2025 16:38:01 +0100 Subject: [PATCH 2/2] Setup Evaluate Submissions Demo --- apps/weeklyhackathon-core/src/cron/index.ts | 6 +++--- apps/weeklyhackathon-core/src/main.ts | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/weeklyhackathon-core/src/cron/index.ts b/apps/weeklyhackathon-core/src/cron/index.ts index 243d501..c21839b 100644 --- a/apps/weeklyhackathon-core/src/cron/index.ts +++ b/apps/weeklyhackathon-core/src/cron/index.ts @@ -14,9 +14,9 @@ export function startCronJobs() { // Analyse PRs every hour cron.schedule('0 * * * *', refreshMissingPRAnalyses); } -/* + export async function startDemo() { await evaluateSubmissions(); - await distributePrizes(); + //await distributePrizes(); } -*/ + diff --git a/apps/weeklyhackathon-core/src/main.ts b/apps/weeklyhackathon-core/src/main.ts index aecc104..6e71e1e 100644 --- a/apps/weeklyhackathon-core/src/main.ts +++ b/apps/weeklyhackathon-core/src/main.ts @@ -1,7 +1,7 @@ import { setTelegramBotWebhook } from '@weeklyhackathon/telegram'; //import { createSchema, writeToNodes, readFromNodes } from '@weeklyhackathon/agents/nillionVault'; import { log, env } from '@weeklyhackathon/utils'; -import { startCronJobs/*, startDemo*/ } from './cron'; +import { startCronJobs, startDemo } from './cron'; import { app } from './server'; const host = process.env.HOST ?? 'localhost'; @@ -14,12 +14,13 @@ app.listen(port, host, () => { startCronJobs(); -//startDemo(); configureBot(); +startDemo(); + /// must run this once to set up the nillion vault /// create the schema and write the PK secret in the vault /// (it was already done, just ignore it)