-
I am having issue in deploying the scripts of part 1 video. prezzy_06@Mortis:~/work/foundry-f23/foundry-simple-storage-f23$ forge script script/DeploySimpleStorage.s.sol --rpc-url $RPC_URL --broadcast --private-key $PRIVATE_KEY
error: a value is required for '--fork-url <URL>' but none was supplied
For more information, try '--help'. But if I again run prezzy_06@Mortis:~/work/foundry-f23/foundry-simple-storage-f23$ forge script script/DeploySimpleStorage.s.sol --rpc-url $RPC_URL --broadcast --private-key $PRIVATE_KEY
error: a value is required for '--fork-url <URL>' but none was supplied
For more information, try '--help'.
prezzy_06@Mortis:~/work/foundry-f23/foundry-simple-storage-f23$ source .env
prezzy_06@Mortis:~/work/foundry-f23/foundry-simple-storage-f23$ forge script script/DeploySimpleStorage.s.sol --rpc-url $RPC_URL --broadcast --private-key $PRIVATE_KEY
[⠒] Compiling...
No files changed, compilation skipped
Script ran successfully. Can anybody tell me how to permanently fix this error as I don't want to run |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hello there @Prezzy06 if you setup for env files into your console they are just going to be there as far as you have that terminal opened, foundry relates on Please check out this: foundry-rs/foundry#1034 here they discuss this problem and end up adding support for .env. So, for now the only way is to use that Do you know any workaround for this @PatrickAlphaC ? |
Beta Was this translation helpful? Give feedback.
-
@Prezzy06 In part 2 of the video in lesson 7, this issue is discussed in detail, please wait and continue watching. |
Beta Was this translation helpful? Give feedback.
Hello there @Prezzy06 if you setup for env files into your console they are just going to be there as far as you have that terminal opened, foundry relates on
TOML
files which unfortunately just support .env variables at runtime, it means just when you have that terminal instance opened as I just said. This is to how Forge works.Please check out this: foundry-rs/foundry#1034 here they discuss this problem and end up adding support for .env.
But as mentioned forge does not support
.env
files natively, check this: foundry-rs/foundry#2430 (comment)So, for now the only way is to use that
source .env
and runtime.Do you know any workaround for this @PatrickAlphaC ?