Make sure you have setup your environment for React Native.
- Clone the repository
git clone git@github.com:marscoin/marskit.git && cd marskit
- Switch Node version
Switch to the Node.js version defined in .nvmrc
. If nvm
(or similiar) is installed on your system you can run nvm use
.
- Install dependencies
yarn install
yarn add react-native-permissions
- Setup iOS or Android dependencies
brew install cocoapods
pod install
yarn setup-ios
or
yarn setup-android
You may have to go into the nodes-assets folder and do a yarn install in there to get the missing node-modules folder
- Start the project
On iOS Simulator:
yarn ios
On Android Emulator:
yarn android
Marskit uses two types of testing: unit and end-to-end (E2E) tests.
Before running unit tests, you need to install Docker and run marscoind and the electrum server in regtest mode. You can do this by using the docker-compose.yml file from the tests directory:
cd __tests__
docker compose up
After that, you are ready to run the tests:
yarn test
End-to-end tests are powered by Detox. Currently, only the iOS Simulator is supported.
To build the tests:
yarn e2e:build:ios-release
To run them:
yarn e2e:test:ios-release
When running into issues there are a couple things to check.
- Clean caches & build folders:
yarn clean
- Clean simulator cache (iOS):
xcrun simctl erase all
- Increase emulated device storage (Android):
Android Studio -> Virtual Device Manager -> Edit Device -> Show Advanced Settings -> increase RAM, VM heap and Internal Storage sizes