Note that these instructions are dynamic, since I don't want to install anything that might be relevant, only the ones we actually need.
- Create a directory for the repository.
- do: "git clone https://github.com/Eitan-Lev/FomoContract.git"
npm install
from inside the FomoContract directory.
This should be enough. If not, do the steps at the bottom.
After doing above steps the truffle commands should all work.
- run the following (after all the previous steps) from the project folder:
- in a seperate terminal window: "ganache-cli -b 3"
This should start a ganache instance and print all sorts of things. Wait a second for it to finish. In this window you can see all the actions you perform on the blockchain if you work locally. truffle compile
This should print "Compiling ./contracts/..." and "Writing artifacts to ./build/contracts"truffle migrate
This should print out many migrations with addresses. If you configured the "truffle.js" to the Rinkby network (does not apply right now) then these addresses are the actuall ones the contracts are deployed to each time you migrate.truffle test
This should produce an output of what network to use and a summary of the tests success.
- in a seperate terminal window: "ganache-cli -b 3"
- do "git status"- nothing should have been added (no files changed).
- Do not under any circumstances change the gitignore file
- Work on a personal branch (not master), it's ok to push it.
Do not merge to master if there is any chance it will cause trouble to anyone else. - before push, do pull and fix merge issues.
- Do not force push!
- Do not update "package.json" or "truffle.js" or "truffle-cmd.js" without consulting with others first.
Changes to these files can be hazardous to the repository!
- Use a localhost or remote "real" website, doesn't matter.
- Deploy the FOMO contract or any other relevant one (anyway you want, such as Remix).
- Keep the address, insert it to the appropriate place in the front end code (find it, has to be somewhere).
- No need to redeploy the contract each time, we can use the same deployed one unless we all use it once.
- Interacting with front end requires the use of Metamask.
- if no truffle command works (this probably means you are working on windows), change all "truffle" commands to "node_modules.bin\truffle". This is Windows Path variable anoyance.
- Any new contract you want to add (there should theoretically be only one), you place in the contracts folder. This will automatically cause "truffle compile" to try to compile it.
- This README currently doesn't explain how to deploy or test contracts (if you try to migrate or test you will that any contract you add doesn't show there).
I will explain this later, no worries.
npm init
(press enter till it's done)npm install --save solc ganache-cli
npm uninstall -g truffle
npm install -g truffle@beta
npm install truffle@beta mocha mocha-junit-reporter --save-dev