Welcome to Lunie.io!
👋 Welcome to Lunie. We're making staking accessible for everyone. This is the repo for the Lunie web app.
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 n to install the correct version. The following command will use n to install it alongside your current version of Node.js.
npm i -g n && n 10.13.0Yarn
Yarn is a JS package manager we use to manage Lunie's dependencies. Download it here.
Docker
To run a local tesnet for Lunie you will need Docker installed. You can download it here.
Docker compose
To build the SSL certificates needed by Lunie you also will need Docker Compose installed. You can find installation instructions for your platform here.
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:
- 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øsmosapplication (this can take a while). Note: You may have to enableDev Modein the Ledger Live Settings to be able to download theCøsmosapplication - Navigate to the
Cøsmosapp on your Ledger device
Check out Lunie
With Node, Yarn and Docker installed, you're ready to check out the source code:
git clone https://github.com/luniehq/lunie.git
cd lunie
yarn installLunie Development
Generate SSL certificates
First generate some SSL certificates and add them to your trusted certificates.
yarn certificatesRun local testnet
You can simply start a docker based testnet and the frontend.
yarn startThis will create a rich account. You need to import that account into Lunie:
- Sign In
- Import Account
- Use mnemonic:
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.
Deploy
Create the bundle to deploy Lunie you can run:
yarn buildIf you want to set a particular Stargate (Cosmos SDK REST API) or Tendermint's RPC endpoints:
STARGATE=<https://StargateAddress:port> RPC=<https://RPCAddress:port> yarn buildMobile
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:
$ yarn build
$ npx @capacitor/cli sync android
$ npx @capacitor/cli open androidiOS
Dependencies:
To open Lunie in Xcode:
- Build Lunie
$ yarn build- This step may take up to 20 minutes to complete if you've never used Cocoapods before.
$ npx @capacitor/cli sync ios- This will open Xcode with Lunie loaded
$ npx @capacitor/cli open iosOnce 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
yarn releaseTesting
If you would like to run all the tests you can run:~
yarn testUnit tests
Lunie uses Jest to run unit tests. You can run all the unit tests with the following command:
yarn test:unitFor a single test file (e.g. PageValidator.spec.js) run the unit tests like this to watch the tests whenever there are changes:
yarn watch PageValidatorEnd to end tests
If you want to run them locally first start a testnet:
MAX_NODES=4 yarn testnet:startThen run the tests:
yarn test:e2eTo run only some tests, provide a filter:
yarn test:e2e:serve
yarn test:e2e:local --filter send.spec.jsTo 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.
yarn test:e2e:serve
yarn test:e2e:browserstackFinally stop the testnet when you are done:
yarn testnet:stopCode coverage
To check test coverage locally run following. It will spin up a webserver and provide you with a link to the coverage report web page.
yarn test:coverageFlags
A list of all environment variables and their purpose:
| Variable | Values | default | Purpose |
|---|---|---|---|
NODE_ENV |
production, development |
||
CI |
true, false |
false |
Adds better structured output, makes a screenshot and adds logs to files (used on CircleCI). |
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. |
