Links

Systemd

This document assumes /home/ubuntu is the server user home directory, make sure to change it to fit the directory of your choice.
Prerequisites:
  • Install Git to clone the zen-oracle repository
  • Install mono-devel. If you choose to install via a package manager, add Mono's own repository first.
  • Install the Headless Node and import a funded account
  • Cron (Optional)
  • Install MongoDB

Oracle Service File

Save it in path: /etc/systemd/system/zen-oracle.service

[Unit]
Description=Oracle
After=network.target
[Service]
Type=simple
EnvironmentFile=/home/ubuntu/services/scripts/env
WorkingDirectory=/home/ubuntu/services/zen-oracle/src/Oracle/bin/Release
ExecStart=/usr/bin/mono /home/ubuntu/services/zen-oracle/src/Oracle/bin/Release/zen-oracle.exe s
Restart=on-failure
[Install]
WantedBy=multi-user.target

Oracle Service

  1. 1.
    Get the oracle service (from GitLab)
    mkdir /home/ubuntu/services
    cd /home/ubuntu/services
    git clone https://gitlab.com/zenprotocol/zen-oracle.git
  2. 2.
    Build the oracle service
    cd /home/ubuntu/services/zen-oracle
    ./paket restore
    msbuild src/zen-oracle.sln /p:Configuration=Release
  3. 3.
    Create /etc/systemd/system/zen-oracle.service service file as mentioned above
  4. 4.
    Put all the environment variables assignments in the file /home/ubuntu/services/scripts/env
  5. 5.
    Follow node deployment instructions and be sure to have the zen-node service enabled
  6. 6.
    Enable Zen-Oracle
    sudo systemctl enable zen-oracle
  7. 7.
    Start MongoDB
    sudo systemctl start mongodb
  8. 8.
    Start Zen-Oracle Server
    sudo systemctl start zen-oracle

Execution Scripts

  1. 1.
    Make sure all the environment variables are provided and correct
    • zen_path : path of the oracle committer
    • zen_wallet_password: password of the F# wallet
    • zen_node_uri: uri of the node
    • oracle_api: uri:port api port for oracle requests

Cron job

  • In order to commit at a precise time we suggest to use a script in a cron job to take care of the commitment.
Last modified 1yr ago