Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #471

Draft
wants to merge 240 commits into
base: main
Choose a base branch
from
Draft

Dev #471

wants to merge 240 commits into from

Conversation

Corantin
Copy link
Contributor

No description provided.

Corantin and others added 30 commits September 12, 2024 16:11
# Conflicts:
#	apps/web/app/page.tsx
# Conflicts:
#	apps/web/app/page.tsx
- Renamed the `dailyJob` route to support different chains
- Moved chain-specific variables inside the `updateScoresOnChain` function
- Changed `GET` method to `POST` and added authorization check
- Added new cron jobs in vercel.json for different chains
- Included 'CRON_SECRET' in environment variables in turbo.json

:alarm_clock: Updated job schedule frequency

The frequency of the daily-job in the passport-oracles API has been updated.

- The job was previously running every minute, but it's now set to run every 15 minutes. This change should help reduce server load and improve overall performance.

:lock: Added unauthorized access logging

- Enhanced security by adding a console error log for unauthorized attempts to access the dailyJob route.
- The log includes details such as the request URL and chain parameter.

:alarm_clock: Updated cron job configurations

- Added POST method to all scheduled jobs
- No changes in the schedule timings, they remain at every 15 minutes
- This update ensures that the correct HTTP method is used when these jobs are triggered

:recycle: Refactor code to support multiple chains

- Renamed routes to include chain parameter
- Moved chain-specific variables inside functions, allowing them to use the new chain parameter
- Replaced local URLs with Vercel URL for fetching scores and passport data
- Removed unused environment variables (CHAIN_ID, HOST, PORT)
- Added authorization check in POST methods using CRON_SECRET environment variable
- Updated cron jobs in vercel.json to remove method specification

:sparkles: Added chain ID to API endpoints

- Imported `useChainIdFromPath` hook in CheckPassport, PoolForm and SubmitPassport components
- Updated the WRITE_SCORER_URI and fetch URL for addStrategy to include `chainFromPath`
- This allows the application to dynamically use the correct chain ID based on the current path

Fix paths

:truck: Standardize route naming

Renamed several routes to follow a consistent kebab-case naming convention. This change improves readability and consistency across the codebase.

- Changed 'addStrategy' to 'add-strategy'
- Renamed 'dailyJob' to 'daily-job'
- Updated 'writeScore' to 'write-score'
- Altered 'signMessage' to 'sign-message'
- Modified 'submitPassport' to 'submit-passport'

Also updated references in components where these routes were used.

:recycle: Improved URL handling and response messages

- Modified the way URLs are constructed to handle both production and development environments
- Enhanced response message to provide more accurate status of score updates
- The production version in the configuration file has been updated from 0.1.0 to 0.1.1.
- This update is necessary for the deployment of new features and bug fixes in the production environment.
♻️ Refactored subgraph URL generation

- Introduced a new function to generate subgraph URLs
- Added error handling for fetching data from published subgraphs, with fallback to hosted ones
- Updated the use of this function across multiple files
- Included the ability to specify a publishedSubgraphUrl in chain configuration
- Bumped up the production version of the subgraph in config file
- Replaced the direct environment variable access for fetching the Subgraph URL with a function call to `getConfigByChain`.
- This change enhances code maintainability and readability by centralizing configuration data retrieval.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants