invalid: cannot get environment variable when run example/call
hsyodyssey opened this issue · 0 comments
hsyodyssey commented
Hi team, There may be a potential issue here as MAINNET_EXECUTION_RPC
is not in the system environment. So when I run 'cargo run --package helios --example call',
it introduces the following error.
(base) ➜ helios git:(master) cargo run --package helios --example call
Finished dev [unoptimized + debuginfo] target(s) in 0.29s
Running `target/debug/examples/call`
Error: environment variable not found
Location:
examples/call.rs:29:23
An easily fix is to use a dotenv library so that you can read the .env files in the local project, I'll submit a PR later, FYI. (of course it's also possible to just hard-code the option to not use environment variables.)
Update: Fixed this issue locally via this PR