diff --git a/src/modules/[chain]/statesync/index.vue b/src/modules/[chain]/statesync/index.vue index aa397c84..57bd932e 100644 --- a/src/modules/[chain]/statesync/index.vue +++ b/src/modules/[chain]/statesync/index.vue @@ -19,17 +19,10 @@ if(height.value > 2000) { hash.value = toHex(fromBase64(res.block_id.hash)).toUpperCase() }) } -const state = computed(() => { - const rpcs = blockchain.current?.endpoints?.rpc +const rpcs = computed(() => { + return blockchain.current?.endpoints?.rpc ?.map((x) => x.address) .join(','); - return `[statesync] -enable = true -rpc_servers = "${rpcs}" -trust_height = ${height.value || 'loading'} -trust_hash = "${hash.value}" -trust_period = "168h" # 2/3 of unbonding time" -`; }); const appName = computed(() => { @@ -77,7 +70,17 @@ onMounted(() => { We can configure Tendermint to use state sync in $DAEMON_HOME/config/config.toml.

- +
+
[state-sync]
+
enable = true
+
+
rpc_servers = "{{ rpcs }}"
+
trust_height = {{ height }} 
+
trust_hash = "{{hash}}"
+
+
# 2/3 of unbonding time
+
trust_period = "168h"
+

3. Start the daemon: {{ appName }} start
@@ -94,17 +97,15 @@ onMounted(() => { To make state sync works, we can enable snapshot in $DAEMON_HOME/config/app.toml

- - +
+
[state-sync]
+
# snapshot-interval specifies the block interval at which local state sync snapshots are
+
# taken (0 to disable). Must be a multiple of pruning-keep-every.
+
snapshot-interval = 1000
+
+
# snapshot-keep-recent specifies the number of recent snapshots to keep and serve (0 to keep all). Each snapshot is about 500MiB
+
snapshot-keep-recent = 2
+
diff --git a/src/modules/[chain]/uptime/customize.vue b/src/modules/[chain]/uptime/customize.vue index 41c6aa18..0143072f 100644 --- a/src/modules/[chain]/uptime/customize.vue +++ b/src/modules/[chain]/uptime/customize.vue @@ -29,7 +29,7 @@ const selectChain = ref(chainStore.chainName) const validators = ref(stakingStore.validators) const keyword = ref("") -if(local.value) Object.keys(local.value).map(chainName => { +function loadSigningInfo(chainName: string) { const chain = dashboard.chains[chainName] if(chain && chain.endpoints.rest) { const client = CosmosRestClient.newDefault(chain.endpoints.rest[0].address) @@ -37,16 +37,18 @@ if(local.value) Object.keys(local.value).map(chainName => { signingInfo.value[chainName] = resp.info }) } - if(chainName === selectChain.value) { - const vals = local.value[chainName] - if(vals) { - selected.value = vals.map(x => x.address) - } - } - - return chain +} +if(local.value) Object.keys(local.value).map(chainName => { + loadSigningInfo(chainName) }) +function initial() { + const vals = local.value[selectChain.value] + if(vals) { + selected.value = vals.map(x => x.address) + } +} + const filterValidators = computed(() => { if(keyword.value) { return validators.value.filter(x => x.description.moniker.indexOf(keyword.value) > -1) @@ -74,6 +76,9 @@ const list = computed(() => { }) function add() { + if(!signingInfo.value[selectChain.value]) { + loadSigningInfo(selectChain.value) + } const newList = [] as { name: string; address: string; }[] selected.value.forEach(x => { const validator = validators.value.find(v => (consensusPubkeyToHexAddress(v.consensus_pubkey) === x)) @@ -84,6 +89,7 @@ function add() { }) if(!local.value) local.value = {} local.value[selectChain.value] = newList + localStorage.setItem("uptime-validators", JSON.stringify(local.value)) } @@ -140,22 +146,24 @@ function color(v: string) { - +
+ - + + - + + - + +
# Blockchain ValidatorMissing Blocks Signed Blocks Last Jailed Time TombstonedMissing Blocks
{{ i+1 }} {{ v.chainName }} {{ v.v.name }}{{ v.sigingInfo?.missed_blocks_counter }} {{ Number(v.sigingInfo.index_offset) - Number(v.sigingInfo.start_height) }}
@@ -164,6 +172,8 @@ function color(v: string) {
{{ v.sigingInfo?.tombstoned }}{{ v.sigingInfo?.missed_blocks_counter }}Blocks
@@ -172,12 +182,11 @@ function color(v: string) { - +