4

要连接到以太坊测试网,配置hardhat.config.js如下:

  networks: {
    ropsten: {
      url: `https://eth-ropsten.alchemyapi.io/v2/${ALCHEMY_API_KEY}`,
      accounts: [`${ROPSTEN_PRIVATE_KEY}`]
    }
  }

(取自这里:https ://hardhat.org/tutorial/deploying-to-a-live-network.html )

如何为 RSK 测试网添加网络配置?

(请注意,我使用的是助记词而不是原始私钥)

4

1 回答 1

6

网络配置hardhat.config.js可以这样定义:

  networks: {
    rsktestnet: {
      chainId: 31,
      url: 'https://public-node.testnet.rsk.co/',
      gasPrice: Math.floor(minimumGasPriceTestnet * TESTNET_GAS_MULT),
      gasMultiplier: TESTNET_GAS_MULT,
      accounts: {
        mnemonic: mnemonic,
        initialIndex: 0,
        // if using RSK dPath
        // Ref: https://developers.rsk.co/rsk/architecture/account-based/#derivation-path-info
        path: "m/44'/37310'/0'/0",
        // if using Ethereum dPath (e.g. for Metamask compatibility)
        // path: "m/44'/60'/0'/0",
        count: 10,
      },
    },
  },

在哪里

  • mnemonic是您的 BIP-39 种子短语。
  • TESTNET_GAS_MULT设置为大于或等于的任何值1
  • minimumGasPriceTestnet看到这个答案这个答案
于 2021-12-23T15:09:32.180 回答