truffle icon indicating copy to clipboard operation
truffle copied to clipboard

Update `truffle init` artifacts

Open sukanyaparashar opened this issue 2 years ago • 6 comments

ISSUE

Update truffle init artifacts. See #5268.

SOLUTION

This PR follows the below mentioned steps to update truffle init artifacts -

  • [x] Remove Migrations.sol from contracts.
  • [x] Remove 1_initial_migration.js from migrations.
  • [x] Update the sample truffle-config.js including the following -
    • [x] Use Goerli or Sepolia as the testnet.
    • [x] Change .secret to .env.
    • [x] Get mnemonic and Infura project id from .env.
    • [x] The comment says auto create at 9545, but the development environment config is 8545. What should be the ideal behaviour? I guess, the comment needs to be changed and use managed Ganache instance instead of development blockchain.
  • [x] Add a .gitignore with .env in it.

sukanyaparashar avatar Jul 18 '22 19:07 sukanyaparashar

Thanks @sukanyaparashar for taking this on! I've left a few comments. Note that issue#5268 also mentioned changing the comment on line 35 in truffle-config.js (from port 9545 to 8545)

Thanks for the review @cliffoo. In regards to the point of changing the port from 9545 to 8545, there is a catch here. Port 9545 is used by the managed Ganache when truffle develop is run with no network config.

On the other hand, when truffle test is run, it looks for the development network settings in the config by default, where 8545 is mentioned (Note: ganache-cli has the default port 8545).

Any thoughts on what should be the ideal default values for the development configuration?

sukanyaparashar avatar Jul 26 '22 22:07 sukanyaparashar

@sukanyaparashar Yea I think the development network config is fine, the confusion comes from here, where it mentions a "development blockchain", which makes one wonder if it's referring to the development network (it isn't). I don't really know how to call it instead, "dev"? "ephemeral"? Your call 😅

cliffoo avatar Aug 04 '22 18:08 cliffoo

@sukanyaparashar Yea I think the development network config is fine, the confusion comes from here, where it mentions a "development blockchain", which makes one wonder if it's referring to the development network (it isn't). I don't really know how to call it instead, "dev"? "ephemeral"? Your call 😅

I guess a better name will be "managed Ganache instance" instead of a "development blockchain", may be?

sukanyaparashar avatar Aug 04 '22 18:08 sukanyaparashar

Sounds fine by me 👍 It's nice that it maps to the variable name in code.

cliffoo avatar Aug 04 '22 22:08 cliffoo

cooool - hit approval but if there is anything left to address from the comments above then do that first before merging :)

Thanks for your approval @eggplantzzz. Yeah! I need to fix few comments and wait for @cliffoo's approval as well.

sukanyaparashar avatar Aug 05 '22 19:08 sukanyaparashar

Nice one! Thanks @sukanyaparashar

Thanks for the approval @cliffoo. I am making few more changes to the truffle-config.js file comments, after discussing with @cds-amal and @gnidan to make it more appealing to the users to read (like recommending to use truffle dashboard for better security practices).

sukanyaparashar avatar Aug 09 '22 01:08 sukanyaparashar

The new truffle-config.js writeup looks great! Just a couple notes

Thanks for the quick review, @gnidan. I will make the suggested changes. :)

sukanyaparashar avatar Aug 11 '22 19:08 sukanyaparashar