# StateSync/Snapshot

## &#x20;                                           🔥Celestia🔥

## &#x20;                                             TESTNET

## [Node installation instructions](https://stavr-team.gitbook.io/nodes-guides/testnets/celestia/validator-node)

## StateSync Celestia Testnet

```bash
RPC="https://celestia.rpc.t.stavr.tech:443"
LATEST_HEIGHT=$(curl -s $RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 1000)); \
TRUST_HASH=$(curl -s "$RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)

echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH

sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$RPC,$RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ; \
s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"\"|" $HOME/.celestia-app/config/config.toml
sudo systemctl stop celestia-appd && celestia-appd tendermint unsafe-reset-all --home $HOME/.celestia-app
wget -O $HOME/.celestia-app/config/addrbook.json "https://raw.githubusercontent.com/111STAVR111/props/main/Celestia/Testnet/Node/addrbook.json"
sudo systemctl restart celestia-appd && sudo journalctl -fu celestia-appd -o cat
```

## SnapShot Testnet - updated every 5 hours

{% hint style="success" %}
[`https://server-1.stavr.tech/Testnet/Celestia/`](https://server-1.stavr.tech/Testnet/Celestia/)
{% endhint %}

```sh
cd $HOME
snap install lz4
sudo systemctl stop celestia-appd
cp $HOME/.celestia-app/data/priv_validator_state.json $HOME/.celestia-app/priv_validator_state.json.backup
rm -rf $HOME/.celestia-app/data
LATEST_SNAPSHOT=$(curl -s https://server-1.stavr.tech/Testnet/Celestia/ | grep -oE 'celestia-snap-[0-9]+\.tar\.lz4' | while read SNAPSHOT; do HEIGHT=$(curl -s "https://server-1.stavr.tech/Testnet/Celestia/${SNAPSHOT%.tar.lz4}-info.txt" | awk '/Block height:/ {print $3}'); echo "$SNAPSHOT $HEIGHT"; done | sort -k2 -nr | head -n 1 | awk '{print $1}')
curl -o - -L https://server-1.stavr.tech/Testnet/Celestia/$LATEST_SNAPSHOT | lz4 -c -d - | tar -x -C $HOME/.celestia-app
mv $HOME/.celestia-app/priv_validator_state.json.backup $HOME/.celestia-app/data/priv_validator_state.json
wget -O $HOME/.celestia-app/config/addrbook.json "https://raw.githubusercontent.com/111STAVR111/props/main/Celestia/Testnet/Node/addrbook.json"
sudo systemctl restart celestia-appd && journalctl -fu celestia-appd -o cat
```

## SnapShot Consensus Testnet (Archive) updated every 5 days

{% hint style="success" %}
[`https://celestia-tools.stavr.tech/consensus/`](https://celestia-tools.stavr.tech/consensus/)
{% endhint %}

```bash
cd $HOME
snap install lz4
sudo systemctl stop celestia-appd
cp $HOME/.celestia-app/data/priv_validator_state.json $HOME/.celestia-app/priv_validator_state.json.backup
rm -rf $HOME/.celestia-app/data
curl -o - -L https://celestia-t.archive-snap.stavr.tech/celestia-t-archive.tar.lz4 | lz4 -c -d - | tar -x -C $HOME/.celestia-app
mv $HOME/.celestia-app/priv_validator_state.json.backup $HOME/.celestia-app/data/priv_validator_state.json
wget -O $HOME/.celestia-app/config/addrbook.json "https://raw.githubusercontent.com/111STAVR111/props/main/Celestia/Testnet/Node/addrbook.json"
sudo systemctl restart celestia-appd && journalctl -fu celestia-appd -o cat
```

## Useful Tools

🔥EXPLORER-T🔥: <https://explorer.stavr.tech/Celestia-Testnet> `Indexer "ON"`\
🔥API-T🔥: <https://celestia.api.t.stavr.tech>\
🔥RPC-T🔥:  <https://celestia.rpc.t.stavr.tech> `Snapshot-interval = 1000`

&#x20;                                         **ARCHIVE NODE**

* **api archive:** [**https://celestia.api-archive.t.stavr.tech:443**](https://celestia.api-archive.t.stavr.tech)

* **rpc archive:** [**https://celestia.rpc-archive.t.stavr.tech:443**](https://celestia.rpc-archive.t.stavr.tech)

* **grpc archive:** [**https://celestia.grpc-archive.t.stavr.tech:443**](https://celestia.grpc-archive.t.stavr.tech)

* Peer-T

```bash
d51838bb76758d58642c3a325ac664a964440bdf@celestia.peer.t.stavr.tech:10026
```

* &#x20;Addrbook-T (every 2h)

```python
wget -O $HOME/.celestia-app/config/addrbook.json "https://server-1.stavr.tech/Testnet/Celestia/addrbook.json"
```

* Genesis-T

```bash
wget -O $HOME/.celestia-app/config/genesis.json "https://server-1.stavr.tech/Testnet/Celestia/genesis.json"
```

* Auto\_install\_script-T

```bash
source <(curl -s https://raw.githubusercontent.com/111STAVR111/props/main/Celestia/Testnet/Node/celest)
```

## &#x20;                                 🔥[Decentralization Info](https://github.com/111STAVR111/props/tree/main/Celestia/Testnet/Decentralization)🔥

## &#x20;                                      🔥[RPC LOCATOR](https://github.com/111STAVR111/props/tree/main/Celestia/Testnet)🔥

<details>

<summary>RPC Scanning</summary>

### We scan nodes in real time every 24 hours. And we provide the final result of RPC endpoints. We cannot influence the operation of these nodes in any way.

```python
If Voting Power is higher than 0 --> then the Node is a validator of the network and may be subject to attack and be a potential threat to the chain.
```

```python
We marked such validators with a red symbol
```

</details>

## [Json RAW](https://rpc-check.celest.stavr.tech/celest/rpc-celest-result.json)
