要连接到以太坊测试网,配置hardhat.config.js如下:
networks: {
ropsten: {
url: `https://eth-ropsten.alchemyapi.io/v2/${ALCHEMY_API_KEY}`,
accounts: [`${ROPSTEN_PRIVATE_KEY}`]
}
}
Run Code Online (Sandbox Code Playgroud)
(取自此处:https://hardhat.org/tutorial/deploying-to-a-live-network.html)
如何为 RSK 测试网添加网络配置?
(请注意,我使用种子短语而不是原始私钥)
网络配置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,
},
},
},
Run Code Online (Sandbox Code Playgroud)
在哪里
| 归档时间: |
|
| 查看次数: |
233 次 |
| 最近记录: |