9

我打算在 Hardhat 中开发我的智能合约并在 RSK regtest 本地节点上对其进行测试。我能够找到一个 Truffle regtest 配置。

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

在 RSK regtest 上运行测试需要什么hardhat.config.js配置?

4

1 回答 1

9

要在 RSK regtest 上部署和测试您的智能合约,您hardhat.config.js应该如下所示:

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

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

然后你就可以通过在终端中输入来运行你的测试了

% npx hardhat test
于 2022-01-20T08:01:15.210 回答