Welcome to Lunie.io!
👋 Welcome to Lunie. We're making staking accessible for everyone. This is the repo for the Lunie web and mobile apps.
Install the following dependencies if you wish to run lunie on developer mode or contribute.
Lunie requires Node.js >=10.13.0
. If you have a different version of Node.js installed, you can use nvm to install the correct version. Now to install the Node.js version run:
nvm install 10.*
IMPORTANT: Only use Ledger devices that you bought factory new or trust fully.
Lunie supports sending transactions through the Cosmos
app for Ledger Nano hardware wallet. To install the Cøsmos
app on your device you'll have to:
- Download the Ledger Live app here
- Connect your Ledger via USB and update to the latest firmware
- Go to the Ledger Live App Store, and download the
Cøsmos
application (this can take a while). Note: You may have to enableDev Mode
in the Ledger Live Settings to be able to download theCøsmos
application - Navigate to the
Cøsmos
app on your Ledger device
With Node installed, you're ready to check out the source code. Afterwards install the dependencies for this repository:
git clone https://github.com/luniehq/lunie.git
cd lunie
npm install
You can simply start the frontend:
npm run serve
ATTENTION: Lunie requires a backend. This is currently not yet public.
To run a local testnet for Lunie you will need Docker and Docker Compose installed. You can find instructions to install Docker here. You can find instructions to install Docker-Compose here.
git clone https://github.com/luniehq/lunie-backend.git
cd lunie-backend
npm run start
Lunie is automatically connecting to the backend at http://localhost:4000
. If not set the according environment variable VUE_APP_GRAPHQL_URL
.
The testnet will contain a rich account that you can use to see balances and make transactions. You need to import that account into Lunie:
- Sign In
- Use an existing account
- Recover with backup code
Now enter the backup code and create the account. Backup code: release endorse scale across absurd trouble climb unaware actor elite fantasy chair license word rare length business kiss smoke tackle report february bid ginger
You should now have a bunch of stake to play with.
All code needs to conform to our linting rules. This will be tested in our continuous integration.
To test if your code conforms to the rules run:
npm run lint
To fix linting errors automatically (as long as this is possible) run:
npm run lint -- --fix
Create the bundle to deploy Lunie you can run:
npm run build
Dependencies:
- Android Studio
- Gradle updated to 5.1.1 (Android Studio > File > Project Structure)
You will probably also want a virtual Android device which you can create from inside the Android Studio.
To run the Android version of Lunie in development:
$ npm run build:mobile
$ npx cap sync android
$ npx cap open android
Dependencies:
To open Lunie in Xcode:
- Build Lunie
$ npm run build
- This step may take up to 20 minutes to complete if you've never used Cocoapods before.
$ npx cap sync ios
- This will open Xcode with Lunie loaded
$ npx cap open ios
Once Xcode is open, just click the Play button to run Lunie on your preferred Simulator or Device.
Lunie has a automated release process. Every night the CI creates a new release PR. To release manually, run
npm run release
If you would like to run all the tests you can run:~
npm run test
Lunie uses Jest to run unit tests. You can run all the unit tests with the following command:
npm run test:unit
For a single test file (e.g. PageValidator.spec.js
) run the unit tests like this:
npm run test:unit PageValidator
To check test coverage locally run following after having run unit tests. It will spin up a webserver and provide you with a link to the coverage report web page.
npm run test:coverage
Then run the tests:
npm run test:e2e
To run only some tests, provide the name of the e2e test file you want to run (i.e. for send.spec.js
):
npm run test:e2e send
To run the e2e tests on multiple browsers use Browserstack. You must set the environment variables BROWSERSTACK_USERNAME
and BROWSERSTACK_ACCESS_KEY
aquired from Browserstack first.
Then start the backend up locally followed by running the frontend in production mode and finally start the tests:
// start the backend
npm run test:e2e:serve
npm run test:e2e:browserstack
Finally stop the testnet when you are done.
A list of all environment variables and their purpose:
Variable | Values | default | Purpose |
---|---|---|---|
NODE_ENV |
production , development |
||
ALLOW_CONSOLE |
true , false |
false |
Unit tests fail if they use console.error or console.warn . To see the initial use/occurences of those callings, you can escape this behavior using this flag. |
VUE_APP_GRAPHQL_URL |
http://localhost:4000 |
URL of the Lunie Backend GraphQL API. | |
VUE_APP_E2E |
true , false |
false |
Switches Lunie to run/build in e2e test mode. Disables some tracking. |
GOOGLE_ANALYTICS_UID |
Google Analytics UID to be used in production builds. | ||
MOBILE_APP |
true , false |
false |
Build for mobile. Handles some interactions differently. |