As an event organiser, I want to distribute prizes to participants based on a random draw so that it is faring.
- As an admin, I can register a list of participants so that participants see their names
- As an admin, I can register a list of prizes so that participants see the prize to win
- As an admin, I can run the raffle draw so that participants see the winner
- As an admin, I can validate the winner is present so that I can give him his prize
- As an admin, I can rerun the raffle draw if winner is not here or if winner is not interested in the prize so that prize can be distributed
- As an admin, I can run the raffle draw until there is no more prize to win so that raffle draw game is ended
We decided that everyone work on a branch named as the slack username, so this is some useful git
commands to start working:
To create your own branch on the git repository:
git clone https://github.com/DevchainUserGroup/RaffleDraw
cd RaffleDraw
git branch
to list existing branchesgit checkout -b SLACK_USERNAME
to create a new branch (-b
) and switch on it (checkout
)git branch
to ensure your are on your branch, the one with a*
beforeecho “build” > .gitignore
create the.gitignore
file that list all files to not commit, starting withbuild
git config --global user.email "[email protected]"
where[email protected]
is the email used on your Github.com account
When you finish your development, you can commit them:
git add .
to handle all files (to commit)git commit -m "the goal of your commit"
git push origin THE_NAME_OF_YOUR_BRANCH_AKA_SLACK_USERNAME
to upload your commit on github
Assuming you start from your own branch (*
in front of the current branch):
$ git branch
* jacques
master
Ensure that you have no uncommitted changes:
$ git status
On branch jacques
nothing to commit, working tree clean
List all (remote) branches:
$ git branch -a
* jacques
master
remotes/origin/HEAD -> origin/master
remotes/origin/cbroillet
remotes/origin/jacques
remotes/origin/master
remotes/origin/syllabus
Fetch all remotes:
$ git pull --all
And then locally switch to the wanted remote branch:
$ git checkout syllabus
Branch syllabus set up to track remote branch syllabus from origin.
Switched to a new branch 'syllabus'
Check:
$ git branch
jacques
master
* syllabus
You are now on the branch of syllabus
!
Enjoy hacking ;)
If we create a Github Issue for each User Story we can reference them in the commit message as #ISSUEID
, for example:
git commit -m "#1 - Register a Participant: create the Attendee sol with unit test"
With @syllabus we summarized the environment as the following diagram (do not hesitate to complete/correct it):
NB: as I have not write access to the environment
I put it there.
Mac OS X──────────────────────────────────────────────────────────────────┐
│ │
│ $ cd vagrant │
│ $ vagrant up <<[ONCE] │
│ $ vagrant ssh │
│ │
│ VAGRANT───────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ $ cd docker │ │
│ │ $ docker image list │ │
│ │ $ make bash-truffle <<[ONCE] │ │
│ │ $ (make join-truffle) │ │
│ │ │ │
│ │ TRUFFLE───────────────────────────────────────────┐ │ │
│ │ │ $ testrpc │ │ │
│ │ │ │ │ │
│ │ │ │ │ │
│ │ │ │ │ │
│ │ └─────────────────────────────────────────────────┘ │ │
│ │ TRUFFLE───────────────────────────────────────────┐ │ │
│ │ │ $ truffle test │ │ │
│ │ │ │ │ │
│ │ │ !! WORK / DEVELOP HERE !! │ │ │
│ │ │ │ │ │
│ │ └─────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ $ make build-geth <<[ONCE] │ │
│ │ $ make run-geth │ │
│ │ │ │
│ │ GETH──────────────────────────────────────────────┐ │ │
│ │ │ │ │ │
│ │ │ Create a/my node available on the network. │ │ │
│ │ │ MINING!!... So consuming CPU and storage: │ │ │
│ │ │ │ │ │
│ │ │ $ df -k │ │ │
│ │ │ │ │ │
│ │ └─────────────────────────────────────────────────┘ │ │
│ │ $ make stop-geth │ │
│ │ │ │
│ └─────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────┘