首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我如何配置硬件连接到RSK测试网?

我如何配置硬件连接到RSK测试网?
EN

Stack Overflow用户
提问于 2021-12-23 15:08:43
回答 1查看 194关注 0票数 5

要连接到Ethereum,hardhat.config.js中的配置如下所示:

代码语言:javascript
复制
  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测试网添加网络配置?

(请注意,我使用的是种子短语而不是原始私钥)

EN

回答 1

Stack Overflow用户

发布于 2021-12-23 15:09:32

hardhat.config.js中的网络配置可以定义如下:

代码语言:javascript
复制
  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种子phrase.
  • TESTNET_GAS_MULT设置为大于或等于1
  • minimumGasPriceTestnet的任何值(参见this answerthis answer

)。

票数 7
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70463933

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档