/smart-contracts-monopoly

Monopoly game with rules encapsulated in smart contracts on Ethereum blockchain.

Primary LanguageJavaScript

Monopoly on the Ethereum blockchain

This project aims to create a Monopoly version of a game running as a decentralized application on top of the Ethereum blockchain. It's done as a part of our Learn Tech Fridays where we spend our afternoon hours learning new tech.

UI in React is a fork of ChebyrTech/React-node-monopoly.

Our current tasks are:

  1. Write smart contracts encapsulating Monopoly rules.
  2. Replace layer of Redux business logic from original code with calls to our smart contracts.

Installation

Install truffle framework globally in your system:

npm install -g truffle

See Truffle Quickstart documentation for commands.

To install all dependencies for smart contracts run:

cd blockchain/
npm install

React UI is a standalone project and doesn’t require any additional steps. Open index.html from the root directory in your favorite browser and it will work right away.

Development

For development we use:

Testing

To create a local chain on development machines we use ganache-cli. We found it to be more stable than GUI version of Ganache which often has problems on macOS.

Start your local chain:

ganache-cli -m 'test'

Using the same mnemonic every time (-m option, normally it's composed of 24 words) will ensure the same state of test chain every time tests are run. First wallet is also hardcoded as an initial bank account for now.

To run tests execute:

cd blockchain/
truffle test