I need to run a particular ts script using hardhat from the command line but I need to specify parameters... Similar to this:
npx hardhat run --network rinkeby scripts/task-executor.ts param1 param2
Where the --network rinkeby
is the parameter for the hardhat run
And param1
and param2
are parameters for the task-executor.ts script.
I couldn't find any post regarding this issue and I cannot make it work.
I also tried defining a hardhat task and added those parameters but if I try to execute it I get:
Error HH9: Error while loading Hardhat's configuration.
You probably tried to import the "hardhat" module from your config or a file imported from it.
This is not possible, as Hardhat can't be initialized while its config is being defined.
Because I need to import hre
or ethers
from hardhat
in that particular task.
How to accomplish what i need?