---
# System prepended metadata

title: State Sync for Provenance blockchain.

---

# State Sync for Provenance blockchain.

```
 export PIO_HOME=/Users/arnabmitra/pio-statesync
➜  pio-statesync PIO_RPC=23.88.53.28:26657
➜  pio-statesync LATEST_HEIGHT="$(curl -s "$PIO_RPC/block" | jq -r .result.block.header.height)"
➜  pio-statesync echo $LATEST_HEIGHT
8496588
➜  pio-statesync TRUST_HEIGHT="$((LATEST_HEIGHT - 1000))"
➜  pio-statesync TRUST_HASH="$(curl -s "$PIO_RPC/block?height=$TRUST_HEIGHT" | jq -r .result.block_id.hash)"
➜  pio-statesync echo -e "PIO_RPC=$PIO_RPC\nLATEST_HEIGH=$LATEST_HEIGHT\nTRUST_HEIGHT=$TRUST_HEIGHT\nTRUST_HASH=$TRUST_HASH\n"
PIO_RPC=23.88.53.28:26657
LATEST_HEIGH=8496588
TRUST_HEIGHT=8495588
TRUST_HASH=AF1275BC94D58652C2D90F50547FC2A24D5BFC90E43F5FD079F716537119451B

➜  pio-statesync provenanced config set \
    statesync.enable true \
    statesync.rpc_servers "[\"$PIO_RPC\",\"$PIO_RPC\"]" \
    statesync.trust_height "$TRUST_HEIGHT" \
    statesync.trust_hash "$TRUST_HASH" \
    p2p.seeds '4bd2fb0ae5a123f1db325960836004f980ee09b4@seed-0.provenance.io:26656, 048b991204d7aac7209229cbe457f622eed96e5d@seed-1.provenance.io:26656'
Tendermint Config Updated: /Users/arnabmitra/pio-statesync/config/config.toml
-------------------------------
p2p.seeds Was: "", Is Now: "4bd2fb0ae5a123f1db325960836004f980ee09b4@seed-0.provenance.io:26656, 048b991204d7aac7209229cbe457f622eed96e5d@seed-1.provenance.io:26656"
statesync.enable Was: false, Is Now: true
statesync.rpc_servers Was: [], Is Now: ["23.88.53.28:26657", "23.88.53.28:26657"]
statesync.trust_hash Was: "", Is Now: "AF1275BC94D58652C2D90F50547FC2A24D5BFC90E43F5FD079F716537119451B"
statesync.trust_height Was: 0, Is Now: 8495588

➜  pio-statesync provenanced start --x-crisis-skip-assert-invariants
3:31PM INF starting node with ABCI Tendermint in-process
open /Users/arnabmitra/pio-statesync/data/priv_validator_state.json: no such file or directory
➜  pio-statesync cp ~/.provenanced/data/priv_validator_state.json ./data
```


also change this on your node (because of this bug)
```
[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 = 10000

# 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
```


set ulimit to 
```
ulimit -n 10240
```