A simplified collector node concept from Orcfax. Original documentation available to maintainers can be found: here.
An Orcfax collector node now:
- Uses cron to request price-feed data every 1x minute.
- Via this Python script requests the price-feed data via Orcfax's enhanced version of Chronicle Labs gofer.
- Parses the results from
gofer
and send the results to a validator web-socket.
A small recipe for installation on a collector node machine.
NB. the following assumes we're in the home folder root, i.e.
~/.
and a username oforcfax
, i.e./home/orcfax/
.
mkdir -p collector && cd collector
wget https://raw.githubusercontent.com/orcfax/collector-node/main/collector.py -O collector.py
wget https://raw.githubusercontent.com/orcfax/collector-node/main/requirements/requirements.txt -O requirements.txt
python3 -m venv venv
source venv/bin/activate
python -m pip install requirements.txt
wget https://github.com/orcfax/node-id/releases/download/0.0.1/node-id_0.0.1_Linux_x86_64 -O node-id
chmod +x node-id
./node-id -w ""
NB. the
-w
argument is legacy and replaced with the use of validator.env in this repository.
wget https://github.com/orcfax/oracle-suite/releases/download/0.0.1/gofer_0.0.1_Linux_x86_64 -O gofer
chmod +x gofer
crontab -e
# Required.
ORCFAX_VALIDATOR=
NODE_IDENTITY_LOC=
NODE_SIGNING_KEY=
CNT_DB_NAME=
OGMIOS_URL=
# Optional.
OGMIOS_VERSION=v6
* * * * * /home/orcfax/collector/venv/bin/python /home/orcfax/collector/collector.py 2>&1 | logger -t orcfax_collector
NB.
crontab
will read the environment variable from its own context when it is set there.
The collector node should be installed. You can view log output in the syslog.
sudo tail -f /var/log/syslog | grep orcfax_collector
Setup a virtual environment venv
and install the local development
requirements as follows:
python3 -m venv venv
source venv/bin/activate
python -m pip install -r requirements/local.txt
A make
recipe is included, simply call make upgrade
. Alternatively run
pip-upgrader
once the local requirements have been installed and follow the
prompts. requirements.txt
and local.txt
can be updated as desired.
python -m tox
python -m tox -e py3
python -m tox -e linting
Pre-commit can be used to provide more feedback before committing code. This reduces reduces the number of commits you might want to make when working on code, it's also an alternative to running tox manually.
To set up pre-commit, providing pip install
has been run above:
pre-commit install
This repository contains a default number of pre-commit hooks, but there may be others suited to different projects. A list of other pre-commit hooks can be found here.
The Makefile
contains helper functions for packaging and release.
Makefile functions can be reviewed by calling make
from the root of this
repository:
help Print this help message
pre-commit-checks Run pre-commit-checks.
tar-source Package repository as tar for easy distribution
upgrade Upgrade project dependencies