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

Vanir next #502

Draft
wants to merge 36 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
5a13f11
server/methods.js: set null as genesis does not define
59023g Nov 7, 2020
8db10c2
client/styles: sif gold
59023g Nov 7, 2020
81f2479
.meteor: update some versions
59023g Nov 7, 2020
c6f1db5
sif-testnet-settings.json
59023g Nov 7, 2020
6733a35
Update CHANGELOG.md
59023g Nov 11, 2020
8a7f427
Github Actions workflow
ilchebedelovski Nov 17, 2020
eabe8cf
Feature branch added as a trigger
ilchebedelovski Nov 19, 2020
47b4b02
develop branch as a trigger
ilchebedelovski Nov 19, 2020
239d816
Merge pull request #2 from Sifchain/feature/github-actions
ilchebedelovski Nov 23, 2020
381fc9d
Merge pull request #1 from Sifchain/develop
59023g Nov 23, 2020
3ead4a2
Merge commit 'ea65d22357ccff514707b' into 39.2
59023g Mar 18, 2021
2ced383
Updated release workflow.
Mar 18, 2021
e143dbd
Removed the slug actions.
Mar 18, 2021
0e1bf6a
Merge pull request #6 from Sifchain/feature/release
intl-man Mar 18, 2021
9284bfc
Merge pull request #4 from Sifchain/39.2
59023g Mar 19, 2021
21b04ba
Merge pull request #8 from Sifchain/master
59023g Mar 19, 2021
0af8271
Merge pull request #9 from Sifchain/develop
59023g Mar 19, 2021
ace39ba
ui/{Block, Transactions, TransactionTabs}: include clpTxs, pegTxs
59023g Mar 22, 2021
6e6719b
ui/{block,Transaction}Container: query mongo for more
59023g Mar 22, 2021
266da18
ui/{Activities,MsgType,Transaction,TransactionRow}: transaction display
59023g Mar 22, 2021
9b2b9fd
i18n/en-us: words
59023g Mar 22, 2021
eacd7b4
Workflow updates.
Apr 6, 2021
6022f1d
Merge pull request #11 from Sifchain/feature/workflow
intl-man Apr 6, 2021
24bfe8f
Release fixes.
Apr 6, 2021
ba1bd6e
Merge pull request #12 from Sifchain/bugfix/release
intl-man Apr 6, 2021
a8e3ca0
sifTxs, look
59023g Apr 6, 2021
0e9cc89
className, add missing tx query
59023g Apr 6, 2021
a7d4f46
Activities, Header: formatting, Show DEX URL
59023g Apr 6, 2021
397f2dc
Merge pull request #10 from Sifchain/sifTxs
59023g Apr 6, 2021
f69bbd5
api/transactions: get failed transactions
59023g Apr 6, 2021
8706b4a
Merge pull request #13 from Sifchain/master
59023g Apr 6, 2021
a845f3e
Merge pull request #16 from Sifchain/testnet
59023g Apr 6, 2021
fa775c9
Adds makefile and docker services for kafka and zookeeper poc
daechoi Apr 20, 2021
09eb513
Fixes the env setting to replay
daechoi Apr 20, 2021
2807caa
Adds kafka producer/consumer on block.update
daechoi May 4, 2021
81469dc
Updates the Kafka Consumer
daechoi May 12, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release

on:
release:
types: [published]

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Login to Docker Hub
run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}

- name: Inject slug/short variables
uses: rlespinasse/[email protected]

- name: Build docker image
run: |
docker build -t sifchain/block-explorer:${{ env.GITHUB_REF_SLUG }} .

- name: Push docker images
run: |
docker push sifchain/block-explorer:${{ env.GITHUB_REF_SLUG }}
5 changes: 5 additions & 0 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ jquery
universe:i18n
[email protected]
fourseven:scss
meteorhacks:npm


npm-container
meteorhacks:async
5 changes: 4 additions & 1 deletion .meteor/versions
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ ENV SCRIPTS_FOLDER /docker

RUN apk --no-cache add \
bash \
ca-certificates
ca-certificates \
curl \
jq

COPY --from=1 $SCRIPTS_FOLDER $SCRIPTS_FOLDER/

Expand Down
45 changes: 45 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
REVISION = $(shell git rev-parse HEAD)
export START_TIME:=$(shell date -u +%s)

FILE=settings.json

help:
@echo "help\t\tPrint this help"
@echo "build\t\tBuild Docker images"
@echo "up\t\tStart Docker containers defined in docker-compose.yml"
@echo "down\t\tStop Docker containers"
@echo "clean\t\tRemove dangling images and exited containers"
@echo "clean_volumes\tPrunes volumes and replay sifchain from the beginning"

