From 6fceb30b730cfbd64268417b9ef2f0a2e8ce2aeb Mon Sep 17 00:00:00 2001
From: liangping <18786721@qq.com>
Date: Tue, 12 Apr 2022 17:52:14 +0800
Subject: [PATCH] show current version for state-sync
---
src/libs/fetch.js | 4 ++++
src/views/StateSync.vue | 28 ++++++----------------------
2 files changed, 10 insertions(+), 22 deletions(-)
diff --git a/src/libs/fetch.js b/src/libs/fetch.js
index 6c74a17c..4b6e965b 100644
--- a/src/libs/fetch.js
+++ b/src/libs/fetch.js
@@ -55,6 +55,10 @@ export default class ChainFetch {
return true
}
+ async getNodeInfo() {
+ return this.get('/node_info')
+ }
+
async getLatestBlock(config = null) {
const conf = config || this.getSelectedConfig()
if (conf.chain_name === 'injective') {
diff --git a/src/views/StateSync.vue b/src/views/StateSync.vue
index b6584c7d..a8276e35 100644
--- a/src/views/StateSync.vue
+++ b/src/views/StateSync.vue
@@ -17,7 +17,7 @@
WIP
- 1. Install Binary
+ 1. Install Binary ({{ version }})
We need to install the binary first and make sure that the version is the one currently in use on mainnet.
2. Enable State Sync
@@ -95,6 +95,7 @@ export default {
? `# Comma separated list of nodes to keep persistent connections to \npersistent_peers = "${peers}" `
: 'OMG! There is NO available providers, but you can try it.'
return {
+ version: '',
snapshot_provider,
servers,
providers,
@@ -112,27 +113,6 @@ snapshot-interval = 1000
snapshot-keep-recent = 2`,
}
},
- // computed: {
- // state: {
- // get() {
- // let servers = ''
- // const { rpc } = this.$store.state.chains.selected
- // if (rpc && Array.isArray(rpc)) {
- // servers = rpc.join(',')
- // }
- // return `[statesync]
- // enable = true
- // rpc_servers = "${servers}"
- // trust_height = ${this.height}
- // trust_hash = "${this.hash}"
- // trust_period = "168h" # 2/3 of unbonding time`
- // },
- // set(text) {
- // console.log(text)
- // // this.state = text
- // },
- // },
- // },
created() {
const interval = 1000
this.$http.getLatestBlock().then(l => {
@@ -150,6 +130,10 @@ trust_period = "168h" # 2/3 of unbonding time`
this.check()
})
}
+ this.$http.getNodeInfo().then(res => {
+ console.log(res)
+ this.version = res.application_version.version
+ })
})
},
methods: {