Skip to content

Commit

Permalink
Merge pull request #331 from etclabscore/upcoming-fork-status-page
Browse files Browse the repository at this point in the history
Upcoming fork status page
  • Loading branch information
ziogaschr committed Dec 5, 2023
2 parents 6120203 + d75896f commit a506da3
Show file tree
Hide file tree
Showing 33 changed files with 7,444 additions and 5,312 deletions.
17 changes: 8 additions & 9 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@ module.exports = {
root: true,
env: {
browser: true,
'jest/globals': true,
node: true,
},
parserOptions: {
parser: 'babel-eslint',
parser: '@babel/eslint-parser',
requireConfigFile: false,
},
extends: [
'@nuxtjs',
'prettier',
'plugin:prettier/recommended',
'plugin:nuxt/recommended',
],
plugins: ['prettier'],
extends: ['@nuxtjs', 'plugin:nuxt/recommended', 'prettier'],
plugins: ['jest'],
// add your custom rules here
rules: {},
rules: {
'vue/multi-word-component-names': 'off',
},
}
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node: [14]
node: [18]

steps:
- name: Checkout 🛎
Expand Down
10 changes: 10 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
**/.git
**/.github
**/.svn
**/.hg
**/node_modules
**/.nuxt

**/assets
**/content
**/dist
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,57 @@ $ yarn start

# generate static project
$ yarn generate

# deploy to github pages
$ yarn deploy
```

For detailed explanation on how things work, check out [Nuxt.js docs](https://nuxtjs.org).

## Special Directories

You can create the following extra directories, some of which have special behaviors. Only `pages` is required; you can delete them if you don't want to use their functionality.

### `assets`

The assets directory contains your uncompiled assets such as Stylus or Sass files, images, or fonts.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/assets).

### `components`

The components directory contains your Vue.js components. Components make up the different parts of your page and can be reused and imported into your pages, layouts and even other components.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/components).

### `layouts`

Layouts are a great help when you want to change the look and feel of your Nuxt app, whether you want to include a sidebar or have distinct layouts for mobile and desktop.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/layouts).

### `pages`

This directory contains your application views and routes. Nuxt will read all the `*.vue` files inside this directory and setup Vue Router automatically.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/get-started/routing).

### `plugins`

The plugins directory contains JavaScript plugins that you want to run before instantiating the root Vue.js Application. This is the place to add Vue plugins and to inject functions or constants. Every time you need to use `Vue.use()`, you should create a file in `plugins/` and add its path to plugins in `nuxt.config.js`.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/plugins).

### `static`

This directory contains your static files. Each file inside this directory is mapped to `/`.

Example: `/static/robots.txt` is mapped as `/robots.txt`.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/static).

### `store`

This directory contains your Vuex store files. Creating a file in this directory automatically activates Vuex.

More information about the usage of this directory in [the documentation](https://nuxtjs.org/docs/2.x/directory-structure/store).
6 changes: 4 additions & 2 deletions assets/forks.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"0x9007bfcc": "Phoenix",
"0xdb63a1ca": "Thanos",
"0x0f6bf187": "Magneto",
"0x7fd1bb25": "Mystique"
"0x7fd1bb25": "Mystique",
"0x0121eac0": "Spiral"
},
"block": {
"0": "-",
Expand All @@ -25,6 +26,7 @@
"10500839": "Phoenix",
"11700000": "Thanos",
"13189133": "Magneto",
"14525000": "Mystique"
"14525000": "Mystique",
"19000000": "Spiral"
}
}
36 changes: 36 additions & 0 deletions components/ForkClientUpgraded.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<template>
<table-chart-card
:title="$t('upcomingForkCard.title')"
:table="nodes.clientsForkAdoption.table"
:labels="nodes.clientsForkAdoption.chart.labels"
:series="nodes.clientsForkAdoption.chart.series"
:total="totalNodes"
:no-label-text="$t('nodes.none')"
:colors="['#00E396', '#FD6A6A']"
icon="mdi-directions-fork"
class="mr-1 mb-1"
style="margin-left: 6px"
/>
</template>

<script>
import TableChartCard from '~/components/TableChartCard.vue'
export default {
name: 'ForkClientUpgraded',
components: {
TableChartCard,
},
props: {
nodes: {
type: Object,
required: true,
},
},
computed: {
totalNodes() {
return this.nodes.raw.length
},
},
}
</script>
124 changes: 124 additions & 0 deletions components/ForkCountdownCard.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<template>
<v-sheet class="pa-5 mx-1 mr-1 mb-1">
<h1 class="mb-3">ETC {{ nextFork.name }} Upgrade Countdown</h1>

<p>
The <a :href="nextFork.ecip">{{ nextFork.name }} Hardfork</a>
{{ isForked ? 'occurred' : 'will occur' }} at block
<strong>{{ nextFork.blockNumber }}</strong
>.
</p>

<v-skeleton-loader
v-if="latestBlockNumber === 0"
type="list-item-two-line"
></v-skeleton-loader>
<p v-else-if="isForked">
🎉 🎉 Booyah! {{ numberOfBlocksAfterHardFork }} blocks and counting in the
{{ nextFork.name }} era. 🎉 🎉
</p>
<div v-else>
<p>
The <strong>current block number</strong> is
<strong>
<a
:href="`https://etc.blockscout.com/block/${latestBlockNumber}?tab=txs`"
>{{ latestBlockNumber }}</a
> </strong
>, leaving <strong>{{ numberOfBlocksTillHardFork }}</strong> blocks.
</p>