elapsed_time:
@echo "$$(( `date -u +%s` - $(START_TIME) )) seconds elapsed"

build:
@docker-compose build
@make elapsed_time
@echo "All built 🏛"

up:
METEOR_SETTINGS=`cat $(FILE)` docker-compose up -d
@docker-compose logs --tail 10 -f

down:
@docker-compose stop

clean:
@echo "Deleting exited containers..."
@docker ps -a -q -f status=exited | xargs docker rm -v
@echo "Deleting dangling images..."
@docker images -q -f dangling=true | xargs docker rmi
@make elapsed_time
@echo "All clean 🛀"

clean_volumes:
@echo "Prune volumes (WARNING: includes your existing database volume if your containers are stopped)..."
@docker volume prune
@make elapsed_time
@echo "All clean 🛀"

shdb:
@docker exec -it $(docker ps | grep db | cut -d' ' -f1) /bin/bash

6 changes: 3 additions & 3 deletions both/document.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<head>
<meta charset="utf-8" />
<title>Big Dipper | Block Explorer by Forbole</title>
<title>Sifchain - Block Explorer</title>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Inconsolata&Red+Hat+Display:wght@500&display=swap" rel="stylesheet">
<link rel="shortcut icon" type="image/png" href="/img/big-dipper.png"/>
<link rel="apple-touch-icon" sizes="180x180" href="/img/big-dipper.png">
<link rel="shortcut icon" type="image/png" href="/img/sifchain.svg"/>
<link rel="apple-touch-icon" sizes="180x180" href="/img/sifchain.svg">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
4 changes: 3 additions & 1 deletion both/i18n/en-us.i18n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ common:
hash: 'Hash'
more: 'More'
fullStop: '.'
searchPlaceholder: 'Search with tx hash / block height / address'
searchPlaceholder: 'Search with Tx Hash / Block Height / Address'
cancel: 'Cancel'
retry: 'Retry'
rewards: 'Rewards'
Expand Down Expand Up @@ -143,6 +143,8 @@ transactions:
distribution: 'Distribution'
governance: 'Governance'
slashing: 'Slashing'
clp: "CLP"
peg: "Peg"
proposals:
notFound: 'No proposal found.'
listOfProposals: 'Here is a list of governance proposals.'
Expand Down
140 changes: 70 additions & 70 deletions both/utils/coins.js
Original file line number Diff line number Diff line change
@@ -1,85 +1,85 @@
import { Meteor } from 'meteor/meteor';
import numbro from 'numbro';
import { Meteor } from 'meteor/meteor'
import numbro from 'numbro'

autoformat = (value) => {
let formatter = '0,0.0000';
value = Math.round(value * 1000) / 1000
if (Math.round(value) === value)
formatter = '0,0'
else if (Math.round(value*10) === value*10)
formatter = '0,0.0'
else if (Math.round(value*100) === value*100)
formatter = '0,0.00'
else if (Math.round(value*1000) === value*1000)
formatter = '0,0.000'
return numbro(value).format(formatter)
let formatter = '0,0.0000'
value = Math.round(value * 1000) / 1000
if (Math.round(value) === value) formatter = '0,0'
else if (Math.round(value * 10) === value * 10) formatter = '0,0.0'
else if (Math.round(value * 100) === value * 100) formatter = '0,0.00'
else if (Math.round(value * 1000) === value * 1000) formatter = '0,0.000'
return numbro(value).format(formatter)
}

const coinList = Meteor.settings.public.coins;
const coinList = Meteor.settings.public.coins
for (let i in coinList) {
const coin = coinList[i];
if (!coin.displayNamePlural) {
coin.displayNamePlural = coin.displayName;
}
const coin = coinList[i]
if (!coin.displayNamePlural) {
coin.displayNamePlural = coin.displayName
}
}


