suite

package module
v0.0.0-...-9e55092 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2024 License: AGPL-3.0 Imports: 0 Imported by: 0

README

Oracle Data Collector Suite

A set of tools that can be used to run data collectors for oracle networks. Original source from ChronicleLabs and updated to provide price-feed data according to Orcfax's collector format.

Gofer

A tool to fetch and calculate reliable asset prices.

see: Gofer CLI Readme

To build

Goreleaser is required. Once installed, users can run a command such as:

make gofer-snapshot

Release builds can be made using:

make gofer-release

Releases are currently managed by the GitHub release action in this repository.

Configuring gofer

The oracle suite comes packaged with a number of api sources which can be leveraged. The desired combination of these sources, the data requeested from each, and the minimum number of responses are set within the config-gofer.hcl file.

Additional api sources must be added along with parameters for how responses will be passed into json.

eg

  origin "coinbase" {
    type = "tick_generic_jq"
    url  = "https://api.pro.coinbase.com/products/$${ucbase}-$${ucquote}/ticker"
    jq   = "{price: .price, time: .time, volume: .volume}"
  }

Then sources can be grouped into a data_model and the min_values for publication set; the min establishes how many sources must be included in a publication.

The Orcfax system requires that a minimum of 3 sources participate in each publication in order to triangulate the data being reported.

eg

  data_model "ADA/USD" {
    median {
      min_values = 3
      origin "bitstamp" { query = "ADA/USD" }
      origin "coinbase" { query = "ADA/USD" }
      origin "kraken" { query = "ADA/USD" }
      origin "kucoin_prices_simple" { query = "ADA/USD" }
      origin "bitfinex_simple" { query = "ADA/USD" }
      origin "hitbtc" { query = "ADA/USD" }
    }
  }

It is advisable to group more than the minimum necessary sources within the data model in order to provide contingencies for when api sources fail.

Submitting a Query

Once the config file is parameterized, users will need to rebuild using make gofer-snapshot.

By appending the binary= output (eg dist/gofer_linux_amd64_v1/gofer), users can now utiilize gofer commands. Given the example above, users can query their configured sources, and pass their responses into json, by using the following:

dist/gofer_linux_amd64_v1/gofer data ADA/USD -o orcfax

Any number of {quote}/{base} queries can be listed and executed together.

Signing

It is possible to sign the checksums and binaries associated with a release but this is still in testing. A GPG signature is required. Currently the process is configured to select an admin@orcfax.io signing key.

To create a key follow the instructions on running:

gpg --full-generate-key

The GitHub documentation provides useful information about generating a GPG key.

License

The GNU Affero General Public License

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "unknown"

Version that can be used by commands. It is set by the linker during build.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL