> For the complete documentation index, see [llms.txt](https://docs.validator247.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.validator247.com/testnet/warden-protocol.md).

# Warden Protocol

> [https://twitter.com/wardenprotocol\
> https://discord.gg/wardenprotocol](<https://twitter.com/wardenprotocol&#xA;https://discord.gg/wardenprotocol>)

**Public Endpoints**

RPC URL: <https://warden-testnet-rpc.validator247.com>

API URL: <https://warden-testnet-api.validator247.com>&#x20;

**Explorer**

> <https://explorer.validator247.com/warden-testnet/staking>

Update system

```
sudo apt update
sudo apt-get install git curl build-essential make jq gcc snapd chrony lz4 tmux unzip bc -y
```

Install Go

```
rm -rf $HOME/go
sudo rm -rf /usr/local/go
cd $HOME
curl https://dl.google.com/go/go1.22.1.linux-amd64.tar.gz | sudo tar -C/usr/local -zxvf -
cat <<'EOF' >>$HOME/.profile
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GO111MODULE=on
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
EOF
source $HOME/.profile
go version
```

Install node

```
cd $HOME
rm -rf bin
mkdir bin && cd bin
wget https://github.com/warden-protocol/wardenprotocol/releases/download/v0.5.2/wardend_Linux_x86_64.zip
unzip wardend_Linux_x86_64.zip
chmod +x wardend
mv $HOME/bin/wardend $HOME/go/bin
```

Initialize Node

```
    wardend init NodeName --chain-id=chiado_10010-1
```

Download Genesis & Addrbook

```
wget https://raw.githubusercontent.com/Validator247/Warden-protocol/main/addrbook.json
wget https://raw.githubusercontent.com/Validator247/Warden-protocol/main/genesis.json
```

Set  peers

```
PEERS="2d2c7af1c2d28408f437aef3d034087f40b85401@52.51.132.79:26656,22e706be097baf72b999a6b00b5e1bba5540675c@135.181.81.254:18656,5461e7642520a1f8427ffaa57f9d39cf345fcd47@54.72.190.0:26656,8288657cb2ba075f600911685670517d18f54f3b@65.108.231.124:18656"
sed -i -e "/^\[p2p\]/,/^\[/{s/^[[:space:]]*seeds *=.*/seeds = \"$SEEDS\"/}" \
       -e "/^\[p2p\]/,/^\[/{s/^[[:space:]]*persistent_peers *=.*/persistent_peers = \"$PEERS\"/}" $HOME/.warden/config/config.toml

```

set custom ports in app.toml

```
sed -i.bak -e "s%:1317%:${WARDEN_PORT}317%g;
s%:8080%:${WARDEN_PORT}080%g;
s%:9090%:${WARDEN_PORT}090%g;
s%:9091%:${WARDEN_PORT}091%g;
s%:8545%:${WARDEN_PORT}545%g;
s%:8546%:${WARDEN_PORT}546%g;
s%:6065%:${WARDEN_PORT}065%g" $HOME/.warden/config/app.toml
```

set custom ports in config.toml file

```
sed -i.bak -e "s%:26658%:${WARDEN_PORT}658%g;
s%:26657%:${WARDEN_PORT}657%g;
s%:6060%:${WARDEN_PORT}060%g;
s%:26656%:${WARDEN_PORT}656%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${WARDEN_PORT}656\"%;
s%:26660%:${WARDEN_PORT}660%g" $HOME/.warden/config/config.toml
```

config pruning

```
sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/.warden/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.warden/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"50\"/" $HOME/.warden/config/app.toml   
```

set minimum gas price, enable prometheus and disable indexing

```
    sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "250000000000000award"|g' $HOME/.warden/config/app.toml
    sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.warden/config/config.toml
    sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.warden/config/config.toml  
```

Create Service

```
sudo tee /etc/systemd/system/wardend.service > /dev/null <<EOF
[Unit]
Description=Warden node
After=network-online.target
[Service]
User=$USER
WorkingDirectory=$HOME/.warden
ExecStart=$(which wardend) start --home $HOME/.warden
Restart=on-failure
RestartSec=5
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF


sudo systemctl daemon-reload
sudo systemctl enable wardend
```

State Sync

```
sudo systemctl stop wardend

SNAP_RPC="https://warden-testnet-rpc.validator247.com"

cp $HOME/.warden/data/priv_validator_state.json $HOME/.warden/priv_validator_state.json.backup
wardend tendermint unsafe-reset-all --home ~/.warden/ --keep-addr-book

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.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\"|" ~/.warden/config/config.toml
more ~/.warden/config/config.toml | grep 'rpc_servers'
more ~/.warden/config/config.toml | grep 'trust_height'
more ~/.warden/config/config.toml | grep 'trust_hash'

sudo mv $HOME/.warden/priv_validator_state.json.backup $HOME/.warden/data/priv_validator_state.json

sudo systemctl restart wardend && journalctl -u wardend -f -o cat
```

## Create a Wallet

Create Wallet

```
wardend keys add wallet
```

faucet token

```
curl -XPOST -d '{"address": "your_wallet"}' https://faucet.chiado.wardenprotocol.org/
```

Check Banlance

```
wardend q bank balances $(wardend keys show wallet -a)
```

## Create validator

Obtain your validator public key by running the following command:

```
wardend comet show-validator
```

The output will be similar to this (with a different key):

```
{"@type":"/cosmos.crypto.ed25519.PubKey","key":"lR1d7YBVK5jYijOfWVKRFoWCsS4dg3kagT7LB9GnG8I="}
```

Create validator.json file

```
nano validator.json
```

The validator.json file has the following format: Change your personal information accordingly

```
{    
"pubkey": {"@type":"/cosmos.crypto.ed25519.PubKey","key":"lR1d7YBVK5jYijOfWVKRFoWCsS4dg3kagT7LB9GnG8I="},
"amount": "1000000000000000000award",
"moniker": "your-node-moniker",
"identity": "your_Keybase",
"website": "your_website",
"security": "your_email",
"details": "I love validator247",
"commission-rate": "0.1",
"commission-max-rate": "0.2",
"commission-max-change-rate": "0.01",
"min-self-delegation": "1"
}
```

Finally, create the validator:

```
wardend tx staking create-validator validator.json \
--from=<key-name> \
--chain-id=chiado_10010-1 \
--fees=500award
```

Delegate Token to your own validator

```
    wardend tx staking delegate $(wardend keys show wallet --bech val -a)  1000000uward \
    --from=wallet \
    --chain-id=chiado_10010-1 \
    --fees=500award
```

Withdraw rewards and commission

```
    wardend tx distribution withdraw-rewards $(wardend keys show wallet --bech val -a) \
    --from wallet \
    --commission \
    --chain-id=chiado_10010-1 \
    --fees=500award
```

Unjail validator

```
    wardend tx slashing unjail \
    --from=wallet \
    --chain-id=chiado_10010-1 \
    --fees=500jward
```

Services Management

```
    # Reload Service
    sudo systemctl daemon-reload
    # Enable Service
    sudo systemctl enable wardend
    # Disable Service
    sudo systemctl disable wardend
    # Start Service
    sudo systemctl start wardend
    # Stop Service
    sudo systemctl stop wardend
    # Restart Service
    sudo systemctl restart wardend
    # Check Service Status
    sudo systemctl status wardend
    # Check Service Logs
    sudo journalctl -u wardend -f --no-hostname -o cat
```

Remove node

```
    sudo systemctl stop wardend && sudo systemctl disable wardend && sudo rm /etc/systemd/system/wardend.service && sudo systemctl daemon-reload && rm -rf $HOME/.warden && $HOME/wardenprotocol
```

## DONE

## # Upgrade

```
sudo systemctl stop wardend
cd $HOME
rm -rf warden
rm -rf /usr/local/bin/wardend

wget https://github.com/warden-protocol/wardenprotocol/releases/download/v0.3.2/wardend_Linux_x86_64.zip
unzip wardend_Linux_x86_64.zip && rm -rf wardend_Linux_x86_64.zip
chmod +x wardend
sudo mv wardend /usr/local/bin
wardend version

sudo systemctl restart wardend
sudo journalctl -u wardend -f --no-hostname -o cat
```

```
sudo systemctl stop wardend.service

rm -f $HOME/.warden/config/genesis.json

# Fetch the new genesis and unpack it
curl -L https://buenavista-genesis.s3.eu-west-1.amazonaws.com/genesis.json.tar.xz | tar xJf -
mv genesis.json $HOME/.warden/config/genesis.json
```

Make sure you have your `persistent_peers` set: `92ba004ac4bcd5afbd46bc494ec906579d1f5c1d@52.30.124.80:26656,ed5781ea586d802b580fdc3515d75026262f4b9d@54.171.21.98:26656`&#x20;

**Option 1) Start from the Genesis, requires beefy server**

```
sudo systemctl stop wardend.service

wardend tendermint unsafe-reset-all --home $HOME/.warden
rm -fR $HOME/.warden/wasm

sudo systemctl restart wardend.service
sudo journalctl -u wardend -f --no-hostname -o cat
```

**Option 2) Start from the WardenKeeper snapshot**

