Skip to content

Commit

Permalink
Update State Sync
Browse files Browse the repository at this point in the history
  • Loading branch information
defrisk0 authored Nov 30, 2023
1 parent ac73dd1 commit a404a25
Showing 1 changed file with 85 additions and 1 deletion.
86 changes: 85 additions & 1 deletion ARKEO/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# ARKEO
[RPC](http://arkeo.srgts.xyz:27757) | [API](http://arkeo.srgts.xyz:1177) | [STATESYNC](#title1)

Let's update and install the necessary packages:
````
Expand All @@ -24,7 +25,90 @@ cd arkeo
git checkout ab05b124336ace257baa2cac07f7d1bfeed9ac02
make install
````
Let's check the version (current as of October 2023 - arkeo commit: b3f8d880dfcdb3265d321e465b47b04071d9480f):
Let's check the version (current as of November 2023 - arkeo commit: 68c59e9057e306dd99cdf55ebf4e6b1876835dc8):
````
arkeod version --long
````
Set the correct chain (arkeo), chooses his moniker and initialize node:
````
cd $HOME
MNK=ARK_NODE
arkeod config chain-id arkeo
arkeod init $MNK --chain-id arkeo
````
Download the current genesis file:
````
curl -s http://seed.arkeo.network:26657/genesis | jq '.result.genesis' > ~/.arkeo/config/genesis.json
````
Let's check sum genesis file (current as of November 2023 - 214828d2dac5eaaa4d2e70dde63bd460dcc86ab9e5dd7868dbfa8c3186b6abf9):
````
sha256sum $HOME/.arkeo/config/genesis.json
````
Edit minimum-gas-prices parameter:
````
sed -i 's|^minimum-gas-prices *=.*|minimum-gas-prices = "0.001uarkeo"|g' $HOME/.arkeo/config/app.toml
````
Adding seeds and peers:
````
seeds="[email protected]:22856,df0561c0418f7ae31970a2cc5adaf0e81ea5923f@arkeo-testnet-seed.itrocket.net:18656"
peers="[email protected]:38656,[email protected]:60656,[email protected]:22856,[email protected]:34656,[email protected]:26656"
sed -i -e 's|^seeds *=.*|seeds = "'$seeds'"|; s|^persistent_peers *=.*|persistent_peers = "'$peers'"|' $HOME/.arkeo/config/config.toml
````
Edit pruning parameter:
````
sed -i 's|pruning = "default"|pruning = "custom"|g' $HOME/.arkeo/config/app.toml
sed -i 's|pruning-keep-recent = "0"|pruning-keep-recent = "100"|g' $HOME/.arkeo/config/app.toml
sed -i 's|pruning-interval = "0"|pruning-interval = "10"|g' $HOME/.arkeo/config/app.toml
sed -i 's|^snapshot-interval *=.*|snapshot-interval = 2000|g' $HOME/.arkeo/config/app.toml
````
Create a service file:
````
sudo tee /etc/systemd/system/arkeod.service > /dev/null << EOF
[Unit]
Description=ARKEO NODE
After=network-online.target
[Service]
User=$USER
ExecStart=$(which arkeod) start
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
````
Reset this node's validator to genesis state:
````
arkeod tendermint unsafe-reset-all --home $HOME/.arkeo --keep-addr-book
````
Starting the node:
````
sudo systemctl daemon-reload
sudo systemctl enable arkeod
sudo systemctl restart arkeod
````
Checking the logs
````
sudo journalctl -u arkeod -f -o cat
````
### <a id="title1">State Sync</a>
````
sudo systemctl stop arkeod
cp $HOME/.arkeo/data/priv_validator_state.json $HOME/.arkeo/priv_validator_state.json.backup
arkeod tendermint unsafe-reset-all --home $HOME/.arkeo --keep-addr-book
SNAP_RPC="http://arkeod.srgts.xyz:27757"
LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000)); \
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 -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\"|" $HOME/.arkeo/config/config.toml
mv $HOME/.arkeo/priv_validator_state.json.backup $HOME/.arkeo/data/priv_validator_state.json
sudo systemctl restart arkeod && sudo journalctl -u arkeod -f -o cat
````

0 comments on commit a404a25

Please sign in to comment.