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

feat: set fastest endpoint for assethub #11287

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

preschian
Copy link
Member

Thank you for your contribution to the Koda - Generative Art Marketplace.

👇 __ Let's make a quick check before the contribution.

PR Type

  • Bugfix
  • Feature
  • Refactoring

Context

  • Based on this issue: ci: adjust assethub endpoint #11283, we currently use only one endpoint on AssetHub. There is a chance the endpoint will return "429 Too Many Requests". This PR will determine which endpoint is the fastest, making the endpoint dynamic for each instance.
  • Refactored to get AssetHub endpoints from the @polkadot/apps-config package.
  • Refactored to ignore the build step for our static package. So far, we don't need to publish the package.

- Changed the 'dev' script to use 'pnpm run prepare' instead of 'nuxi prepare'.
- Updated the 'prepare' script to include a call to 'node ./script/polkadot-endpoint.mjs'.
- Bumped the version of '@polkadot/apps-config' from '^0.138.1' to '^0.146.1'.
…try point

- Deleted the justfile as it was no longer needed.
- Updated the repository URL in package.json to point to the correct GitHub location.
- Changed the main entry point in package.json from './dist/index.cjs' to './src/index.ts'.
Copy link

netlify bot commented Dec 23, 2024

Deploy Preview for koda-canary ready!

Name Link
🔨 Latest commit 1c43dd3
🔍 Latest deploy log https://app.netlify.com/sites/koda-canary/deploys/677d02ba1175b40008ae56e6
😎 Deploy Preview https://deploy-preview-11287--koda-canary.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

socket-security bot commented Dec 23, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@polkadot/apps-config@0.146.1 Transitive: environment, network +152 274 MB polkadotjs

🚮 Removed packages: npm/@polkadot/apps-config@0.138.1

View full report↗︎

Copy link

cloudflare-workers-and-pages bot commented Dec 23, 2024

Deploying koda-art-prod with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1c43dd3
Status: ✅  Deploy successful!
Preview URL: https://1d7ddda9.kodaart-production.pages.dev
Branch Preview URL: https://feat--set-fastest-endpoint-f.kodaart-production.pages.dev

View logs

…t fastest successful connection logic in polkadot-endpoint.mjs

- Added response time measurement for WebSocket connections.
- Implemented a helper function to find the fastest successful connection among multiple endpoints.
- Improved error handling and ensured proper disconnection of the API after attempts.
@preschian preschian marked this pull request as ready for review December 23, 2024 10:37
@preschian preschian requested a review from a team as a code owner December 23, 2024 10:37
@preschian preschian requested review from vikiival and Jarsen136 and removed request for a team December 23, 2024 10:37
Copy link

netlify bot commented Dec 31, 2024

Deploy Preview for polkadot failed.

Name Link
🔨 Latest commit 0f0fb84
🔍 Latest deploy log https://app.netlify.com/sites/polkadot/deploys/67741f07e41dee00081860f9

script/polkadot-endpoint.mjs Outdated Show resolved Hide resolved
- Implemented a timeout for the API readiness check to prevent indefinite waiting.
- Changed error handling from throwing an error to logging a message when no successful connections are found.
Copy link

sonarqubecloud bot commented Jan 7, 2025

@preschian preschian requested a review from Jarsen136 January 7, 2025 10:33
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.

3 participants