Coder Social home page Coder Social logo

fomocontract's Introduction

FOMO contract

Build Status

Note that these instructions are dynamic, since I don't want to install anything that might be relevant, only the ones we actually need.

Initial use of this repository:

  1. Create a directory for the repository.
  2. do: "git clone https://github.com/Eitan-Lev/FomoContract.git"

After each clone you do (or directory change):

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.

How to know everything works:

  1. run the following (after all the previous steps) from the project folder:
    1. 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.
    2. truffle compile
      This should print "Compiling ./contracts/..." and "Writing artifacts to ./build/contracts"
    3. 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.
    4. truffle test
      This should produce an output of what network to use and a summary of the tests success.
  2. do "git status"- nothing should have been added (no files changed).

What not to do:

  1. Do not under any circumstances change the gitignore file
  2. 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.
  3. before push, do pull and fix merge issues.
  4. Do not force push!
  5. 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!

How to run with front end (in general):

  1. Use a localhost or remote "real" website, doesn't matter.
  2. Deploy the FOMO contract or any other relevant one (anyway you want, such as Remix).
  3. Keep the address, insert it to the appropriate place in the front end code (find it, has to be somewhere).
  4. No need to redeploy the contract each time, we can use the same deployed one unless we all use it once.
  5. Interacting with front end requires the use of Metamask.

Points to note

  1. 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.
  2. 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.
  3. 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.

Steps to do if npm install is not enough (remove node_modules first):

  1. npm init (press enter till it's done)
  2. npm install --save solc ganache-cli
  3. npm uninstall -g truffle
  4. npm install -g truffle@beta
  5. npm install truffle@beta mocha mocha-junit-reporter --save-dev

fomocontract's People

Contributors

eitan-lev avatar arikrinberg avatar kfirtoledo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.