truffle unbox react 下载项目

打开Ganache启动私有链,同时修改truffle-config.js中的端口号,使之与Ganache的端口号7545保持一致,或者改ganache的端口为8545
const path = require("path");
module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// to customize your Truffle configuration!
contracts_build_directory: path.join(__dirname, "client/src/contracts"),
networks: {
develop: {
host: 'localhost',
port: '7545',
network_id: '*' // Match any network id
}
}
};
进入控制台

编译智能合约

迁移到区块链上
truffle(develop)> migrate
Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.
Starting migrations...
======================
> Network name: 'develop'
> Network id: 5777
> Block gas limit: 0x6691b7
1_initial_migration.js
====================

最低0.47元/天 解锁文章
880

被折叠的 条评论
为什么被折叠?



