Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lukitsbrian committed Apr 1, 2021
1 parent 8c06dfa commit 3e684d1
Show file tree
Hide file tree
Showing 149 changed files with 25,260 additions and 34 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
25 changes: 25 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
root: true,
env: {
browser: true,
node: true,
},
parserOptions: {
parser: 'babel-eslint',
},
extends: [
'@nuxtjs',
'prettier',
'prettier/vue',
'plugin:prettier/recommended',
'plugin:nuxt/recommended',
],
plugins: ['prettier'],
// add your custom rules here
rules: {
'no-console': 0,
'vue/comment-directive': 0,
'vue/no-mutating-props': 0,
'vue/custom-event-name-casing': 0,
},
}
32 changes: 32 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: 2
updates:
# Fetch and update latest `npm` packages
- package-ecosystem: npm
directory: '/'
schedule:
interval: daily
time: '00:00'
open-pull-requests-limit: 10
reviewers:
- lukitsbrian
assignees:
- lukitsbrian
commit-message:
prefix: fix
prefix-development: chore
include: scope
# Fetch and update latest `github-actions` pkgs
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: daily
time: '00:00'
open-pull-requests-limit: 10
reviewers:
- lukitsbrian
assignees:
- lukitsbrian
commit-message:
prefix: fix
prefix-development: chore
include: scope
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: ci

on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master

jobs:
ci:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [14]

steps:
- name: Checkout πŸ›Ž
uses: actions/checkout@master

- name: Setup node env πŸ—
uses: actions/[email protected]
with:
node-version: ${{ matrix.node }}

- name: Get yarn cache directory path πŸ› 
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache node_modules πŸ“¦
uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies πŸ‘¨πŸ»β€πŸ’»
run: yarn

- name: Run linter πŸ‘€
run: yarn lint

# - name: Run tests πŸ§ͺ
# run: yarn test
50 changes: 18 additions & 32 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# Created by .ignore support plugin (hsz.mobi)
### Node template
# Logs
logs
/logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
Expand All @@ -20,12 +18,11 @@ lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
Expand All @@ -44,21 +41,12 @@ jspm_packages/
# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

Expand All @@ -70,35 +58,33 @@ typings/

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
# next.js build output
.next

# Nuxt.js build / generate output
# nuxt.js build output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# Nuxt generate
dist

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/
.serverless

# IDE / Editor
.idea

# FuseBox cache
.fusebox/
# Service worker
sw.*

# DynamoDB Local files
.dynamodb/
# macOS
.DS_Store

# TernJS port file
.tern-port
# Vim swap files
*.swp
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"semi": false,
"singleQuote": true
}
69 changes: 67 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,67 @@
# lunie-ng
Lunie Next Generation
# Lunie Light (Beta)

Hello! πŸ‘‹ Welcome to the Lunie Light Beta repo.

Lunie Light is a staking interface for proof-of-stake blockchains in the Cosmos ecosystem β€” built for speed, simplicity, and ease-of-use.

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.

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.

Features:

- βœ… Super simple β€” one config file
- 🏎 Fast, modern web technologies
- πŸ“± Fully responsive
- β›“ Real-time on-chain data
- πŸ”­ Explore mode
- πŸ’Έ Multi-denom balances support
- πŸ₯© Staking and unstaking management
- πŸ’― Complete validator list with instant search
- πŸ€— Validator profiles for every validator
- 🧾 Transaction history

## Getting started

1. Edit the `networks.js` config file with the relevant details for your project
2. Run `yarn install` to install the app dependencies
3. Run `yarn dev` to serve the app at `localhost:3000`

### CORS

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

## How on-chain data works

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.

### How data flows through Lunie Light

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 πŸ„β€β™‚οΈ
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
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.
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

### Customizing for your chain

Lunie Light will work out of the box with Cosmos-SDK v0.40 assuming there are no missing modules or modifications.

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.

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.

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

## How to deploy

On Netlify:

1. Add your forked 🍴 repo
2. Go to "Site Settings" > "Build & Deploy" > "Edit Settings"
3. Set the build command to `yarn generate`
4. Set the publish directory to `dist`

[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start)


## Thank you kindly!
Loading

0 comments on commit 3e684d1

Please sign in to comment.