# StateSync/Snapshot

## &#x20;                                           🔥Composable🔥

## &#x20;                                                MAINNET

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

## StateSync Composable Mainnet

```bash
systemctl stop picad
SNAP_RPC=https://composable.rpc.m.stavr.tech:443
LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 1000)); \
TRUST_HASH=$(curl -s "$SNAP_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\"$SNAP_RPC,$SNAP_RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ; \
s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"\"|" $HOME/.banksy/config/config.toml
picad tendermint unsafe-reset-all --home /root/.banksy
wget -O $HOME/.banksy/config/addrbook.json "https://server-1.stavr.tech/Mainnet/Picasso/addrbook.json"
curl -o - -L https://composable.wasm.stavr.tech/wasm-composable.tar.lz4 | lz4 -c -d - | tar -x -C $HOME/.banksy
sudo systemctl restart picad && journalctl -fu picad -o cat
```

## SnapShot Mainnet - updated every 5 hours

{% hint style="info" %} <mark style="color:orange;">**You can check the size and time of snapshot creation with this command**</mark>\
`curl -sI https://server-1.stavr.tech/Mainnet/Picasso/pica-snap-1.tar.lz4 | grep "last" && curl -sI https://server-1.stavr.tech/Mainnet/Picasso/pica-snap-1.tar.lz4 | grep content-length | awk '{printf "%.2f GB\n", $2/1024/1024/1024}'`
{% endhint %}

```sh
cd $HOME
apt install lz4
sudo systemctl stop picad
cp $HOME/.banksy/data/priv_validator_state.json $HOME/.banksy/priv_validator_state.json.backup
rm -rf $HOME/.banksy/data
LATEST_SNAPSHOT=$(curl -s https://server-1.stavr.tech/Mainnet/Picasso/ | grep -oE 'pica-snap-[0-9]+\.tar\.lz4' | while read SNAPSHOT; do HEIGHT=$(curl -s "https://server-1.stavr.tech/Mainnet/Picasso/${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/Mainnet/Picasso/$LATEST_SNAPSHOT | lz4 -c -d - | tar -x -C $HOME/.banksy
curl -o - -L https://composable.wasm.stavr.tech/wasm-composable.tar.lz4 | lz4 -c -d - | tar -x -C $HOME/.banksy
mv $HOME/.banksy/priv_validator_state.json.backup $HOME/.banksy/data/priv_validator_state.json
wget -O $HOME/.banksy/config/addrbook.json "https://server-1.stavr.tech/Mainnet/Picasso/addrbook.json"
sudo systemctl restart picad && journalctl -fu picad -o cat
```

## &#x20;                                                TESTNET

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

## StateSync Composable Testnet

```bash
SNAP_RPC=https://composable.rpc.t.stavr.tech:443
LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 1000)); \
TRUST_HASH=$(curl -s "$SNAP_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\"$SNAP_RPC,$SNAP_RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"| ; \
s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"\"|" $HOME/.banksy/config/config.toml
picad tendermint unsafe-reset-all --home /root/.banksy
wget -O $HOME/.banksy/config/addrbook.json "https://raw.githubusercontent.com/111STAVR111/props/main/Composable/Testnet/addrbook.json"
curl -o - -L https://composable.wasmt4.stavr.tech/wasm-composable.tar.lz4 | lz4 -c -d - | tar -x -C $HOME/.banksy --strip-components 2
systemctl restart picad && journalctl -fu picad -o cat
```

## SnapShot Composable Testnet&#x20;

{% hint style="info" %} <mark style="color:orange;">**You can check the size and time of snapshot creation with this command**</mark>\
`curl -sI https://composable-t4.snapshot.stavr.tech/composable-snap.tar.lz4 | grep "last" && curl -sI https://composable-t4.snapshot.stavr.tech/composable-snap.tar.lz4 | grep content-length | awk '{printf "%.2f GB\n", $2/1024/1024/1024}'`
{% endhint %}

```bash
cd $HOME
apt install lz4
sudo systemctl stop picad
cp $HOME/.banksy/data/priv_validator_state.json $HOME/.banksy/priv_validator_state.json.backup
rm -rf $HOME/.banksy/data
curl -o - -L https://composable-t4.snapshot.stavr.tech/composable-snap.tar.lz4 | lz4 -c -d - | tar -x -C $HOME/.banksy --strip-components 2
curl -o - -L https://composable.wasmt4.stavr.tech/wasm-composable.tar.lz4 | lz4 -c -d - | tar -x -C $HOME/.banksy --strip-components 2
mv $HOME/.banksy/priv_validator_state.json.backup $HOME/.banksy/data/priv_validator_state.json
wget -O $HOME/.banksy/config/addrbook.json "https://raw.githubusercontent.com/111STAVR111/props/main/Composable/Testnet/addrbook.json"
sudo systemctl restart picad && journalctl -fu picad -o cat
```

## Useful Tools

🔥EXPLORER-M🔥: <https://explorer.stavr.tech/Composable-Mainnet> `Indexer "ON"`\
🔥EXPLORER-T🔥: <https://explorer.stavr.tech/Composable-Testnet> `Indexer "ON"`\
🔥API-M🔥: <https://composable.api.m.stavr.tech>\
🔥API-T🔥: <https://composable.api.t4.stavr.tech>\
🔥RPC-M🔥: <https://composable.rpc.m.stavr.tech> `Snapshot-interval = 1000`\
🔥RPC-T🔥: <https://composable.rpc.t.stavr.tech> `Snapshot-interval = 1000`\
🔥gRPC-M🔥: [composable.grpc.m.stavr.tech:9907](https://composable.grpc.m.stavr.tech:9907)

* Seed-M

```bash
aa6398f9644e98fa3d04f7dbdd7740c995eb0530@composable.seed.stavr.tech:20306
```

* &#x20;Addrbook-M

```python
wget -O $HOME/.banksy/config/addrbook.json "https://server-1.stavr.tech/Mainnet/Picasso/addrbook.json"
```

* &#x20;Addrbook-T

```python
wget -O $HOME/.banksy/config/addrbook.json "https://raw.githubusercontent.com/111STAVR111/props/main/Composable/Testnet/addrbook.json"
```

* &#x20;Genesis-M

```bash
wget -L -O $HOME/.banksy/config/genesis.json https://server-1.stavr.tech/Mainnet/Picasso/genesis.json
```

* &#x20;Genesis-T

```python
wget -O ~/.banksy/config/genesis.json "https://raw.githubusercontent.com/111STAVR111/props/main/Composable/Testnet/genesis.json"
```

* &#x20;WASM-M

```python
curl -o - -L https://composable.wasm.stavr.tech/wasm-composable.tar.lz4 | lz4 -c -d - | tar -x -C $HOME/.banksy
```

* &#x20;WASM-T

```python
curl -o - -L https://composable.wasmt4.stavr.tech/wasm-composable.tar.lz4 | lz4 -c -d - | tar -x -C $HOME/.banksy --strip-components 2
```

* Auto\_install\_script-M

```bash
source <(curl -s https://raw.githubusercontent.com/111STAVR111/props/refs/heads/main/Composable/picam)
```

* Auto\_install\_script-T

```bash
wget -O compost4 https://raw.githubusercontent.com/111STAVR111/props/main/Composable/Testnet/compost4 && chmod +x compost4 && ./compost4
```

## 🔥[Decentralization Info](https://github.com/obajay/StateSync-snapshots/tree/main/Projects/Dymension/Decentralization)🔥

<details>

<summary>RPC Scanning</summary>

### We scan nodes in real time every 4 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>
