- 我已经使用 npm 安装了最新的tronbox (2.7.5)
- 使用命令创建了一个新项目
tronbox init
- 在 tronbox.js 文件中,我已将编译器版本更新为 0.4.25(参见下面的文件)。
- 使用
tronbox compile --compile-all --reset
我得到的命令编译时:
窗口错误:
然后在我的终端中显示以下消息:
Error: Error parsing C:/dev/temp/contracts/Migrations.sol: Command failed: tronbox --download-compiler 0.4.25
at checkExecSyncError (child_process.js:575:11)
at execSync (child_process.js:612:13)
at getWrapper (C:\Users\***\AppData\Roaming\npm\node_modules\tronbox\build\components\TronSolc.js:1:1717)
at Object.parseImports (C:\Users\***\AppData\Roaming\npm\node_modules\tronbox\build\components\Compile\parser.js:1:2345)
at C:\Users\***\AppData\Roaming\npm\node_modules\tronbox\build\components\Compile\profiler.js:1:4981
at C:\Users\***\AppData\Roaming\npm\node_modules\tronbox\build\components\Resolver\index.js:1:1727
at C:\Users\***\AppData\Roaming\npm\node_modules\tronbox\node_modules\async\internal\onlyOnce.js:12:16
at next (C:\Users\***\AppData\Roaming\npm\node_modules\tronbox\node_modules\async\whilst.js:68:18)
at C:\Users\***\AppData\Roaming\npm\node_modules\tronbox\build\components\Resolver\index.js:1:1495
at C:\Users\***\AppData\Roaming\npm\node_modules\tronbox\build\components\Resolver\fs.js:1:1685
我将此行添加到文件的顶部tronbox.js
:
console.log('Running tronbox compile')
并注意到一旦编译输出在我的屏幕上写了两次:
我不确定它是否相关,但由于某种原因,它运行了两次。
任何的想法?这是一个tronbox问题吗?
const port = process.env.HOST_PORT || 9090
module.exports = {
networks: {
mainnet: {
// Don't put your private key here:
privateKey: process.env.PRIVATE_KEY_MAINNET,
/*
Create a .env file (it must be gitignored) containing something like
export PRIVATE_KEY_MAINNET=4E7FECCB71207B867C495B51A9758B104B1D4422088A87F4978BE64636656243
Then, run the migration with:
source .env && tronbox migrate --network mainnet
*/
userFeePercentage: 100,
feeLimit: 1e8,
fullHost: 'https://api.trongrid.io',
network_id: '1'
},
shasta: {
privateKey: process.env.PRIVATE_KEY_SHASTA,
userFeePercentage: 50,
feeLimit: 1e8,
fullHost: 'https://api.shasta.trongrid.io',
network_id: '2'
},
nile: {
privateKey: process.env.PRIVATE_KEY_NILE,
fullNode: 'https://httpapi.nileex.io/wallet',
solidityNode: 'https://httpapi.nileex.io/walletsolidity',
eventServer: 'https://eventtest.nileex.io',
network_id: '3'
},
development: {
// For trontools/quickstart docker image
privateKey: 'da146374a75310b9666e834ee4ad0866d6f4035967bfc76217c5a495fff9f0d0',
userFeePercentage: 0,
feeLimit: 1e8,
fullHost: 'http://127.0.0.1:' + port,
network_id: '9'
},
compilers: {
solc: {
version: '0.4.25'
}
}
}
}