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
yarn install
- Add a
.env
file to the root directory of the repo. Refer to.env.example
which includes an example of the required variables.
- Start ganache by running
yarn ganache:start
- In a new tab Run the server
yarn start
- 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.js
into 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
scripts/start.js
- 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
We use Storybook to view our react components during development. You can start Storybook by running:
yarn storybook
This will fire up the Storybook panel inside a browser.
- Update your
TARGET_NETWORK
in.env
to a named network fromtruffle.js
(default isropsten
) - Build the application:
yarn run build
- Add test eth to your account for the deployment using an eth faucet: https://faucet.ropsten.be/ or https://faucet.metamask.io.
- Set
TARGET_NETWORK
in your.env
file to the network you want to deploy to. - Deploy the contracts to the network:
yarn truffle:migrate
yarn run test:app
yarn run test:truffle
yarn run test
yarn install
yarn add [package-name]
- installs the latest version of the package
yarn upgrade [package-name@version-number]
Please use the Sublime/VS Code package JsPrettier for formatting. Add the following changes to the prettier
settings:
"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.