Ojo "ojo-devnet" / Guides / Snapshot services

RPC : https://rpc-ojo.test.theamsolutions.info

API : https://api-ojo.test.theamsolutions.info

gRPC : https://grpc-ojo.test.theamsolutions.info
 

NODE SETUP GUIDE

 

Install GO & Dependencies HERE

Install binaries & Run node

cd $HOME
git clone https://github.com/ojo-network/ojo.git
cd ojo/
git checkout v0.1.2
make install
ojod version

ojod init <NODE_NAME> --chain-id ojo-devnet

wget -qO $HOME/.ojo/config/genesis.json https://snapshots.theamsolutions.info/ojo-devnet-genesis.json

sha256sum $HOME/.ojo/config/genesis.json
#right output:  6037d1c1a89110c024fc18143eafe33fee19671b9427a4d4ac9c701f7a3c9309

#create service file
sudo tee /etc/systemd/system/ojod.service << EOF
[Unit]
Description=Ojo-Testnet
After=network-online.target
#
[Service]
User=$USER
ExecStart=$(which ojod) start
RestartSec=10
Restart=on-failure
LimitNOFILE=65535
#
[Install]
WantedBy=multi-user.target
EOF

sudo systemctl daemon-reload
sudo systemctl enable ojod.service


STATE SYNC SERVICE
 

Please make sure You have latest, officially launched version of Ojo binaries.



sudo systemctl stop ojod.service
ojod tendermint unsafe-reset-all --home $HOME/.ojo

SNAP_RPC="https://rpc-ojo.test.theamsolutions.info: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\"|" $HOME/.ojo/config/config.toml; \
wget -qO $HOME/.ojo/config/addrbook.json https://snapshots.theamsolutions.info/ojo-dev-addrbook.json

sudo systemctl restart ojod.service && sudo journalctl -u ojod.service -f -o cat

Use command below to switch off your State Sync mode, after node fully synced to avoid problems in future node restarts!

sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1false|" $HOME/.ojo/config/config.toml

A fully synced node supposed to be ready in 10-15 min. depending on computer/bandwidth power.
Enjoy. 

 

DATA SNAPSHOT SERVICE

#check snapshot height  : curl -s https://snapshots.theamsolutions.info | egrep -o ">ojo-snap*.*tar" | tr -d ">"

snap=$(curl -s https://snapshots.theamsolutions.info | egrep -o ">ojo-snap*.*tar" | tr -d ">")
sudo systemctl stop ojod
mv $HOME/.ojo/data/priv_validator_state.json $HOME
rm -rf  $HOME/.ojo/data
wget -P $HOME https://snapshots.theamsolutions.info/${snap}
tar xf $HOME/${snap} -C $HOME/.ojo
rm $HOME/${snap}
mv $HOME/priv_validator_state.json $HOME/.ojo/data
wget -qO $HOME/.ojo/config/addrbook.json https://snapshots.theamsolutions.info/ojo-dev-addrbook.json
sudo systemctl restart ojod
journalctl -u ojod -f -o cat

 

PRICE FEEDER SETUP
 

#create Ojo key for Price Feeder and fund it with some tokens (100 for example)
#Install Price Feeder 

cd $HOME
git clone https://github.com/ojo-network/price-feeder
cd price-feeder
git checkout v0.1.1
make install

mkdir $HOME/pfd-config

#download recommended version of config (wont be redundant to double check config actuality at Discord)

wget -qO $HOME/pfd-config/config.toml https://github.com/AlexToTheMoon/AM-Solutions/raw/main/files/ojo-pfd-conf.toml

#open file $HOME/config.toml and set right values as commented below only for mentioned fields

[account]
address = "ojo1..."  # your newly created key for PFD
chain_id = "ojo-testnet"
validator = "ojovaloper1..." #your Validator valoper address

[keyring]
backend = "os"
dir = "home_dir" # path to $HOME/.ojo
pass = "key_ring_pass" # your keyring password

[telemetry]
global_labels = [["chain-id", "ojo-testnet"]] # set Ojo chain id fo telemetry

#create pfd.service file

PFD_PASS="your-keyring-pass"

sudo tee /etc/systemd/system/price-feeder.service << EOF
Description=Price-Feeder
After=network.target
[Service]
User=$USER
Environment=PRICE_FEEDER_PASS="$PFD_PASS"
ExecStart=$(which price-feeder) $HOME/pfd-config/config.toml --log-level debug
RestartSec=10
Restart=on-failure
Type=simple
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF

#launch pfd
sudo systemctl daemon-reload
sudo systemctl enable price-feeder.service
sudo systemctl start price-feeder.service

#register PFD acc to the chain and restart

OJO_KEY="ojo1..." # validator main wallet key
PFD_KEY="ojo1..." # PFD key

ojod tx oracle delegate-feed-consent $UMEE_KEY $PFD_KEY --chain-id ojo-devnet --fees 500uojo

sudo systemctl restart pfd.service
journalctl -u pfd.service -f -o cat

 

 

GOOD LUCK!!!

 

AM Solutions © Copyright. All rights reserved.

We need your consent to load the translations

We use a third-party service to translate the website content that may collect data about your activity. Please review the details and accept the service to view the translations.