A project for testing purpose
Install nodejs global dependencies npm i -g ganache-cli truffle
Install project dependencies npm i
Run a development network with the command ganache-cli
Configure your network in truffle.config.js
module.exports = {
// ...
networks: {
// ...
development: {
host: "127.0.0.1", // Localhost (default: none)
port: 8545, // Standard Ethereum port (default: none)
network_id: "*", // Any network (default: none)
}
}
// ...
}
truffle compile ./contracts/MyTokenCoin.sol
truffle compile ./test/my_token_coin.sol
- Create file environment
cp .env.example .env
- Set
.env
values - Run
truffle migrate --network rinkeby
See the contract example here