Skip to content

POST request doesn't work with Hardhat task #3941

Discussion options

You must be logged in to vote

You are defining a task inside a request handler. That... doesn't make sense?

I mean, task is used inside a Hardhat config to define tasks. Using it in any other context is almost surely a mistake.

If what you want is to verify a task programmatically, you have several options, but at least too come to mind:

  • You can use child_process to run hardhat verify with the right parameters.
  • You could make Hardhat start the server and then use hre.run to run the verify task. This is probably a bad idea though, IMO in this context it's more natural to use a Hardhat task as a short-lived action.

I can't help you with the details of how to do this, but hopefully that sets you in the right track.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sellmon
Comment options

Answer selected by sellmon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants