Simple implementation of ethereum blockchain based horse-betting system. This program was made for the Blockchain Course at Dongseo University. This program uses this repository as the codebase: https://github.com/liz7124/Simple-BC-based-voting-system-nodejs
Video Demo: https://youtu.be/lmZWb1Lsf8A
- Install dependencies in
setup.sh
. - Run
ganache-cli -m dongseo
for the Ethereum Client. - Run
truffle migrate --reset --config truffle-config.cjs
. - Change
dir
variable in src/js/tools.js to your directory path. - Run server
node src/js/server.js
.
- Open
localhost:3000
from your browser. - Fill the address with one of the address generated from
ganache-cli
. - Don't use the first address because I used it as address owner of the Voting smart contract.
- Open
localhost:3000/login
from your browser. - Fill the address and password from previous step.
- You will be redirected to voting page.
- Choose a horse you want to bet on.
- Specify your betting amount (it's in Wei; 1 Ether = 1018 Wei).
- Click on Bet, your betting result will be reflected in the racing history and your Ether balance.
Note: If you're having problem with the user interface, you should download MDBootstrap first and put it in the src directory, because I couldn't upload the full bootstrap file in GitHub.