【问题标题】:How can I configure Hardhat to work with RSK regtest blockchain?如何配置 Hardhat 以使用 RSK regtest 区块链?
【发布时间】:2022-01-20 07:35:53
【问题描述】:

我打算在Hardhat 中开发我的智能合约,并在 RSK regtest 本地节点上对其进行测试。我was able to find Truffle regtest 配置。

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

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

【问题讨论】:

    标签: truffle hardhat rsk


    【解决方案1】:

    要在 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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-05
      • 1970-01-01
      • 2021-11-25
      • 2021-06-19
      • 2021-05-27
      • 2018-10-06
      相关资源
      最近更新 更多