This repo contains some examples of the Counterfactual framework in action:
-
The deprecated Playground app, which we used in the past to run a Node on the browser, much like the Counterfactual Wallet does nowadays with our custom MetaMask fork.
-
Two games built using CF.js: High Roller (built with Stencil) and Tic-Tac-Toe (made with React).
-
Two bots so you can run the games on your own with no need for a real counterparty: High Roller Bot and Tic-Tac-Toe Bot, both written in TypeScript.
You'll need:
- A build of our MetaMask fork installed as a browser extension.
- A Node process running the Counterfactual Wallet.
- A Node process running the Counterfactual Hub.
Check out the READMEs for each of these packages for more information on how to run them.
Once that's all set up and running, simply do:
yarn start
Keep in mind that this will open several Node processes.
If you just want to run the dApps:
yarn start:dapps
If you just want to run the bots:
yarn start:bots
# Run all tests.
yarn test
# Fix linting issues.
yarn lint:fix