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

1
[Unit]
2
Description=Oracle
3
After=network.target
4
5
[Service]
6
Type=simple
7
EnvironmentFile=/home/ubuntu/services/scripts/env
8
WorkingDirectory=/home/ubuntu/services/zen-oracle/src/Oracle/bin/Release
9
ExecStart=/usr/bin/mono /home/ubuntu/services/zen-oracle/src/Oracle/bin/Release/zen-oracle.exe s
10
Restart=on-failure
11
12
[Install]
13
WantedBy=multi-user.target
Copied!

Oracle Service

  1. 1.
    Get the oracle service (from GitLab)
    1
    mkdir /home/ubuntu/services
    2
    cd /home/ubuntu/services
    3
    git clone https://gitlab.com/zenprotocol/zen-oracle.git
    Copied!
  2. 2.
    Build the oracle service
    1
    cd /home/ubuntu/services/zen-oracle
    2
    ./paket restore
    3
    msbuild src/zen-oracle.sln /p:Configuration=Release
    Copied!
  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
    1
    sudo systemctl enable zen-oracle
    Copied!
  7. 7.
    Start MongoDB
    1
    sudo systemctl start mongodb
    Copied!
  8. 8.
    Start Zen-Oracle Server
    1
    sudo systemctl start zen-oracle
    Copied!

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 2mo ago