<p>
Assuming a <strong>{{ secondsPerBlock }}</strong> second block interval,
the fork is estimated to be
<strong
>{{
$dateFns.formatDistance(forkAt, new Date(), { addSuffix: true })
}}
from now</strong
>, at:
</p>

<ul class="mb-3">
<li>
Local ({{ $dateFns.format(forkAt, 'XXXXX') }}):
{{ $dateFns.format(forkAt, 'iiii, PPPp') }}
</li>
<li>Universal (UTC): {{ $dateFns.format(forkAtUTC, 'iiii, PPPp') }}</li>
</ul>

<v-divider></v-divider>

<p class="mt-3">
We will soon update here with the client versions that support the
{{ nextFork.name }} hardfork.
</p>

<!-- <p class="mt-3">
To prepare for this fork, please upgrade Ethereum Classic client
programs to equal to or better than the following versions.
</p>
<ul>
<li>
<a href="https://github.com/etclabscore/core-geth/releases/tag/v1.12.17"
>core-geth v1.12.17</a
>
</li>
<li>
<a href="https://github.com/hyperledger/besu/releases/tag/23.10.3"
>besu v23.10.3</a
>
</li>
</ul>
<p>
You can also better monitor the fork transition at the
<a href="https://fork-monitor.etc-network.info/" target="_blank"
>Fork Monitor</a
>.
</p> -->
</div>
</v-sheet>
</template>

<script>
export default {
name: 'ForkCountdownCard',
props: {
latestBlockNumber: {
type: Number,
required: true,
},
},
computed: {
nextFork() {
return this.$store.state.params.hardfork
},
secondsPerBlock() {
return this.nextFork.secondsPerBlock
},
isForked() {
return this.latestBlockNumber >= this.nextFork.blockNumber
},
numberOfBlocksTillHardFork() {
return this.nextFork.blockNumber - this.latestBlockNumber
},
numberOfBlocksAfterHardFork() {
return this.latestBlockNumber - this.nextFork.blockNumber
},
forkAt() {
const timeDifference =
(this.nextFork.blockNumber - this.latestBlockNumber) *
this.secondsPerBlock
return this.$dateFns.add(new Date(), { seconds: timeDifference })
},
forkAtUTC() {
return this.$dateFns.addMinutes(
this.forkAt,
this.forkAt.getTimezoneOffset()
)
},
},
}
</script>
Loading

0 comments on commit a506da3

Please sign in to comment.