[英]Truffle only compiles, does not deploy - Ganache
I have spun up a private blockchain.network using Ganache on port 8545. I have some smart contracts which are being compiled successfully.我在端口 8545 上使用 Ganache 启动了一个私有 blockchain.network。我有一些正在成功编译的智能合约。 However, they aren't being deployed to the connected.network which is localhost:8545
但是,它们没有部署到 localhost:8545 的 connected.network
This is my truffle-config.js `这是我的 truffle-config.js `
module.exports = {
networks: {
development: {
host: "127.0.0.1",
port: 8545,
network_id: "*",
},
},
mocha: {},
compilers: {
solc: {
version: "0.8.17"
}
}
};
` `
I have tried the following:我尝试了以下方法:
migrate --reset
which only compiles and then endsmigrate --reset
Replace the following code in the truffle-config.js
:替换
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,
},
},
},
};
It may be helpful and solve the problem!它可能会有所帮助并解决问题!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.