2018-05-11 15:15:32 +00:00
# MyCrypto Web & Desktop Apps
2017-04-12 05:06:09 +00:00
2018-02-14 21:21:02 +00:00
[![Coverage Status ](https://coveralls.io/repos/github/MyCryptoHQ/MyCrypto/badge.svg?branch=develop )](https://coveralls.io/github/MyCryptoHQ/MyCrypto?branch=develop)
2017-11-07 23:59:27 +00:00
2018-05-11 15:15:32 +00:00
* **Just looking to download?** Grab our [latest release ](https://github.com/MyCryptoHQ/MyCrypto/releases ).
* **Looking for the old site?** Check out [https://legacy.mycrypto.com ](https://legacy.mycrypto.com ) or the source at [MyCryptoHQ/mycrypto.com ](https://github.com/MyCryptoHQ/mycrypto.com )
2018-06-08 23:14:38 +00:00
## Requirements
2018-06-12 15:51:58 +00:00
* Node 8.9.4\*
* Yarn >= 1.7.0\*\*
* Python 2.7.X\*\*\*
2018-06-08 23:14:38 +00:00
2018-06-29 07:14:57 +00:00
< sub > \*Higher versions should work fine, but may cause inconsistencies. It's suggested you run 8.9.4 using `nvm` .</ sub >
2018-06-08 23:14:38 +00:00
< br / >
2018-06-12 15:51:58 +00:00
< sub > **npm is NOT supported for package management. MyCrypto uses yarn.lock to ensure sub-dependency versions are pinned, so yarn is required to install node_modules< / sub >
< br / >
< sub > \***Python 3 is **not** supported, since our dependencies use `node-gyp` .</ sub >
2018-06-08 23:14:38 +00:00
2018-01-29 18:24:20 +00:00
## Running the App
2018-06-12 15:51:58 +00:00
After `yarn` ing all dependencies you can run various commands depending on what you want to do:
2018-01-29 18:24:20 +00:00
#### Development
```bash
# run app in dev mode in browser, rebuild on file changes
2018-06-12 15:51:58 +00:00
yarn dev
2018-01-29 18:24:20 +00:00
```
2017-04-12 05:06:09 +00:00
```bash
2018-01-29 18:24:20 +00:00
# run app in dev mode in electron, rebuild on file changes
2018-06-12 15:51:58 +00:00
yarn dev:electron
2017-04-12 05:06:09 +00:00
```
2018-01-29 18:24:20 +00:00
#### Build Releases
```bash
# builds the production server app
2018-06-12 15:51:58 +00:00
yarn build
2018-01-29 18:24:20 +00:00
```
```bash
# builds the downloadable version of the site
2018-06-12 15:51:58 +00:00
yarn build:downloadable
2018-01-29 18:24:20 +00:00
```
2017-04-12 05:06:09 +00:00
```bash
2018-01-29 18:24:20 +00:00
# builds the electron apps
2018-06-12 15:51:58 +00:00
yarn build:electron
2018-01-29 18:24:20 +00:00
# builds only one OS's electron app
2018-06-12 15:51:58 +00:00
yarn build:electron:(osx|linux|windows)
2017-04-12 05:06:09 +00:00
```
2018-01-29 18:24:20 +00:00
All of these builds are output to a folder in `dist/` .
2017-04-12 05:06:09 +00:00
2017-12-07 02:11:50 +00:00
#### Unit Tests:
2017-04-12 05:06:09 +00:00
```bash
2018-01-29 18:24:20 +00:00
# run unit tests with Jest
2018-06-12 15:51:58 +00:00
yarn test
2017-04-12 05:06:09 +00:00
```
2017-12-07 02:11:50 +00:00
#### Integration Tests:
```bash
2018-01-29 18:24:20 +00:00
# run integration tests with Jest
2018-06-12 15:51:58 +00:00
yarn test:int
2017-12-07 02:11:50 +00:00
```
2017-09-20 00:47:46 +00:00
#### Dev (HTTPS):
2018-01-29 18:24:20 +00:00
Some parts of the site, such as the Ledger wallet, require an HTTPS environment to work. To develop on HTTPS, do the following:
2018-06-12 15:51:58 +00:00
1. Create your own SSL Certificate (Heroku has a [nice guide here ](https://devcenter.heroku.com/articles/ssl-certificate-self ))
2. Move the `.key` and `.crt` files into `webpack_config/server.*`
3. Run the following command:
2017-09-20 00:47:46 +00:00
```bash
2018-06-12 15:51:58 +00:00
yarn dev:https
2017-09-20 00:47:46 +00:00
```
2017-12-07 02:11:50 +00:00
#### Address Derivation Checker:
2017-12-19 17:23:57 +00:00
2017-12-07 02:11:50 +00:00
EthereumJS-Util previously contained a bug that would incorrectly derive addresses from private keys with a 1/128 probability of occurring. A summary of this issue can be found [here ](https://www.reddit.com/r/ethereum/comments/48rt6n/using_myetherwalletcom_just_burned_me_for/d0m4c6l/ ).
2017-12-19 17:23:57 +00:00
As a reactionary measure, the address derivation checker was created.
2017-12-07 02:11:50 +00:00
To test for correct address derivation, the address derivation checker uses multiple sources of address derivation (EthereumJS and PyEthereum) to ensure that multiple official implementations derive the same address for any given private key.
2017-08-24 16:41:47 +00:00
##### The derivation checker utility assumes that you have:
2017-12-19 17:23:57 +00:00
2018-06-12 15:51:58 +00:00
1. Docker installed/available
2. [dternyak/eth-priv-to-addr ](https://hub.docker.com/r/dternyak/eth-priv-to-addr/ ) pulled from DockerHub
2017-08-24 16:41:47 +00:00
##### Docker setup instructions:
2017-12-19 17:23:57 +00:00
2018-06-12 15:51:58 +00:00
1. Install docker (on macOS, [Docker for Mac ](https://docs.docker.com/docker-for-mac/ ) is suggested)
2. `docker pull dternyak/eth-priv-to-addr`
2017-09-20 00:47:46 +00:00
2017-08-24 16:41:47 +00:00
##### Run Derivation Checker
2017-12-19 17:23:57 +00:00
2017-12-07 02:11:50 +00:00
The derivation checker utility runs as part of the integration test suite.
2017-08-24 16:41:47 +00:00
```bash
2018-06-12 15:51:58 +00:00
yarn test:int
2017-08-24 16:41:47 +00:00
```
2017-04-12 05:06:09 +00:00
## Folder structure:
```
2017-04-12 05:09:28 +00:00
│
2017-10-14 19:14:24 +00:00
├── common
2018-01-29 18:24:20 +00:00
│ ├── actions - Application actions
2017-10-31 06:25:22 +00:00
│ ├── api - Services and XHR utils
2018-01-29 18:24:20 +00:00
│ ├── assets - Images, fonts, etc.
│ ├── components - Components according to "Redux philosophy"
│ ├── config - Various config data and hard-coded json
│ ├── containers - Containers according to "Redux philosophy"
│ ├── libs - Framework-agnostic libraries and business logic
│ ├── reducers - Redux reducers
│ ├── sagas - Redux sagas
│ ├── sass - SCSS styles, variables, mixins
│ ├── selectors - Redux selectors
│ ├── translations - Language JSON dictionaries
│ ├── typescript - Typescript definition files
│ ├── utils - Common use utility functions
│ ├── index.tsx - Entry point for app
│ ├── index.html - Html template file for html-webpack-plugin
│ ├── Root.tsx - Root component for React
│ └── store.ts - Redux reducer combiner and middleware injector
├── electron-app - Code for the native electron app
├── jest_config - Jest testing configuration
├── spec - Jest unit tests, mirror's common's structure
├── static - Files that don't get compiled, just moved to build
└── webpack_config - Webpack configuration
```
2018-02-07 04:28:28 +00:00
### More information is available on the [Wiki Pages](https://github.com/MyCryptoHQ/MyCrypto/wiki)
2017-09-25 02:55:23 +00:00
## Thanks & Support
< a href = "https://browserstack.com/" >
< img src = "https://i.imgur.com/Rib9y9E.png" align = "left" / >
< / a >
Cross browser testing and debugging provided by the very lovely team at BrowserStack.