Rock Paper Scissors: an example ForceMove game
This app is an example of a game built on our ForceMove protocol. You can play against a friend or against our bots on the ropsten testnet.
To run the app on your machine, clone the code and follow the instructions below.
- Add MetaMask or an equivalent browser extension that injects a web3 object.
- Install yarn
brew install yarn
- Install dependencies
- Add a
.envfile to the root directory of the repo. Refer to
.env.examplewhich includes an example of the required variables.
To run a dev server:
- Start ganache by running
- In a new tab Run the server
- In your browser make sure you have the local ganache network (probably
localhost:7546) selected in metamask
- You will need to import one of the seed accounts from
scripts/start.jsinto metamask to have funds to transact.
- Open the metamask browser extension
- Click on the account icon (circle in the top right)
- Select "Import"
- Paste in the secret key from
- If you restart ganache, you will need to switch to another network and back in metamask to prevent transactions from failing with "incorrect nonce" errors
To run storybook
We use Storybook to view our react components during development. You can start Storybook by running:
This will fire up the Storybook panel inside a browser.
- Update your
.envto a named network from
- Build the application:
yarn run build
To deploy smart contracts
- Add test eth to your account for the deployment using an eth faucet: https://faucet.ropsten.be/ or https://faucet.metamask.io.
.envfile to the network you want to deploy to.
- Deploy the contracts to the network:
To run application tests in watch mode:
yarn run test:app
To run smart contract tests:
yarn run test:truffle
To run all tests (before submitting a PR):
yarn run test
To update dependencies:
To add a dependency:
yarn add [package-name] - installs the latest version of the package
To update the version of a dependency:
yarn upgrade [package-name@version-number]
Please use the Sublime/VS Code package JsPrettier for formatting. Add the following changes to the
"printWidth": 100, "singleQuote": true, "trailingComma": "all",
Please check issues, someone else may have had the same experience. You may find a solution -- if not, please add to or create an issue.