module.exports = {
// See <http://truffleframework.com/docs/advanced/configuration>
// for more about customizing your Truffle configuration!
networks: {
development: {
host: "127.0.0.1",
port: 8545,
network_id: "*", // Match any network id
gas: 4712388
}
}
};
類似圖形化的testrpc
或是僅安裝指令列
npm install ganache-cli -g
truffle-config.js 範例
const HDWalletProvider = require("truffle-hdwallet-provider");
const mnemonic = "...12 words";
module.exports = {
networks: {
development: {
host: "localhost",
port: 8545,
network_id: "*" // Match any network id
},
ropsten: {
// must be a thunk, otherwise truffle commands may hang in CI
provider: () =>
new HDWalletProvider(mnemonic, "https://ropsten.infura.io/v3/..."),
network_id: '3',
}
}
};