Git Product home page Git Product logo

jenncoop / mycrypto Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mycryptohq/mycrypto

0.0 2.0 0.0 11.88 MB

MyCrypto is an open-source, client-side tool for generating ether wallets, handling ERC-20 tokens, and interacting with the blockchain more easily.

Home Page: https://mycrypto.com

License: MIT License

TypeScript 87.42% JavaScript 1.59% CSS 10.23% HTML 0.72% Dockerfile 0.01% Shell 0.03%

mycrypto's Introduction

MyCrypto Web & Desktop Apps

Coverage Status

Requirements

  • Node 8.9.4*
  • Yarn >= 1.7.0**
  • Python 2.7.X***

*Higher versions should work fine, but may cause inconsistencies. It's suggested you run 8.9.4 using nvm.
**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
***Python 3 is not supported, since our dependencies use node-gyp.
***For users trying to build with WSL, you'll need to have install libpng via sudo apt-get install libpng16-dev.

Running the App

After yarning all dependencies you can run various commands depending on what you want to do:

Development

# run app in dev mode in browser, rebuild on file changes
yarn dev
# run app in dev mode in electron, rebuild on file changes
yarn dev:electron

Build Releases

# builds the production server app
yarn build
# builds the downloadable version of the site
yarn build:downloadable
# builds the electron apps
yarn build:electron

# builds only one OS's electron app
yarn build:electron:(osx|linux|windows)

All of these builds are output to a folder in dist/.

Unit Tests:

# run unit tests with Jest
yarn test

Integration Tests:

# run integration tests with Jest
yarn test:int

Dev (HTTPS):

Some parts of the site, such as the Ledger wallet, require an HTTPS environment to work. To develop on HTTPS, do the following:

  1. Create your own SSL Certificate (Heroku has a nice guide here)
  2. Move the .key and .crt files into webpack_config/server.*
  3. Run the following command:
yarn dev:https

Address Derivation Checker:

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.

As a reactionary measure, the address derivation checker was created.

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.

The derivation checker utility assumes that you have:
  1. Docker installed/available
  2. dternyak/eth-priv-to-addr pulled from DockerHub
Docker setup instructions:
  1. Install docker (on macOS, Docker for Mac is suggested)
  2. docker pull dternyak/eth-priv-to-addr
Run Derivation Checker

The derivation checker utility runs as part of the integration test suite.

yarn test:int

Folder structure:

│
├── common
│   ├── api - Services and XHR utils
│   ├── assets - Images, fonts, etc.
│   ├── components - Components according to "Redux philosophy"
│   ├── config - Various config data and hard-coded json
│   ├── containers - Containers according to "Redux philosophy"
|   ├── features - State management and async operations, organized per "feature", follows "ducks" philosophy, see: https://github.com/MyCryptoHQ/MyCrypto/issues/1435
│   ├── libs - Framework-agnostic libraries and business logic
|       ├── contracts - Takes in a contract interface ABI and returns an object with keys equivalent to the ABI function names that each have `.encodeInput`,  `.decodeInput`, `decodeOutput` methods. 
|       ├── ens - Basic ENS functions for getting a name hash and mapping returned ENS contract values to human-readable strings
|       ├── nodes - Configures Shepherd (https://github.com/MyCryptoHQ/shepherd) and exports a singleton provider
|       ├── scheduling - Functionality for enabling Ethereum Alarm Clock usage for scheduled transactions. See https://github.com/MyCryptoHQ/MyCrypto/pull/1343
|       ├── transaction - Utilities for signing / parsing / validating transactions
|       ├── wallet - Wallet implementations for deterministic (hw wallets, mnemonic wallets, etc), and non-deterministic (web3, parity signer, etc.) wallets.
|       ├── web-workers - Web-worker implementation of generateKeystore + fromV3 for non-blocking encrypt/decryption
|       ├── erc20 - `libs/contracts` instance of erc20 abi
|       ├── formatters - Hex string formatters
|       ├── signing - Message signing and signature verification
|       ├── units - Helper functions for working with Ethereum / Token units in both base and unit form. Use these instead of using bn.js directly
|       ├── validators - Validation functions for addresses, hex strings, keys, numbers, derivation paths, EAC values, Ethereum values, etc.
|       ├── values - Functions for building EIP681 requests, numberical sanitization, string padding, bn.js conversion
│   ├── sass - SCSS styles, variables, mixins
│   ├── 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
├── 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

Typescript Resources:

More information is available on the Wiki Pages

Thanks & Support

Cross browser testing and debugging provided by the very lovely team at BrowserStack.

mycrypto's People

Contributors

adibas03 avatar aitrean avatar alepc253 avatar bfillmer avatar blurpesec avatar connorbryan avatar crptm avatar dternyak avatar e00dan avatar eddiewang avatar greenkeeper[bot] avatar hackmod avatar hav-noms avatar herrerameri avatar james-prado avatar jcrona avatar josipbagaric avatar maciejhirsz avatar mkrufky avatar mrluit avatar mwbailey avatar nessdan avatar oojr avatar oskarszoon avatar petejkim avatar pyskell avatar rajivshah3 avatar skubakdj avatar tayvano avatar wbobeirne avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.