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
- Install Truffle
- Install Ganache for a local auto-mining blockchain
OR Use a Test Network for dev
OR Use the Ethereum Mainnet - Install Node.js and Yarn v1
- Clone the repository
git clone https://github.com/arghyadipchak/eth-word-game
- Navigate to the truffle directory
- Setup
truffle-config.js
- Migrate solidity contracts and grab the
contract address
from the output
truffle migrate
- Navigate to the client directory
- Install client dependencies
yarn install
- Put the
contract address
(from 7) asdeployerAddress
insrc/lib/store.ts
and asfactAddress
inscripts/judge.js
- Set an account as the Judge, set it's public key as
judgeAddress
insrc/lib/store.ts
and it's private key aswallPrvtKey
inscripts/judge.js
- 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 \
- Serve the client
yarn dev
OR Build the client
yarn build
and serve it using a web server such as Nginx/Traefik
The project report is available in the report
directory