Skip to content

Commit

Permalink
Add state sync to deweb
Browse files Browse the repository at this point in the history
  • Loading branch information
kj89 committed Jun 22, 2022
1 parent cd131c7 commit 33c396d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions deweb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,22 @@ Next you have to make sure your validator is syncing blocks. You can use command
dewebd status 2>&1 | jq .SyncInfo
```

### (OPTIONAL) State Sync
You can state sync your node in minutes by running commands below. Special thanks to `polkachu | polkachu.com#1249`
```
SNAP_RPC="https://deweb-testnet-rpc.polkachu.com:443"
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)
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/.deweb/config/config.toml
dewebd unsafe-reset-all
systemctl restart dewebd && journalctl -fu dewebd -o cat
```

### Create wallet
To create new wallet you can use command below. Don’t forget to save the mnemonic
```
Expand Down

0 comments on commit 33c396d

Please sign in to comment.