How can I configure Hardhat to work with RSK regtest blockchain?

I intend to develop my smart contracts in Hardhat, and to test them on RSK regtest local node. I was able to find a Truffle regtest configuration.

development: {
  host: "127.0.0.1",
  port: 4444,
  network_id: "*"
},

What hardhat.config.js configuration do I need to run my tests on RSK regtest?


To deploy and test your smart contracts on RSK regtest yourhardhat.config.js should look as follows:

/**
 * @type import('hardhat/config').HardhatUserConfig
 */
require("@nomiclabs/hardhat-waffle");

module.exports = {
  solidity: "0.7.3",
  defaultNetwork: "rskregtest",
  networks: {
    rskregtest: {
      url: "http://localhost:4444/",
    },
  },
};

Then you'll be able to run your tests by typing in the terminal

% npx hardhat test