0

Any time I try to deploy the contract I get this error image; https://ibb.co/SfzQ1MW

gitpod /workspace/luck $ npx hardhat run scripts/deploy.js --network testnet

Downloading compiler 0.8.4
Compiling 16 files with 0.8.4
Compilation finished successfully
FetchError: request to https://moeing.tech:9545/ failed, reason: unable to verify the first certificate
    at ClientRequest.<anonymous> (/workspace/luck/node_modules/node-fetch/lib/index.js:1461:11)
    at ClientRequest.emit (node:events:390:28)
    at TLSSocket.socketErrorListener (node:_http_client:447:9)
    at TLSSocket.emit (node:events:390:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  type: 'system',
  errno: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
  code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE'

I will really appreciate your help

Rugg0
  • 1

1 Answers1

0

The issue is not specifically from hardhat but an issue faced by node-fetch which hardhat uses in the background to send the request. The main cause of this is a problem with your certificates as discussed in this question Unable to verify leaf signature.

What worked for me was to use a VPN, I assume there was an issue with my router. Once I was connected to the VPN I managed to deploy the contract successfully.

Jaymoh
  • 53
  • 5