Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions scripts/statesync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ set -euo pipefail
# ---------------------------------------------------------------------------
# Network constants
# ---------------------------------------------------------------------------
SNAP_RPC="https://state-sync-service.republicai.io"
SNAP_RPC="https://statesync.republicai.io"
WITNESS_RPC="https://rpc.republicai.io"
SNAP_PEER="f13fec7efb7538f517c74435e082c7ee54b4a0ff@54.204.89.111:26656"
RPC_PEER="cd10f1a4162e3a4fadd6993a24fd5a32b27b8974@3.94.103.50:26656"
SNAP_PEER="66977b35472a50bbb838401aa54a3b1ac45df5c4@3.235.172.92:26656"
RPC_PEER="e281dc6e4ebf5e32fb7e6c4a111c06f02a1d4d62@3.92.139.74:26656"

# Snapshot interval on the provider is 1000 blocks (~83 min at 5s blocks).
# We round the trust height down to the nearest 1000 so it aligns with an
Expand Down Expand Up @@ -125,21 +125,21 @@ echo " Trust hash: $TRUST_HASH"
echo "Cross-verifying against witness RPC..."

witness_json=$(curl -sS --fail --max-time 10 "${WITNESS_RPC}/block?height=${TRUST_HEIGHT}") || {
echo "Warning: could not reach witness RPC for verification (continuing anyway)"
witness_json=""
echo "ERROR: could not reach witness RPC (${WITNESS_RPC}) for verification."
echo "Aborting -- cannot verify trust hash without an independent witness."
echo "Check that the witness RPC is reachable and try again."
exit 1
}

if [[ -n "$witness_json" ]]; then
WITNESS_HASH=$(jq -r '(.result.block_id.hash // .block_id.hash) // empty' <<<"$witness_json")
if [[ "$WITNESS_HASH" != "$TRUST_HASH" ]]; then
echo "HASH MISMATCH between provider and witness at height $TRUST_HEIGHT"
echo " Provider: $TRUST_HASH"
echo " Witness: $WITNESS_HASH"
echo "Aborting -- investigate before proceeding."
exit 1
fi
echo " Verified: hashes match."
WITNESS_HASH=$(jq -r '(.result.block_id.hash // .block_id.hash) // empty' <<<"$witness_json")
if [[ "$WITNESS_HASH" != "$TRUST_HASH" ]]; then
echo "HASH MISMATCH between provider and witness at height $TRUST_HEIGHT"
echo " Provider: $TRUST_HASH"
echo " Witness: $WITNESS_HASH"
echo "Aborting -- investigate before proceeding."
exit 1
fi
echo " Verified: hashes match."

# ---------------------------------------------------------------------------
# Patch config.toml
Expand Down
6 changes: 3 additions & 3 deletions testnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" "$REPUBLIC_HOME/config/config.toml"

# 5. Configure persistent peers
PEERS="cd10f1a4162e3a4fadd6993a24fd5a32b27b8974@52.201.231.127:26656,f13fec7efb7538f517c74435e082c7ee54b4a0ff@3.208.19.30:26656"
PEERS="e281dc6e4ebf5e32fb7e6c4a111c06f02a1d4d62@3.92.139.74:26656,cfb2cb90a241f7e1c076a43954f0ee6d42794d04@54.173.6.183:26656,dc254b98cebd6383ed8cf2e766557e3d240100a9@54.227.57.160:26656,66977b35472a50bbb838401aa54a3b1ac45df5c4@3.235.172.92:26656"
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" "$REPUBLIC_HOME/config/config.toml"

# 6. Start node
Expand Down Expand Up @@ -136,10 +136,10 @@ 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\"|" "$REPUBLIC_HOME/config/config.toml"

PEERS="e281dc6e4ebf5e32fb7e6c4a111c06f02a1d4d62@3.92.139.74:26656,cfb2cb90a241f7e1c076a43954f0ee6d42794d04@54.173.6.183:26656,dc254b98cebd6383ed8cf2e766557e3d240100a9@54.227.57.160:26656"
PEERS="e281dc6e4ebf5e32fb7e6c4a111c06f02a1d4d62@3.92.139.74:26656,cfb2cb90a241f7e1c076a43954f0ee6d42794d04@54.173.6.183:26656,dc254b98cebd6383ed8cf2e766557e3d240100a9@54.227.57.160:26656,66977b35472a50bbb838401aa54a3b1ac45df5c4@3.235.172.92:26656"
sudo sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" "$REPUBLIC_HOME/config/config.toml"

# Fix ownership to match container user (UID 1001)
# Fix ownership to match container user (UID 1000)
sudo chown -R 1001:1001 "$REPUBLIC_HOME"
```

Expand Down
15 changes: 15 additions & 0 deletions testnet/chain.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,21 @@
"id": "dc254b98cebd6383ed8cf2e766557e3d240100a9",
"address": "54.227.57.160:26656",
"provider": "Republic Protocol"
},
{
"id": "66977b35472a50bbb838401aa54a3b1ac45df5c4",
"address": "3.235.172.92:26656",
"provider": "Republic Protocol"
},
{
"id": "2c9641378e9dacc49b269b0efb807b475d033e56",
"address": "89.167.15.180:26656",
"provider": "Conqueror"
},
{
"id": "1999732342c6c89de4112f82008766bf3342aba2",
"address": "104.152.210.127:55856",
"provider": "OneNov"
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion testnet/endpoints.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"explorers": [],
"state_sync": {
"rpc_servers": "https://statesync.republicai.io,https://statesync.republicai.io",
"rpc_servers": "https://statesync.republicai.io,https://rpc.republicai.io",
"snapshot_provider": "https://statesync.republicai.io"
}
}
2 changes: 1 addition & 1 deletion testnet/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"genesis_time": "2026-01-26T19:30:07.141149728Z",
"chain_id": "raitestnet_77701-1",
"initial_height": 1,
"app_hash": null,
"app_hash": "",
"app_state": {
"07-tendermint": null,
"auth": {
Expand Down