export default class Coin {
static StakingCoin = coinList.find(coin => coin.denom === Meteor.settings.public.bondDenom);
static MinStake = 1 / Number(Coin.StakingCoin.fraction);
constructor(amount, denom=Meteor.settings.public.bondDenom) {
const lowerDenom = denom.toLowerCase();
this._coin = coinList.find(coin =>
coin.denom.toLowerCase() === lowerDenom || coin.displayName.toLowerCase() === lowerDenom
);
static StakingCoin = coinList.find((coin) => coin.denom === Meteor.settings.public.bondDenom)
static MinStake = 1 / Number(Coin.StakingCoin.fraction)

constructor(amount, denom = Meteor.settings.public.bondDenom) {
const lowerDenom = denom.toLowerCase()
this._coin = coinList.find(
(coin) => coin.denom.toLowerCase() === lowerDenom || coin.displayName.toLowerCase() === lowerDenom
)

if (this._coin){
if (lowerDenom === this._coin.denom.toLowerCase()) {
this._amount = Number(amount);
} else if (lowerDenom === this._coin.displayName.toLowerCase()) {
this._amount = Number(amount) * this._coin.fraction;
}
}
else {
this._coin = "";
this._amount = Number(amount);
}
}
if (this._coin) {
if (lowerDenom === this._coin.denom.toLowerCase()) {
this._amount = Number(amount)
} else if (lowerDenom === this._coin.displayName.toLowerCase()) {
this._amount = Number(amount) * this._coin.fraction
}
} else {
this._coin = ''
this._amount = Number(amount)
}
}

get amount () {
return this._amount;
}
get amount() {
return this._amount
}

get stakingAmount () {
return (this._coin)?this._amount / this._coin.fraction:this._amount;
}
get stakingAmount() {
return this._coin ? this._amount / this._coin.fraction : this._amount
}

toString (precision) {
// default to display in mint denom if it has more than 4 decimal places
let minStake = Coin.StakingCoin.fraction/(precision?Math.pow(10, precision):10000)
if (this.amount < minStake) {
return `${numbro(this.amount).format('0,0.0000' )} ${this._coin.denom}`;
} else {
return `${precision?numbro(this.stakingAmount).format('0,0.' + '0'.repeat(precision)):autoformat(this.stakingAmount)} ${this._coin.displayName}`
}
}
toString(precision) {
// default to display in mint denom if it has more than 4 decimal places
let minStake = Coin.StakingCoin.fraction / (precision ? Math.pow(10, precision) : 10000)
// console.log('minStake', this.amount, minStake)
if (this.amount < minStake) {
return `${numbro(this.amount).format('0,0.0000')} ${this._coin.denom}`
} else {
return `${
precision
? numbro(this.stakingAmount).format('0,0.' + '0'.repeat(precision))
: autoformat(this.stakingAmount)
} ${this._coin.displayName}`
}
}

mintString (formatter) {
let amount = this.amount
if (formatter) {
amount = numbro(amount).format(formatter)
}
mintString(formatter) {
let amount = this.amount
if (formatter) {
amount = numbro(amount).format(formatter)
}

let denom = (this._coin == "")?Coin.StakingCoin.displayName:this._coin.denom;
return `${amount} ${denom}`;
}
let denom = this._coin == '' ? Coin.StakingCoin.displayName : this._coin.denom
return `${amount} ${denom}`
}

stakeString(formatter) {
let amount = this.stakingAmount
if (formatter) {
amount = numbro(amount).format(formatter)
}
return `${amount} ${Coin.StakingCoin.displayName}`
}
}

stakeString (formatter) {
let amount = this.stakingAmount
if (formatter) {
amount = numbro(amount).format(formatter)
}
return `${amount} ${Coin.StakingCoin.displayName}`;
}
}
47 changes: 46 additions & 1 deletion client/styles.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,57 @@
$forbole-red: #bd081c;
$forbole-red: #CAA93A;
$primary: $forbole-red !default;

@import "materia/variables";
@import "bootstrap";
@import "materia/bootswatch";

@import url('https://fonts.googleapis.com/css2?family=PT+Serif:ital,wght@0,400;0,700;1,400&display=swap');

.nav-item { cursor: pointer }
.quick-note { font-weight: 900;
width: 100%;
border-top: 1px solid;
display: block;}

.card {
box-shadow: none;
border: 1px solid rgba(0,0,0,.5);
}

.navbar {
box-shadow: none;
}

.navbar-dark .navbar-nav .nav-link {
color: rgba(255, 255, 255, 1);
font-weight: 900;
}

#account > div:nth-child(2) > div > h3 > span > span > a {
color: white
}
#queryString {box-shadow: inset 0 -2px 0 #fff}
h1 { color: white }
#footer { display: none !important}

.bgw { background: white}

#validator-list > .card { border: none}
#validator-list > div.validator-list.row > div > div:nth-child(1) {}
#validator-list > div.bgw.mt15 > div > div > div{border: none}
.mt15 { margin-top: 15px}
.p15 { padding: 15px}

#main > div:nth-child(3) > div:nth-child(2) > div > div > div.col-md-8 > ul.nav-pills { background: white; padding: 15px}
#account > div:nth-child(2) > div > h3 > span > i { color: #343434 !important }
#account > div:nth-child(2) > div > h3 > span > span {overflow: hidden !important}


::placeholder { color: white !important; opacity: 1}
body {
font-size: inherit !important;
font-family: "PT Serif";
background: #caa93a;
}

.no-select {
Expand Down
Loading