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

ENSRainbow: Refine handling of invalid ENV vars #118

Open
lightwalker-eth opened this issue Jan 30, 2025 · 0 comments
Open

ENSRainbow: Refine handling of invalid ENV vars #118

lightwalker-eth opened this issue Jan 30, 2025 · 0 comments
Assignees
Labels
ensrainbow ENSRainbow related

Comments

@lightwalker-eth
Copy link
Member

lightwalker-eth commented Jan 30, 2025

Creating this story while reviewing PR 101.

Suggest setting the ENV vars used by ENSRainbow to invalid values. Ex: directories or files that don't exist, or to invalid port values (ex: negative integers, etc.. please see definition of parseInt). Please also consider invalid INPUT_FILE values.

Goal: Ensure that in all cases the error messages are useful and would help someone to fix the incorrectly set ENV var.

I see that we already have some logic added for this inside apps/ensrainbow/src/index.ts, however:

  1. Shouldn't we use similar logic in apps/ensrainbow/src/ingest.ts (and anywhere else relevant)?
  2. Shouldn't we move this logic such that it is defined in only a single file and imported as needed?

Also suggest writing utility functions that wrap reading values out of ENV vars. Please see utility functions in the following file for some inspirations: https://github.com/namehash/ensnode/blob/main/apps/ensnode/src/lib/ponder-helpers.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ensrainbow ENSRainbow related
Projects
Status: On deck
Development

No branches or pull requests

2 participants