-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #162 from onomyprotocol/dev-backup
Dev backup
- Loading branch information
Showing
4 changed files
with
46 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,11 +70,3 @@ jobs: | |
- name: Run `cargo clippy` | ||
run: | | ||
cargo clippy --all --all-targets --all-features -- -D clippy::all | ||
markdown-link-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- uses: gaurav-nelson/[email protected] | ||
with: | ||
folder-path: "docs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,25 @@ | ||
#!/bin/bash | ||
set -eu | ||
set -uxe | ||
|
||
echo "Setting statesync config" | ||
git clone https://github.com/onomyprotocol/onomy && cd onomy && git checkout v1.1.4 | ||
make install | ||
|
||
# Onomy home dir | ||
ONOMY_HOME=$HOME/.onomy | ||
# Config directories for onomy node | ||
ONOMY_HOME_CONFIG="$ONOMY_HOME/config" | ||
# Config file for onomy node | ||
ONOMY_NODE_CONFIG="$ONOMY_HOME_CONFIG/config.toml" | ||
# App config file for onomy node | ||
# Statysync servers default IPs | ||
ONOMY_STATESYNC_SERVERS_DEFAULT_IPS="52.70.182.125,44.195.221.88" | ||
export GOPATH=~/go | ||
export PATH=$PATH:~/go/bin | ||
|
||
statesync_nodes= | ||
blk_height= | ||
blk_hash= | ||
onomyd init test --chain-id onomy-mainnet-1 | ||
wget -O ~/.onomy/config/genesis.json https://raw.githubusercontent.com/onomyprotocol/onomy/main/genesis/mainnet/genesis-mainnet-1.json | ||
|
||
read -r -p "Enter IPs of statesync nodes (at least 2) [$ONOMY_STATESYNC_SERVERS_DEFAULT_IPS]:" statesync_ips | ||
statesync_ips=${statesync_ips:-$ONOMY_STATESYNC_SERVERS_DEFAULT_IPS} | ||
for statesync_ip in ${statesync_ips//,/ } ; do | ||
latest_height=$(curl -s http://$statesync_ip:26657/block | jq -r .result.block.header.height); | ||
trusted_height=$((latest_height - 2000)); | ||
LATEST_HEIGHT=$(curl -s "https://rpc-mainnet.onomy.io:443/block" | jq -r .result.block.header.height); | ||
BLOCK_HEIGHT=$(($LATEST_HEIGHT - 2000)) | ||
TRUST_HASH=$(curl -s "https://rpc-mainnet.onomy.io:443/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash) | ||
|
||
blk_details=$(curl -s http://$statesync_ip:26657/block?height=$trusted_height | jq -r '.result.block.header.height + "\n" + .result.block_id.hash') | ||
blk_height=$(echo $blk_details | cut -d$' ' -f1) | ||
export ONOMYD_STATESYNC_ENABLE=true | ||
export ONOMYD_P2P_MAX_NUM_OUTBOUND_PEERS=100 | ||
export ONOMYD_P2P_MAX_NUM_INBOUND_PEERS=100 | ||
export ONOMYD_STATESYNC_RPC_SERVERS="https://rpc-mainnet.onomy.io:443,http://35.224.118.71:26657" | ||
export ONOMYD_STATESYNC_TRUST_HEIGHT=$BLOCK_HEIGHT | ||
export ONOMYD_STATESYNC_TRUST_HASH=$TRUST_HASH | ||
export ONOMYDD_P2P_SEEDS="[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:52756" | ||
|
||
blk_hash=$(echo $blk_details | cut -d$' ' -f2) | ||
statesync_nodes="$statesync_nodes$statesync_ip:26657," | ||
done | ||
|
||
echo "Setting up trusted block number $blk_height and hash $blk_hash" | ||
|
||
# Change statesync settings | ||
crudini --set $ONOMY_NODE_CONFIG statesync enable true | ||
crudini --set $ONOMY_NODE_CONFIG statesync rpc_servers "\"$statesync_nodes\"" | ||
crudini --set $ONOMY_NODE_CONFIG statesync trust_height $blk_height | ||
crudini --set $ONOMY_NODE_CONFIG statesync trust_hash "\"$blk_hash\"" | ||
crudini --set $ONOMY_NODE_CONFIG statesync discovery_time "\"60s\"" | ||
crudini --set $ONOMY_NODE_CONFIG statesync chunk_request_timeout "\"60s\"" | ||
crudini --set $ONOMY_NODE_CONFIG statesync chunk_fetchers "\"10\"" | ||
|
||
echo "Setup for statesync is complete" | ||
onomyd start --x-crisis-skip-assert-invariants --p2p.persistent_peers [email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:52756,[email protected]:26656 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters