community.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /**
  2. * There are many awesome community services that provide Ethereum
  3. * nodes both for developers just starting out and for large-scale
  4. * communities.
  5. *
  6. * @_section: api/providers/thirdparty: Community Providers [thirdparty]
  7. */
  8. // Show the throttle message only once per service
  9. const shown = new Set();
  10. /**
  11. * Displays a warning in tht console when the community resource is
  12. * being used too heavily by the app, recommending the developer
  13. * acquire their own credentials instead of using the community
  14. * credentials.
  15. *
  16. * The notification will only occur once per service.
  17. */
  18. export function showThrottleMessage(service) {
  19. if (shown.has(service)) {
  20. return;
  21. }
  22. shown.add(service);
  23. console.log("========= NOTICE =========");
  24. console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`);
  25. console.log("");
  26. console.log("The default API keys for each service are provided as a highly-throttled,");
  27. console.log("community resource for low-traffic projects and early prototyping.");
  28. console.log("");
  29. console.log("While your application will continue to function, we highly recommended");
  30. console.log("signing up for your own API keys to improve performance, increase your");
  31. console.log("request rate/limit and enable other perks, such as metrics and advanced APIs.");
  32. console.log("");
  33. console.log("For more details: https:/\/docs.ethers.org/api-keys/");
  34. console.log("==========================");
  35. }
  36. //# sourceMappingURL=community.js.map