Skip to content

ENSRainbow: Refine handling of invalid ENV vars #118

@lightwalker-eth

Description

@lightwalker-eth

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

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

On deck

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions