Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

meth/app

Repository files navigation

Meth

Build Status codecov

Cross-platform wallet and dapp browser, for Ethereum addicts!

NOTE: This software is no longer under development and is left here for references purposes only.

Features:

  • Mnemonic-based HD wallet (BIP44/EIP85)
  • ERC-20 token support, with ability to add custom tokens
  • Multi-tab dapp browser with bookmarks
  • Interface for interacting with deployed contracts
  • Address book
  • Transactions view
  • Cross-platform (Windows, Linux, Mac, Android, iOS)
  • Automatically encrypts and backs up your data
  • Real-time sync across your devices
  • Connects to main network and all major test networks
  • Localhost RPC connection supported (run your own node!)

Developer guide

Encrypted files

The following files are encrypted with openssl aes-256-cbc -e -in <input> -out <input.aes256>:

  • build-tools/deploy/google-play-service-account.json
  • build-tools/deploy/testFairy.json

Branches

  • dev - Dev branch (default). Bleeding-edge code.
  • qa - Beta branch. All beta builds get built from this. Clean code, only approved pull requests allowed.
  • master - Production branch. Clean code, only approved pull requests allowed.

Setup and installation

Once Node is installed, install the dependencies:

$ yarn

Check that you have all necessary system dependencies by running solidarity:

$ yarn solidarity

If everything works you should see something like:

yarn run v1.1.0
$ "/path/to/meth-browser/node_modules/.bin/solidarity"

✔︎ Solidarity checks valid
✨  Done in 3.29s.

App build config

Run yarn setup:dev to generate buildConfig.json.

Private Ethereum chain

Start a local private Ethereum blockchain. We recommend using Ganache.

Unit tests

To run the unit tests:

$ yarn test

To run with coverage:

$ yarn test-cov

Desktop development

To build frontend for development:

$ yarn web:dev

To start the electron backend and full UI:

$ yarn web:electron

Mobile development

Ensure you have all necessary tools:

$ brew install watchman
$ xcode-select --install
$ gem install bundler
$ bundle update

Run the react native packager in one terminal:

$ yarn mobile:dev

Note: use yarn mobile:dev --reset-cache to do a clean package rebuild at any time.

Now, for Android do:

$ yarn mobile:android

Note: If running on a real Android device that's connected via USB, you will need to run adb reverse tcp:8545 tcp:8545 on your machine in order for the device to be able to connect to your locally running Ganache instance.

For iOS you will need to update the certificates and provisioning profiles:

$ bundle exec fastlane match --readonly development
$ bundle exec fastlane match --readonly adhoc
$ bundle exec fastlane match --readonly appstore

Then do:

$ yarn mobile:ios

Note: Running the react native packager will automatically result in the web packager output folder (out/) being deleted, to avoid module collisions.

Code style (ESLint)

We use eslint to enforce a strict coding style. We've set it up to auto-lint code upon Git commit. You can manually run the linter at any time using:

$ yarn lint:js

To auto-fix any issues, run:

$ yarn lint:js:fix

Note: not all issues are automatically fixable.

It's worth installing the prettier-atom and linter-eslint plugins for Atom if that's your editor - it will make your life easier.

Production builds

These instructions are for running on OS X - this is currently the only supported dev platform.

App config

Run yarn setup:prod to setup appConfig.json for production builds. It will look like this:

{
  "mode": "production"
}

Win/Mac/Linux

You will need to install Wine for Windows packaging to work, see https://github.com/electron-userland/electron-packager#building-windows-apps-from-non-windows-platforms

To build installation packages for do:

$ yarn web:package

The out/ folder will contain the built output.

Note: To run the built Linux executable on Ubuntu you will first need to do apt-get install libgconf-2-4.

### Android

Requirements:

  • You will need to have the METH_RELEASE_KEYSTORE_PASSWORD variable set in ~/.grade/gradle.properties

Run setup:

$ yarn setup-prod

Decrypt the Play API key:

$ openssl aes-256-cbc -d -in build-tools/deploy/google-play-service-account.json.aes256 -out build-tools/deploy/google-play-service-account.json -pass pass:$PLAY_API_ENC_KEY

Note: PLAY_API_ENC_KEY environment variable must be set for the above to work.

To build and upload Android beta app to Google Play:

$ bundle exec fastlane android production

Note: you be prompted for the fastlane match certificate encryption password. Get this from another developer

The build will create a new commit with the build number updated. Remember to push this commit back up to remote:

$ git push origin master

QA builds

For QA builds use the dev, the instructions are similar:

$ yarn setup-qa
$ bundle exec fastlane android beta

### iOS

Same as for Android, first run setup:

$ yarn setup-prod

To build and upload iOS production app to iTunes:

$ bundle exec fastlane ios production

Note: you be prompted for the fastlane match certificate encryption password. Get this from another developer

QA builds

For QA builds use the dev, the instructions are similar:

$ yarn setup-qa
$ bundle exec fastlane ios beta

Architecture

The app is written using React Native, with the desktop port done using react-native-web.

Web3 connection

Each browser tab has the following global object made available upon page load:

  • web3.currentProvider - Dapps can use this to initialise a connection that is able to communicate with the connected Ethereum node.

Note: Synchronous web3 calls are not supported.

License

AGPLv3