truffle icon indicating copy to clipboard operation
truffle copied to clipboard

Update `truffle init` artifacts

Open emilyJLin95 opened this issue 2 years ago • 4 comments

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 is 8545. That's a bit confusing
  • [ ] Add a .gitignore with .env in it

emilyJLin95 avatar Jul 07 '22 20:07 emilyJLin95

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.

gnidan avatar Jul 14 '22 17:07 gnidan

I guess, according to @gnidan's suggestion, we should keep both the contracts and migrations folders empty on truffle init.

sukanyaparashar avatar Jul 15 '22 20:07 sukanyaparashar

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?

sukanyaparashar avatar Jul 22 '22 02:07 sukanyaparashar

Addressed in https://github.com/trufflesuite/truffle/pull/5320 if you want to validate @emilyJLin95 👌

kevinbluer avatar Aug 18 '22 16:08 kevinbluer