Skip to content

Lunie is making staking accessible for everyone ✨

License

Notifications You must be signed in to change notification settings

cosmos-gaminghub/lunie

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lunie logo — right half circle with dotted left circle

Welcome to Lunie.io!

CircleCI codecov Maintainability

👋 Welcome to Lunie. We're making staking accessible for everyone. This is the repo for the Lunie web and mobile apps.

Development Dependencies

Install the following dependencies if you wish to run lunie on developer mode or contribute.

Node

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.*

Ledger Cosmos App

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:

  1. Download the Ledger Live app here
  2. Connect your Ledger via USB and update to the latest firmware
  3. Go to the Ledger Live App Store, and download the Cøsmos application (this can take a while). Note: You may have to enable Dev Mode in the Ledger Live Settings to be able to download the Cøsmos application
  4. Navigate to the Cøsmos app on your Ledger device

Check out Lunie

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

Lunie Development

Start

You can simply start the frontend:

npm run serve

ATTENTION: Lunie requires a backend. This is currently not yet public.

Run local testnet

Docker

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.

Backend

git clone https://github.com/luniehq/lunie-backend.git
cd lunie-backend
npm run start

Use the local testnet

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.

Code Conventions / Coding Style

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

Deploy

Create the bundle to deploy Lunie you can run:

npm run build

Mobile

Android

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

iOS

Dependencies:

To open Lunie in Xcode:

  1. Build Lunie
$ npm run build
  1. This step may take up to 20 minutes to complete if you've never used Cocoapods before.
$ npx cap sync ios
  1. 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.

Release

Lunie has a automated release process. Every night the CI creates a new release PR. To release manually, run

npm run release

Testing

If you would like to run all the tests you can run:~ 

npm run test

Unit tests

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

Code coverage

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

End to end tests

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.

Flags

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.

Thanks

Browserstack

About

Lunie is making staking accessible for everyone ✨

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 48.7%
  • Vue 47.7%
  • CSS 1.6%
  • Shell 0.8%
  • HTML 0.5%
  • Swift 0.4%
  • Other 0.3%