```
sudo systemctl stop wardend.service

wardend tendermint unsafe-reset-all --home $HOME/.warden
rm -fR $HOME/.warden/wasm
curl -L https://buenavista-genesis.s3.eu-west-1.amazonaws.com/warden-snaphot.tar.lz4 | lz4 -dc - | tar -xf - -C "$HOME/.warden"

sudo systemctl restart wardend.service
sudo journalctl -u wardend -f --no-hostname -o cat
```

## #Upgarde ( Other )&#x20;

1. ```
   cd $HOME
   sudo systemctl stop wardend
   sudo systemctl disable wardend
   sudo rm -f $(which wardend)
   sudo rm -f $HOME/.warden/cosmovisor
   sudo rm -f /usr/local/bin/wardend
   sudo rm -rf /etc/systemd/system/wardend.service
   sudo systemctl daemon-reload
   ```

   ```
   sudo wget https://github.com/warden-protocol/wardenprotocol/releases/download/v0.3.2/wardend_Linux_x86_64.zip
   unzip -o wardend_Linux_x86_64.zip
   rm -rf wardend_Linux_x86_64.zip
   chmod +x wardend
   mkdir -p $HOME/go/bin
   sudo mv wardend $HOME/go/bin
   ```

   ```
   rm -f $HOME/.warden/config/genesis.json
   curl -L https://buenavista-genesis.s3.eu-west-1.amazonaws.com/genesis.json.tar.xz | tar xJf -
   mv genesis.json $HOME/.warden/config/genesis.json
   ```

