wighawag / hardhat-deploy

hardhat deployment plugin
MIT License
1.2k stars 296 forks source link

hardhat deploy and "hardhat node" sequence. #334

Open drortirosh opened 2 years ago

drortirosh commented 2 years ago

Describe the bug

I have a deployment that depends on external script that deploys other contracts first. This is relevant, of course, only when working with an external node (hardhat node)

The point is that when hardhat node is executed, it runs the deployment script BEFORE the external node is started and expose its RPC api, so the external script fails. The only way to run the deployment right now is: hardhat node --no-deploy and then in a separate window hardhat deploy

But obviously, this is annoying.

Suggestion when integrating with hardhat-node, make sure the RPC is active before calling the "deploy" function

versions

drortirosh commented 1 year ago

Then running "hardhat node", the deploy action is automatically executed after the evm is up and there is a provider to work with it, but BEFORE the listener (on port 8545) is up. So if the deployment script depends on an external tool that requires to connect to the node via an rpc provider, that deployment script would fail. The same deployment script would succeeds if the node is started with "hardhat node --no-deploy" and then (in another window) "hardhat deploy --network localhost"

On Tue, 25 Oct 2022, 07:46 Asmee Dhungana, @.***> wrote:

Hi, could you elaborate on this statement:

"Suggestion when integrating with hardhat-node, make sure the RPC is active before calling the "deploy" function"

— Reply to this email directly, view it on GitHub https://github.com/wighawag/hardhat-deploy/issues/334#issuecomment-1289973701, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJTY4D5W7LEXVDSOH6JQMP3WE5QZFANCNFSM5YTTPTZQ . You are receiving this because you authored the thread.Message ID: @.***>