/ README.md
README.md
  1  # MyCrypto Web & Desktop Apps
  2  
  3  [![Coverage Status](https://coveralls.io/repos/github/MyCryptoHQ/MyCrypto/badge.svg?branch=develop)](https://coveralls.io/github/MyCryptoHQ/MyCrypto?branch=develop)
  4  
  5  * **Just looking to download?** Grab our [latest release](https://github.com/MyCryptoHQ/MyCrypto/releases).
  6  * **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)
  7  
  8  ## Requirements
  9  
 10  * Node 8.9.4\*
 11  * Yarn >= 1.7.0\*\*
 12  * Python 2.7.X\*\*\*
 13  
 14  <sub>\*Higher versions should work fine, but may cause inconsistencies. It's suggested you run 8.9.4 using `nvm`.</sub>
 15  <br/>
 16  <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>
 17  <br/>
 18  <sub>\***Python 3 is **not** supported, since our dependencies use `node-gyp`.</sub>
 19  
 20  ## Running the App
 21  
 22  After `yarn`ing all dependencies you can run various commands depending on what you want to do:
 23  
 24  #### Development
 25  
 26  ```bash
 27  # run app in dev mode in browser, rebuild on file changes
 28  yarn dev
 29  ```
 30  
 31  ```bash
 32  # run app in dev mode in electron, rebuild on file changes
 33  yarn dev:electron
 34  ```
 35  
 36  #### Build Releases
 37  
 38  ```bash
 39  # builds the production server app
 40  yarn build
 41  ```
 42  
 43  ```bash
 44  # builds the downloadable version of the site
 45  yarn build:downloadable
 46  ```
 47  
 48  ```bash
 49  # builds the electron apps
 50  yarn build:electron
 51  
 52  # builds only one OS's electron app
 53  yarn build:electron:(osx|linux|windows)
 54  ```
 55  
 56  All of these builds are output to a folder in `dist/`.
 57  
 58  #### Unit Tests:
 59  
 60  ```bash
 61  # run unit tests with Jest
 62  yarn test
 63  ```
 64  
 65  #### Integration Tests:
 66  
 67  ```bash
 68  # run integration tests with Jest
 69  yarn test:int
 70  ```
 71  
 72  #### Dev (HTTPS):
 73  
 74  Some parts of the site, such as the Ledger wallet, require an HTTPS environment to work. To develop on HTTPS, do the following:
 75  
 76  1.  Create your own SSL Certificate (Heroku has a [nice guide here](https://devcenter.heroku.com/articles/ssl-certificate-self))
 77  2.  Move the `.key` and `.crt` files into `webpack_config/server.*`
 78  3.  Run the following command:
 79  
 80  ```bash
 81  yarn dev:https
 82  ```
 83  
 84  #### Address Derivation Checker:
 85  
 86  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/).
 87  
 88  As a reactionary measure, the address derivation checker was created.
 89  
 90  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.
 91  
 92  ##### The derivation checker utility assumes that you have:
 93  
 94  1.  Docker installed/available
 95  2.  [dternyak/eth-priv-to-addr](https://hub.docker.com/r/dternyak/eth-priv-to-addr/) pulled from DockerHub
 96  
 97  ##### Docker setup instructions:
 98  
 99  1.  Install docker (on macOS, [Docker for Mac](https://docs.docker.com/docker-for-mac/) is suggested)
100  2.  `docker pull dternyak/eth-priv-to-addr`
101  
102  ##### Run Derivation Checker
103  
104  The derivation checker utility runs as part of the integration test suite.
105  
106  ```bash
107  yarn test:int
108  ```
109  
110  ## Folder structure:
111  
112  ```
113114  ├── common
115  │   ├── actions - Application actions
116  │   ├── api - Services and XHR utils
117  │   ├── assets - Images, fonts, etc.
118  │   ├── components - Components according to "Redux philosophy"
119  │   ├── config - Various config data and hard-coded json
120  │   ├── containers - Containers according to "Redux philosophy"
121  │   ├── libs - Framework-agnostic libraries and business logic
122  │   ├── reducers - Redux reducers
123  │   ├── sagas - Redux sagas
124  │   ├── sass - SCSS styles, variables, mixins
125  │   ├── selectors - Redux selectors
126  │   ├── translations - Language JSON dictionaries
127  │   ├── typescript - Typescript definition files
128  │   ├── utils - Common use utility functions
129  │   ├── index.tsx - Entry point for app
130  │   ├── index.html - Html template file for html-webpack-plugin
131  │   ├── Root.tsx - Root component for React
132  │   └── store.ts - Redux reducer combiner and middleware injector
133  ├── electron-app - Code for the native electron app
134  ├── jest_config - Jest testing configuration
135  ├── spec - Jest unit tests, mirror's common's structure
136  ├── static - Files that don't get compiled, just moved to build
137  └── webpack_config - Webpack configuration
138  ```
139  
140  ### More information is available on the [Wiki Pages](https://github.com/MyCryptoHQ/MyCrypto/wiki)
141  
142  ## Thanks & Support
143  
144  <a href="https://browserstack.com/">
145  <img src="https://i.imgur.com/Rib9y9E.png" align="left" />
146  </a>
147  
148  Cross browser testing and debugging provided by the very lovely team at BrowserStack.