2. you can skip this part

```
wardend tendermint unsafe-reset-all --home $HOME/.warden
rm -fR $HOME/.warden/wasm
curl -L https://buenavista-genesis.s3.eu-west-1.amazonaws.com/warden-snaphot.tar.lz4 | lz4 -dc - | tar -xf - -C "$HOME/.warden"
```

```
PEERS="08632f7cd07721f609700c12562424ffe07ab45c@65.109.90.171:39656,f03c5fcceccd89480906bb380f39a10f09c99ed6@65.108.111.225:60856,f9ef560b20b237cb3ffa4dc8f0a86aef4ee90a26@92.86.12.46:26656,119e46ed784cffac92e40bdac7f5cf2b9e3e3522@90.188.5.27:47056,37afc47c936ff6b168246c144db2fa53134108e6@195.201.195.61:41656,e5a0d1104c387e1f3740ef28de029324e3633636@65.109.69.143:2020,7f1789c2db2793d2cacc86bb56641674b53a76eb@51.79.79.83:11256,c962764d04ab27f577266d83e0087f3ce1388eef@14.167.155.13:18656,e4ab1a9837be4945a604ef460b8177c2e0da4ef0@65.108.13.154:39656,df210d06320bf8e989e6fc1b1a4b9c6c57815c24@37.60.239.99:11256,630f183c462202f72871d8b2b6273df7d0840d97@78.46.40.239:11656,e1ce5cd2f9a74a9d6347ed6a4d323103a79f8d4e@37.252.186.201:26656,69d2e20bd93ad7bb0b12f743f4c54e5a56b192ff@95.216.102.121:21656"
sed -i -e "/^\[p2p\]/,/^\[/{s/^[[:space:]]*persistent_peers *=.*/persistent_peers = \"$PEERS\"/}" $HOME/.warden/config/config.toml
```

