|
1 | | -# lunie-ng |
2 | | -Lunie Next Generation |
| 1 | +# Lunie Light (Beta) |
| 2 | + |
| 3 | +Hello! 👋 Welcome to the Lunie Light Beta repo. |
| 4 | + |
| 5 | +Lunie Light is a staking interface for proof-of-stake blockchains in the Cosmos ecosystem — built for speed, simplicity, and ease-of-use. |
| 6 | + |
| 7 | +Lunie Light uses [Nuxt.js](https://nuxtjs.org), and relies on the [REST API](https://cosmos.network/rpc) of a [Cosmos node](https://docs.cosmos.network/master/interfaces/rest.html) for data. |
| 8 | + |
| 9 | +Lunie Light will work with the Keplr Browser Extension and the Ledger Nano. Local key management should only be used for testing and development purposes. |
| 10 | + |
| 11 | +Features: |
| 12 | + |
| 13 | +- ✅ Super simple — one config file |
| 14 | +- 🏎 Fast, modern web technologies |
| 15 | +- 📱 Fully responsive |
| 16 | +- ⛓ Real-time on-chain data |
| 17 | +- 🔭 Explore mode |
| 18 | +- 💸 Multi-denom balances support |
| 19 | +- 🥩 Staking and unstaking management |
| 20 | +- 💯 Complete validator list with instant search |
| 21 | +- 🤗 Validator profiles for every validator |
| 22 | +- 🧾 Transaction history |
| 23 | + |
| 24 | +## Getting started |
| 25 | + |
| 26 | +1. Edit the `networks.js` config file with the relevant details for your project |
| 27 | +2. Run `yarn install` to install the app dependencies |
| 28 | +3. Run `yarn dev` to serve the app at `localhost:3000` |
| 29 | + |
| 30 | +### CORS |
| 31 | + |
| 32 | +If the node you want to connect to doesn't have CORS enabled, you can't use it with the application. In this case use a CORS proxy (only in development) i.e. https://cors-anywhere.herokuapp.com/. |
| 33 | + |
| 34 | +## How on-chain data works |
| 35 | + |
| 36 | +On-chain data is managed using the [Vuex store](https://nuxtjs.org/docs/2.x/directory-structure/store/). Understanding how [Vuex](https://vuex.vuejs.org/) works will be helpful for manipulating data in Lunie Light. |
| 37 | + |
| 38 | +### How data flows through Lunie Light |
| 39 | + |
| 40 | +1. Middleware in the [`default.vue`](https://github.com/luniehq/lunie-light/blob/master/layouts/default.vue) file will call [`data/init`](https://github.com/luniehq/lunie-light/blob/master/layouts/default.vue#L24) to initialize the connection the Cosmos REST API before any pages are rendered. If the API is not initialized, requests will fail and data will not flow 🏄♂️ |
| 41 | +2. [Mutations](https://vuex.vuejs.org/guide/mutations.html) and [Actions](https://vuex.vuejs.org/guide/actions.html) are stored in the [`data.js`](https://github.com/luniehq/lunie-light/blob/master/store/data.js) file which manages the Vuex store and API requests |
| 42 | +3. Actions in [`data.js`](https://github.com/luniehq/lunie-light/blob/master/store/data.js) will call query functions in the [`cosmos-source.js`](https://github.com/luniehq/lunie-light/blob/master/common/cosmosV3-source.js) file. |
| 43 | +4. Reducers in [`cosmos-reducers.js`](https://github.com/luniehq/lunie-light/blob/master/common/cosmosV3-reducers.js) parse the responses from the API into a format that is easy for frontend Vue components to understand and work with |
| 44 | + |
| 45 | +### Customizing for your chain |
| 46 | + |
| 47 | +Lunie Light will work out of the box with Cosmos-SDK v0.40 assuming there are no missing modules or modifications. |
| 48 | + |
| 49 | +Check the [`/apis`](https://github.com/luniehq/lunie-light/tree/master/apis) folder for the files responsible for mapping chain data to the Lunie frontend. There are deprecated Cosmos-SDK v0.39 files there for your convenience. |
| 50 | + |
| 51 | +It is recommended that you manually go through the UI and check which requests are throwing errors. You should also manually test all functions and actions to make sure everything works as expected on your chain. |
| 52 | + |
| 53 | +_If your chain is missing modules or you have changed the Cosmos data model you will have to update the source and reducer files to accomodate these changes._ |
| 54 | + |
| 55 | +## How to deploy |
| 56 | + |
| 57 | +On Netlify: |
| 58 | + |
| 59 | +1. Add your forked 🍴 repo |
| 60 | +2. Go to "Site Settings" > "Build & Deploy" > "Edit Settings" |
| 61 | +3. Set the build command to `yarn generate` |
| 62 | +4. Set the publish directory to `dist` |
| 63 | + |
| 64 | +[](https://app.netlify.com/start) |
| 65 | + |
| 66 | + |
| 67 | +## Thank you kindly! |
0 commit comments