Skip to content

Commit

Permalink
Initail Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Bharathcoorg committed Dec 13, 2023
1 parent b093947 commit d0327b8
Show file tree
Hide file tree
Showing 1,195 changed files with 65,858 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on:
push:
branches: ["main", "release-*"]
paths: ["backend/**"]
pull_request:
branches: ["main", "release-*"]
paths: ["backend/**"]

jobs:
ci:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
check-latest: true

- name: Run backend install
uses: borales/actions-yarn@v4
with:
cmd: install
dir: "backend" # will run `yarn install` in `backend` sub folder

- name: Run backend lint
uses: borales/actions-yarn@v4
with:
cmd: lint
dir: "backend"

- name: Run backend test
uses: borales/actions-yarn@v4
with:
cmd: test
dir: "backend"
69 changes: 69 additions & 0 deletions .github/workflows/site-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: site ci

on:
push:
branches:
- main
- "release-*"
paths:
- "site/**"
pull_request:
branches:
- main
- "release-*"
paths:
- "site/**"

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3

- name: setup node LTS
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: yarn
cache-dependency-path: |
site/yarn.lock
- name: install
uses: borales/actions-yarn@v4
with:
cmd: install
dir: site

- name: lint
uses: borales/actions-yarn@v4
with:
cmd: lint
dir: site

build:
runs-on: ubuntu-latest
needs: [lint]
steps:
- name: checkout
uses: actions/checkout@v3

- name: setup node LTS
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: yarn
cache-dependency-path: |
site/yarn.lock
- name: install
uses: borales/actions-yarn@v4
with:
cmd: install
dir: site

- name: build
uses: borales/actions-yarn@v4
with:
cmd: build
dir: site
118 changes: 118 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Logs
log
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
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
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

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
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

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

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

# Next.js build output
.next

# Nuxt.js build / generate 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

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

.idea
*.deploy.sh
.DS_Store

# yarn
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx pretty-quick --staged
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules

# Ignore artifacts:
build
coverage
3 changes: 3 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require("@2nthony/prettier-config"),
};
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"search.exclude": {
"site/build/**": true
}
}
874 changes: 874 additions & 0 deletions .yarn/releases/yarn-3.6.0.cjs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.6.0.cjs
61 changes: 61 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Changelog

All notable changes to this project will be documented in this file.

## 1.2.0

date: 2023-12-04

- [Big]Support multisig.
- Correct dotreasury api and site url.
- Update dependencies.

## 1.1.4

date: 2023-11-06

- Support simple mode in which we don't save block data and unnecessary extrinsic and event data to database.
- Remove extrinsic result and para chain inclusion event from event list page.

## 1.1.3

date: 2023-10-27

- Fix dropdown components filter on extrinsic/events list page.
- Fix NFT small logo style.
- Save multisig signatories info when scan multisigs.
- Fix statemine endpoint.
- Fix styles.

## 1.1.2

date: 2023-09-21

- [Big] Add `multisig-scan` package to support multisig pallet business scan.
- Support query extrinsic/event data from RPC node.
- Add USDC asset info on statemint.
- Fix the issue that home page subscribed info is updated too frequently.

## 1.1.1

date: 2023-09-12

- Support on-chain data querying for account details.
- Turn on on-chain data query for more chains.
- Show 404 for invalid block and account.

## 1.1.0

date: 2023-09-11

- [Big] Support identity business.
- Introduce RPC nodes and support querying block data from selected node.
- Add vesting-scan package.
- Upgrade dependencies and fix styles.

## 1.0.1

date: 02/14/2023

- Support westend and polkadot collectives para-chain.
- Style fix: home page singed transfers list layout.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# statescan-v2
Statescan is a modularized and business pluggable explorer for [substrate](https://github.com/paritytech/substrate) based chains.

## Code structure

There are 2 directories for [backend](./backend) and fronted code. Backend code is organized by [yarn workspaces](https://classic.yarnpkg.com/lang/en/docs/workspaces/) and make
sure yarn is installed before running it.
12 changes: 12 additions & 0 deletions backend/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
env: {
commonjs: true,
es2021: true,
node: true,
},
extends: "eslint:recommended",
parserOptions: {
ecmaVersion: "latest",
},
rules: {},
};
9 changes: 9 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# yarn
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

874 changes: 874 additions & 0 deletions backend/.yarn/releases/yarn-3.6.0.cjs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions backend/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarnPath: .yarn/releases/yarn-3.6.0.cjs
1 change: 1 addition & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# statescan backend packages
28 changes: 28 additions & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "backend",
"license": "Apache-2.0",
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"lint": "yarn lint:common && yarn lint:mongo && yarn lint:server && yarn lint:block-scan && yarn lint:runtime-scan && yarn lint:account-scan && yarn lint:asset-scan && yarn lint:uniques-scan",
"test": "yarn test:asset-scan && yarn test:uniques-scan && yarn test:account-scan",
"lint:common": "yarn workspace @statescan/common lint",
"lint:mongo": "yarn workspace @statescan/mongo lint",
"lint:server": "yarn workspace @statescan/server lint",
"lint:block-scan": "yarn workspace @statescan/block-scan lint",
"lint:runtime-scan": "yarn workspace @statescan/runtime-scan lint",
"lint:account-scan": "yarn workspace @statescan/account-scan lint",
"lint:asset-scan": "yarn workspace @statescan/asset-scan lint",
"lint:uniques-scan": "yarn workspace @statescan/uniques-scan lint",
"test:asset-scan": "yarn workspace @statescan/account-scan test",
"test:uniques-scan": "yarn workspace @statescan/uniques-scan test",
"test:account-scan": "yarn workspace @statescan/account-scan test",
"test:identity-scan": "yarn workspace @statescan/identity-scan test"
},
"devDependencies": {
"eslint": "^8.31.0"
},
"packageManager": "yarn@3.6.0"
}
14 changes: 14 additions & 0 deletions backend/packages/account-scan/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
WS_ENDPOINT=wss://kabocha.jelliedowl.net
CHAIN=kabocha

MONGO_ACCOUNT_SCAN_URL=mongodb://127.0.0.1:27017
MONGO_ACCOUNT_SCAN_NAME=statescan-kabocha-account

SCAN_STEP=1

USE_META=1
MONGO_META_URL=mongodb://127.0.0.1:27017
MONGO_DB_META_NAME=meta-kabocha

LOG_LEVEL=info
NODE_ENV=production
3 changes: 3 additions & 0 deletions backend/packages/account-scan/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# account-scan

This package update the latest balance info by scanning the history blocks and save them to MongoDB.
Loading

0 comments on commit d0327b8

Please sign in to comment.