⛓️ Oracle

➡️ Prerequisites

sudo apt -q update
sudo apt -qy install curl git jq lz4 build-essential
sudo apt -qy upgrade
sudo apt-get update && apt-get install -y libssl-dev
sudo apt update
sudo apt install python3.10
sudo apt install python3.10-venv

➡️ Installation Steps

cd $HOME
git clone https://github.com/cmancrypto/symphony-oracle-voter.git
cd symphony-oracle-voter
git checkout v0.0.5

1. Option —default— (keyring_back_end = os)

cat <<EOF > .env
VALIDATOR_ADDRESS= symphonyvaloperxxx
VALIDATOR_ACC_ADDRESS= symphonyxxx
KEY_PASSWORD= walletpassword;
KEY_BACKEND = os
SYMPHONY_LCD= https://api-symphonyd.vinjan.xyz #or http://localhost:35317 defaultport 1317
TENDERMINT_RPC= https://rpc-symphonyd.vinjan.xyz #or http://localhost:35657 defaultport 26657
EOF

2. Option —my guide— (keyring_back_end = test)

cat <<EOF > .env
VALIDATOR_ADDRESS= symphonyvaloperxxx
VALIDATOR_ACC_ADDRESS= symphonyxxx
KEY_BACKEND = test
SYMPHONY_LCD= https://api-symphonyd.vinjan.xyz #or http://localhost:35317 defaultport 1317
TENDERMINT_RPC= https://rpc-symphonyd.vinjan.xyz #or http://localhost:35657 defaultport 26657
EOF

➡️ You can proceed after choosing Option 1 or Option 2

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
deactivate

➡️ Service File

sudo tee /etc/systemd/system/oracle.service > /dev/null << EOF
[Unit]
Description=Symphony Oracle
After=network.target

[Service]
# Environment variables
Environment="SYMPHONYD_PATH=$(which symphonyd)"
Environment="PYTHON_ENV=production"
Environment="LOG_LEVEL=INFO"
Environment="DEBUG=false"

# Service configuration
Type=simple
User=root
WorkingDirectory=/root/symphony-oracle-voter/
ExecStart=/root/symphony-oracle-voter/venv/bin/python3 -u /root/symphony-oracle-voter/main.py
Restart=always
RestartSec=3
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable oracle.service
sudo systemctl start oracle.service
sudo journalctl -u oracle -f -o cat

If you encounter any issues, check the service logs for more detailed error messages:

sudo journalctl -u oracle.service -n 50 --no-pager