Skip to content
BisonaiPublic

Repository files navigation

Orakl Network

This repository is split to onchain and offchain oracle implementation.

You can learn more about the Orakl Network from documentation.

Run dockers locally

VRF / Request-Response

Run the following command to build all images

docker-compose -f docker-compose.local-core.yaml build

Set wallet credentials, ADDRESS and PRIVATE_KEY values, in the .core-cli-contracts.env file. You can update CHAIN to either baobab and cypress. For running the VRF service, update vrf-keys-baobab.json or vrf-keys-cypress.json. If the chain is not localhost, Coordinator and Prepayment contracts won't be deployed. Instead, Bisonai's already deployed contract addresses (VRF, RR) will be used. Run the following command to start the VRF / RequestResponse service:

SERVICE=vrf docker-compose -f docker-compose.local-core.yaml up --force-recreate -d

SERVICE is an env variable that will be used to spin up the specified service. The options are rr and vrf stands for Request-Response and VRF, respectively.

Note that the current docker implementation is designed to run a single service, either rr or vrf, at a time. Therefore, it's highly recommended to add --force-recreate when running docker-compose up command. That will restart all containers thus removing all the modified data in those containers.

Here is what happens after the above command is run:

  • api, postgres, redis, and json-rpc services will start as separate docker containers
  • postgres will get populated with necessary data:
    • chains
    • services
    • vrf keys in case if the service is vrf
    • listener (after contracts are deployed)
    • reporter (after contracts are deployed)
  • if the chain is localhost:
    • migration files in contracts/v0.1/migration/ get updated with provided keys and other values
    • contracts/v0.1/hardhat.config.cjs file gets updated with PROVIDER_URL
    • relevant coordinator and prepayment contracts get deployed

To start core microservices (listener, worker, reporter) as a singleton service run:

  • production mode
    yarn start:core:vrf
    # or
    yarn start:core:request_response
  • development mode
    yarn dev:core:vrf
    # or
    yarn dev:core:request_response

The microservices can also be started separately in any arbitrary order by replacing core in the above commands with either listener, worker, or reporter

Main Elements

API

The API serves as an interface for other services (VRF, RR, CLI) to access service data.

CLI

Includes commands that node operators can use to manage VRF and RR.

Contracts

Contains all onchain contracts for the service and related scripts.

Core

Contains offchain code for VRF and RR.

Delegator

A service to run fee payer for delegated transactions by push oracles.

Node

Contains offchain code for offchain aggregation and related services.

Others

  • Audit: Holds contract audit details.
  • Dockerfiles: Includes Dockerfiles for deployment.
  • Sentinel: Internal alarm service for stable service maintenance.

Releasing

Create release tags (<service>/vX.Y.Z) with the Release workflow, not by hand. It runs only on master, checks the version (X.Y.Z, tag unused, greater than the service's latest tag) and that the gate check of the master HEAD commit is green (waits while it runs), then pushes an annotated tag with the orakl-bot App token. The tag push runs tag+deploy (build, kairos deploy, pre-release); promote to mainnet with the Promote workflow.

# dry run: all checks, prints the tag, pushes nothing
gh workflow run release.yaml --ref master -f service=node -f version=0.0.53 -f dry_run=true
# release
gh workflow run release.yaml --ref master -f service=node -f version=0.0.53 [-f notes="tag message"]

Versions are linear per service (no patch releases on an older line). Until a tag ruleset restricts */v* tag creation to this workflow, manually pushed tags still deploy and skip these version checks; once it exists they are rejected.