Skip to content

arghyadipchak/eth-word-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ethereum Antakshari

A toy implementation of Antakshari like game on the ethereum blockchain. The game works as follows: There is a judge J and n players a_1, a_2 ... a_n. At k-th turn player inputs a word w_k, such that w_k[w_k.len - 1] == w_{k-1}[0] and J determines if the word is new and valid. The game starts with a valid word set by the contract. The game ends when all but one player run out of lives, either by giving a wrong word or passing their turns.

This is the course project for the Introduction to Blockchains course at CMI by

Getting Started

  1. Install Truffle
  2. Install Ganache for a local auto-mining blockchain
    OR Use a Test Network for dev
    OR Use the Ethereum Mainnet
  3. Install Node.js and Yarn v1
  4. Clone the repository
git clone https://github.com/arghyadipchak/eth-word-game
  1. Navigate to the truffle directory
  2. Setup truffle-config.js
  3. Migrate solidity contracts and grab the contract address from the output
truffle migrate
  1. Navigate to the client directory
  2. Install client dependencies
yarn install
  1. Put the contract address (from 7) as deployerAddress in src/lib/store.ts and as factAddress in scripts/judge.js
  2. Set an account as the Judge, set it's public key as judgeAddress in src/lib/store.ts and it's private key as wallPrvtKey in scripts/judge.js
  3. Run the judge
node judge.js

If you wish to use a different set of dictionary words, populate the worddict.json with a sorted list of your words \

  1. Serve the client
yarn dev

OR Build the client

yarn build

and serve it using a web server such as Nginx/Traefik

Project Report

The project report is available in the report directory