update block fetching strategy

This commit is contained in:
liangping 2022-03-24 11:56:47 +08:00
parent 566ae0a95b
commit 17fba7d61e
3 changed files with 5 additions and 8 deletions

View File

@ -3,7 +3,6 @@
"coingecko": "cosmos", "coingecko": "cosmos",
"api": ["https://cosmos.api.ping.pub", "https://lcd-cosmoshub.blockapsis.com"], "api": ["https://cosmos.api.ping.pub", "https://lcd-cosmoshub.blockapsis.com"],
"rpc": ["http://cosmos.rpc.ping.pub:26657", "https://cosmoshub.validator.network:443"], "rpc": ["http://cosmos.rpc.ping.pub:26657", "https://cosmoshub.validator.network:443"],
"state_sync_interval": "1000",
"sdk_version": "0.44.3", "sdk_version": "0.44.3",
"coin_type": "118", "coin_type": "118",
"min_tx_fee": "800", "min_tx_fee": "800",

View File

@ -2,7 +2,6 @@
"chain_name": "iris-network", "chain_name": "iris-network",
"api": "https://iris.api.ping.pub", "api": "https://iris.api.ping.pub",
"rpc": ["http://34.82.96.8:26657","http://34.77.68.145:26657"], "rpc": ["http://34.82.96.8:26657","http://34.77.68.145:26657"],
"state_sync_interval": "400",
"sdk_version": "0.42.4", "sdk_version": "0.42.4",
"coin_type": "118", "coin_type": "118",
"min_tx_fee": "40000", "min_tx_fee": "40000",

View File

@ -38,12 +38,12 @@
Enable Snapshot For State Sync Enable Snapshot For State Sync
</b-card-title> </b-card-title>
To make state sync works, We need at least 2 available RPC servers which enabled snapshot. You can configure in <code>$DAEMON_HOME/config/app.toml</code>, To make state sync works, We need at least 2 available RPC servers which enabled snapshot. You can configure in <code>$DAEMON_HOME/config/app.toml</code>,
and don't forget to share your RPC server <a href="https://github.com/ping-pub/explorer/tree/master/src/chains">Here</a> and don't forget to share your snapshot server <a href="https://github.com/ping-pub/explorer/discussions">Here</a>
<b-form-textarea <b-form-textarea
id="snapshot" id="snapshot"
v-model="snapshot" v-model="snapshot"
readonly readonly
rows="7" rows="8"
class="mt-1" class="mt-1"
/> />
</b-card> </b-card>
@ -81,8 +81,8 @@ export default {
# taken (0 to disable). Must be a multiple of pruning-keep-every. # taken (0 to disable). Must be a multiple of pruning-keep-every.
snapshot-interval = 1000 snapshot-interval = 1000
# snapshot-keep-recent specifies the number of recent snapshots to keep and serve (0 to keep all). # snapshot-keep-recent specifies the number of recent snapshots to keep and serve (0 to keep all). each snapshot is around 500MiB
snapshot-keep-recent = 10`, snapshot-keep-recent = 2`,
} }
}, },
// computed: { // computed: {
@ -107,8 +107,7 @@ snapshot-keep-recent = 10`,
// }, // },
// }, // },
created() { created() {
console.log(this.$store.state.chains.selected.state_sync_interval) const interval = 1000
const interval = this.$store.state.chains.selected.state_sync_interval || 1000
this.$http.getLatestBlock().then(l => { this.$http.getLatestBlock().then(l => {
const { height } = l.block.header const { height } = l.block.header
if (height > interval) { if (height > interval) {