On our website you will find links to our whitepapers and contact information. Whether you simply want to try out our apps, or get involved more deeply we would love to hear your thoughts. Deployed versions of our games may be accessed with these links:
- Rock Paper Scissors (RPS)
- Tic Tac Toe (TTT)
You will need yarn
installed (see here for instructions). After cloning the code,
-
In the top directory, run
yarn install
. -
Run
npx lerna bootstrap
. -
Start ganache by running
yarn ganache:start
in one of the package directories. -
(In a new shell) Run the wallet via
yarn start
in thewallet
package directory -
(In a new shell) Run a game (either RPS or TTT) via
yarn start
in the relevant package directory. -
Add MetaMask to your browser, and point it to
localhost:3001
to view the application. You will need to import one of our (testnet-only) seed accounts 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 one of these secret keys.
You may visit the app in two different browsers in order to play against yourself. We use Redux DevTools to develop and test our apps.
All default configuration values are located in the .env
and .env.production
files.
These can be overridden by adding a .env.local
or .env.production.local
and specifying values there.
We use Storybook to view our react components during development. You can start Storybook by running:
yarn storybook
in the relevant package directory. This will fire up the Storybook panel inside a browser.
-
Optionally override the
TARGET_NETWORK
by setting the value in your.env.production.local
file. Otherwise the application will be built against the ropsten test network. -
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.local
file to the network you want to deploy to: either'development'
,'ropsten'
,'kovan'
or'rinkeby'
. - Deploy the contracts to the network:
yarn deployContracts
Alternatively, simply run, e.g.TARGET_NETWORK=ropsten yarn deployContracts
.
From the relevant subdirectory...
- To run application tests in watch mode:
yarn test:app
- To run smart contract tests:
yarn test:contracts
- To run all tests relating (before submitting a PR):
yarn test
- To update dependencies:
npx lerna bootstrap
- To add a dependency:
npx lerna add [dependency name] --scope=[target package]
This installs the latest version of the dependency to the target package (ttt, rps or wallet). Use --dev
flag to add the new package to devDependencies
instead of dependencies
.
- To update the version of a dependency:
yarn upgrade [package-name@version-number]
We are working hard to produce documenation for our applications. In the interim, please see our Developer Handbook, which as some of the hints and tips
for developing on ethereum that we have used to develop our apps. You will also find some information in the /notes/
subdirectory of each app.
Frequently, problems can be sorted by one or more of the following steps:
- Resetting your MetaMask account (i.e. deleting transaction history), or simply switching to a different network and back again.
- Restarting ganache
- Running
npx lerna bootstrap
if you changed any dependencies
Otherwise, 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.
We welcome contributions! If you want to contribute, you should be aware of the following conventions:
Prettier is configured via .prettierrc
.
Tests will fail if code does not satisfy the rules specificied in .prettierrc
.
We suggest that you configure your editor to auto-format using prettier,
or that you run it in a pre-commit git hook.
You can also run yarn prettier:write
.
- Directories and files should be kebab-cased.
// ok
foo/bar/foo-bar/foo-bar.ts
// ok
foo/bar/foo-bar/foo-bar.tsx
// tslint error
foo/bar/foo-bar/fooBar.ts
// tslint error
foo/bar/foo-bar/FooBar.tsx
// no tslint error, but please avoid this
foo/bar/fooBar/foo-bar.svg
// no tslint error, but please avoid this
foo/bar/foo-bar/FooBar.svg