```
sudo tee /etc/systemd/system/wardend.service > /dev/null <<EOF
[Unit]
Description=Warden Node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which wardend) start
Restart=always
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
```

```
sudo systemctl daemon-reload
sudo systemctl enable wardend
sudo systemctl start wardend && sudo journalctl -u wardend -f -o cat
```

## Oracle&#x20;

Installation

```
curl -sSL https://raw.githubusercontent.com/skip-mev/slinky/main/scripts/install.sh | sudo bash
```

check&#x20;

```
slinky version
```

Create a slinky service

```
[Unit]
Description=oracle slinky
After=network-online.target

[Service]
User=root
Type=simple
ExecStart=/usr/local/bin/slinky --market-map-endpoint="<YOUR_NODE_GRPC_URL>:<YOUR_NODE_GRPC_PORT>" ( --market-map-endpoint "localhost:13090" --port "2222" --host "localhost") 
Restart=always
RestartSec=3
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target

```

note: Option&#x20;

```
 --market-map-endpoint "localhost:13090" --port "1111" --host "localhost"
```

#### Verify Connect <a href="#verify-connect" id="verify-connect"></a>

To verify Connect is working, run the following command:

```
curl 'http://localhost:8080/slinky/oracle/v1/prices' | jq .
```

or

```
 curl 'http://localhost:1111/slinky/oracle/v1/prices' | jq .
```

The output of the command should look similar to this:

```
    "NTRN/USD": "37086291",
    "OP/USD": "1463000000",
    "ORDI/USD": "2757954204",
    "PEPE/USD": "76834000000",
    "PYTH/USD": "2732476752",
    "RUNE/USD": "4028097190",
    "SEI/USD": "2914708529",
    "SHIB/USD": "13849307569",
    "SNX/USD": "1351864813",
    "SOL/USD": "13631636836",
    "STRK/USD": "357964203",
    "STX/USD": "1553614638",
    "SUI/USD": "8118188181",
    "TIA/USD": "444335566",
    "TRX/USD": "15934406559",
    "UNI/USD": "5835000000",
    "USDT/USD": "999900009",
    "WLD/USD": "1512648735",
    "WOO/USD": "1524847515",
    "XLM/USD": "924107589",
    "XRP/USD": "5611438856"
  },
  "timestamp": "2024-08-30T20:20:24.786990559Z",
  "version": "1.0.10"
}
```

### &#x20;Run Application Node <a href="#run-application-node" id="run-application-node"></a>

In order for the application to get prices from Connect, we need to add the following lines under the `[oracle]` heading in the `app.toml`.

Remember to change the `oracle_address` value to the address of your Connect sidecar.

```
# ... other sections

[oracle]
enabled = "true" # if you are not running a full node, set this to "false"
oracle_address = "<YOUR_CONNECT_SIDECAR>:8080"
client_timeout = "250ms"
metrics_enabled = "true"
interval = "1500ms"
price_ttl = "10s"

```

for example according to individuals

```
# ... other sections

[oracle]
enabled = "true" # if you are not running a full node, set this to "false"
oracle_address = "localhost:2222"
client_timeout = "250ms"
metrics_enabled = "true"
interval = "1500ms"
price_ttl = "10s"

```

Run

```
sudo systemctl daemon-reload
sudo systemctl enable slinky
sudo systemctl start slinky && sudo journalctl -u slinky -f -o cat
```

### Upgrade <a href="#manual" id="manual"></a>

```
cd $HOME
rm -rf download
mkdir download
cd download
wget https://github.com/warden-protocol/wardenprotocol/releases/download/v0.4.2/wardend_Linux_x86_64.zip
unzip wardend_Linux_x86_64.zip
rm wardend_Linux_x86_64.zip
chmod +x $HOME/download/wardend
sudo mv $HOME/download/wardend $(which wardend)
sudo systemctl restart wardend && sudo journalctl -u wardend -f -o cat

wardend version
```
