Welcome to the Magmo mono-repo, home of several proof-of-concept applications built on our state channel protocols.
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:
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 the wallet
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.
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.
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
TARGET_NETWORK
in your .env.local
file to the network you want to deploy to: either 'development'
, 'ropsten'
, 'kovan'
or 'rinkeby'
.yarn deployContracts
Alternatively, simply run, e.g. TARGET_NETWORK=ropsten yarn deployContracts
.From the relevant subdirectory...
yarn test:app
yarn test:contracts
yarn test
npx lerna bootstrap
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
.
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:
npx lerna bootstrap
if you changed any dependenciesOtherwise, 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
.
// 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