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

Commit 3e684d1

Browse files
committed
Initial commit
1 parent 8c06dfa commit 3e684d1

File tree

149 files changed

+25260
-34
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+25260
-34
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.eslintrc.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
node: true,
6+
},
7+
parserOptions: {
8+
parser: 'babel-eslint',
9+
},
10+
extends: [
11+
'@nuxtjs',
12+
'prettier',
13+
'prettier/vue',
14+
'plugin:prettier/recommended',
15+
'plugin:nuxt/recommended',
16+
],
17+
plugins: ['prettier'],
18+
// add your custom rules here
19+
rules: {
20+
'no-console': 0,
21+
'vue/comment-directive': 0,
22+
'vue/no-mutating-props': 0,
23+
'vue/custom-event-name-casing': 0,
24+
},
25+
}

.github/dependabot.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
version: 2
2+
updates:
3+
# Fetch and update latest `npm` packages
4+
- package-ecosystem: npm
5+
directory: '/'
6+
schedule:
7+
interval: daily
8+
time: '00:00'
9+
open-pull-requests-limit: 10
10+
reviewers:
11+
- lukitsbrian
12+
assignees:
13+
- lukitsbrian
14+
commit-message:
15+
prefix: fix
16+
prefix-development: chore
17+
include: scope
18+
# Fetch and update latest `github-actions` pkgs
19+
- package-ecosystem: github-actions
20+
directory: '/'
21+
schedule:
22+
interval: daily
23+
time: '00:00'
24+
open-pull-requests-limit: 10
25+
reviewers:
26+
- lukitsbrian
27+
assignees:
28+
- lukitsbrian
29+
commit-message:
30+
prefix: fix
31+
prefix-development: chore
32+
include: scope

.github/workflows/ci.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
pull_request:
9+
branches:
10+
- main
11+
- master
12+
13+
jobs:
14+
ci:
15+
runs-on: ${{ matrix.os }}
16+
17+
strategy:
18+
matrix:
19+
os: [ubuntu-latest]
20+
node: [14]
21+
22+
steps:
23+
- name: Checkout 🛎
24+
uses: actions/checkout@master
25+
26+
- name: Setup node env 🏗
27+
uses: actions/setup-node@v2.1.2
28+
with:
29+
node-version: ${{ matrix.node }}
30+
31+
- name: Get yarn cache directory path 🛠
32+
id: yarn-cache-dir-path
33+
run: echo "::set-output name=dir::$(yarn cache dir)"
34+
35+
- name: Cache node_modules 📦
36+
uses: actions/cache@v2
37+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
38+
with:
39+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
40+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
41+
restore-keys: |
42+
${{ runner.os }}-yarn-
43+
44+
- name: Install dependencies 👨🏻‍💻
45+
run: yarn
46+
47+
- name: Run linter 👀
48+
run: yarn lint
49+
50+
# - name: Run tests 🧪
51+
# run: yarn test

.gitignore

Lines changed: 18 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### Node template
13
# Logs
2-
logs
4+
/logs
35
*.log
46
npm-debug.log*
57
yarn-debug.log*
68
yarn-error.log*
7-
lerna-debug.log*
8-
9-
# Diagnostic reports (https://nodejs.org/api/report.html)
10-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
119

1210
# Runtime data
1311
pids
@@ -20,12 +18,11 @@ lib-cov
2018

2119
# Coverage directory used by tools like istanbul
2220
coverage
23-
*.lcov
2421

2522
# nyc test coverage
2623
.nyc_output
2724

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

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

47-
# TypeScript cache
48-
*.tsbuildinfo
49-
5044
# Optional npm cache directory
5145
.npm
5246

5347
# Optional eslint cache
5448
.eslintcache
5549

56-
# Microbundle cache
57-
.rpt2_cache/
58-
.rts2_cache_cjs/
59-
.rts2_cache_es/
60-
.rts2_cache_umd/
61-
6250
# Optional REPL history
6351
.node_repl_history
6452

@@ -70,35 +58,33 @@ typings/
7058

7159
# dotenv environment variables file
7260
.env
73-
.env.test
7461

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

78-
# Next.js build output
65+
# next.js build output
7966
.next
8067

81-
# Nuxt.js build / generate output
68+
# nuxt.js build output
8269
.nuxt
83-
dist
8470

85-
# Gatsby files
86-
.cache/
87-
# Comment in the public line in if your project uses Gatsby and *not* Next.js
88-
# https://nextjs.org/blog/next-9-1#public-directory-support
89-
# public
71+
# Nuxt generate
72+
dist
9073

9174
# vuepress build output
9275
.vuepress/dist
9376

9477
# Serverless directories
95-
.serverless/
78+
.serverless
79+
80+
# IDE / Editor
81+
.idea
9682

97-
# FuseBox cache
98-
.fusebox/
83+
# Service worker
84+
sw.*
9985

100-
# DynamoDB Local files
101-
.dynamodb/
86+
# macOS
87+
.DS_Store
10288

103-
# TernJS port file
104-
.tern-port
89+
# Vim swap files
90+
*.swp

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"semi": false,
3+
"singleQuote": true
4+
}

README.md

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,67 @@
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+
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start)
65+
66+
67+
## Thank you kindly!

0 commit comments

Comments
 (0)