Skip to content

A group project for the Blockchains and Overlay Networks Masters module

Notifications You must be signed in to change notification settings

danielj0nes/four-in-a-chain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Four in a Chain

Four in a Chain is a custom implementation of the classic "Four in a Row" game. In our implementation, users can offer a currency stake (e.g., 1 ETH) that another player has to then match. The winner receives double their original stake.

Group Hera Members

  • Artem Vasilev
  • Daniel Gordon Jones
  • Davide Busolin
  • David Pierre Sébastien Lebrec
  • Euxane Célia Marie Vaz Pinto
  • Turki Alahmadi

Project details

  • Web server/routing using Node.js and Koa
  • Web3.js to interact with the blockchain over HTTP
  • All contracts wrote and compiled with Solidity
  • No CIA frameworks (pure HTML/CSS/JS)

Building the project

  1. First clone the project and run "npm install" to download the dependencies
  2. Launch the start_testnet.sh script
  3. On a new terminal launch the connect_testnet.sh script
  4. (Optionally but recommended) start the miner with "miner.start(number_of_threads)"
  5. In the src/ directory, run "npm start" to launch the web server (default port 8888)

Playing the game

  1. Ensure MetaMask is installed with at least 2 funded accounts (you can generate funds by running the miner on the testnet)
  2. Connect a wallet
  3. Initialise a game (this deploys an instance of the contract and joins it with the current account)
  4. Join the game with the other account
  5. Make moves; each move is a transaction validated by the smart contract that has to be confirmed with the correct account
  6. The winner receives the 2 ETH (currently capped) from the loser + their own 2 ETH back

About

A group project for the Blockchains and Overlay Networks Masters module

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •