[英]Truffle only compiles, does not deploy - Ganache
我在端口 8545 上使用 Ganache 启动了一个私有 blockchain.network。我有一些正在成功编译的智能合约。 但是,它们没有部署到 localhost:8545 的 connected.network
这是我的 truffle-config.js `
module.exports = {
networks: {
development: {
host: "127.0.0.1",
port: 8545,
network_id: "*",
},
},
mocha: {},
compilers: {
solc: {
version: "0.8.17"
}
}
};
`
我尝试了以下方法:
migrate --reset
替换truffle-config.js
中的以下代码:
require("babel-register");
require("babel-polyfill");
// We're settings up our networks to the Ganache Network
module.exports = {
networks: {
development: {
host: "127.0.0.1",
port: "7545",
network_id: "*", // Connect to any network
},
},
// The path of contracts folder
contracts_directory: "./src/contracts",
// The path of all our JSON Files
contracts_build_directory: "./src/build/contracts",
compilers: {
solc: {
version: "^0.8.0",
optimizer: {
enabled: true,
runs: 200,
},
},
},
};
它可能会有所帮助并解决问题!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.