truffle
truffle copied to clipboard
Update `truffle init` artifacts
We should make the following updates on truffle init:
- [ ] Replace Migrations.sol with a SimpleStorage.sol? (needs requirements)
- [ ] Replace the initial_migration with a deploy_contracts or something that deploys the SimpleStorage contract
- [ ] Update the sample truffle-config
- [ ] Goerli or Sepolia as the testnet (right now it's ropsten)
- [ ] Change the .secret to .env
- [ ] Give an example of getting both the mnemonic and Infura project id from the env
- [ ] The comment says auto create at
9545, but the development environment config is8545. That's a bit confusing
- [ ] Add a .gitignore with .env in it
Note that the idea of truffle init is that it should provide users with a blank project, so we probably don't want to use this feature to distribute example code that the user will have to delete later (i.e., yes we should remove Migrations.sol, but I don't think we should replace it with SimpleStorage)
In discussion about this, we talked about how truffle init provides helpful output to suggest truffle create ..., but this may need another issue because truffle create migration doesn't really produce good output.
I guess, according to @gnidan's suggestion, we should keep both the contracts and migrations folders empty on truffle init.
Should we also include a package.json having dotenv and @truffle/hdwallet-provider as dependencies with truffle init, so that the users get a complete development environment to start with? And we can give examples of the environment variables being imported to truffle-config.js.
(Note: Obviously this will need an extra step npm install for the users to install the dependencies specified in the package.json and may be not a good solution). Any thoughts on this?
Addressed in https://github.com/trufflesuite/truffle/pull/5320 if you want to validate @emilyJLin95 👌