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

Add .env.example for nextjs env variables #439

Merged
merged 4 commits into from
Jul 21, 2023

Conversation

Pabl0cks
Copy link
Collaborator

Description

This PR adds .env.example file for nextjs environment variables, like we already have for hardhat.

Also adds some extra information on how we are managing API Keys in config/env files in both hardhat and nextjs .env.example files, so users can have a better understanding.

Additional Information

Your ENS/address: pabl0cks.eth

@carletex carletex self-requested a review July 21, 2023 07:05
@carletex
Copy link
Member

Great job @Pabl0cks !!

I pushed some little tweaks.

Also noticed that we use NEXT_PUBLIC_DEPLOY_BLOCK to improve performance in the useScaffoldEventHistory hook. I feel that we could move that env var from ContractData.tsx to the hook itself. Like use fromBlock if passed, if not use the env var, if not use 0. But we can discuss that in another issue. cc @technophile-04 @rin-st

@carletex carletex merged commit 4f7d8b1 into scaffold-eth:main Jul 21, 2023
1 check passed
@Pabl0cks Pabl0cks deleted the nextjs-env-variables branch July 21, 2023 07:59
@Pabl0cks
Copy link
Collaborator Author

Pabl0cks commented Jul 21, 2023

Also noticed that we use NEXT_PUBLIC_DEPLOY_BLOCK to improve performance in the useScaffoldEventHistory hook. I feel that we could move that env var from ContractData.tsx to the hook itself. Like use fromBlock if passed, if not use the env var, if not use 0.

I think it's a great idea! So you don't have to manually set the fromBlock or add the process.env.NEXT_PUBLIC_DEPLOY_BLOCK ? logic in every useScaffoldEventHistory you use.

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.

2 participants