Oracle client written in bash that utilizes secure scuttlebutt for offchain message passing along with signed price data to validate identity and authenticity on-chain.
Goals of this new architecture are:
- Scalability,
- Reduce costs by minimizing number of ethereum transactions and operations performed on-chain,
- Increase reliability during periods of network congestion,
- Reduce latency to react to price changes,
- Make it easy to on-board price feeds for new collateral types, and
- Make it easy to on-board new Oracles.
There are currently two main modules:
Each Feed runs a Feed client which pulls prices redundantly with Setzer and Oracle Suite/Gofer, signs them with an ethereum private key, and broadcasts them as a message to the redundant p2p networks (e.g. scuttlebutt and libp2p).
Relays monitor the broadcast messages, check for liveness, and homogenize the pricing data and signatures into a single ethereum transaction to be posted to the on-chain oracles.
Ubuntu 22.04
nix-build (Nix) 2.13.2
To build from inside this repo, clone and run:
nix-build
The setup scripts can also be used configure Omnia as a feed running with systemd
:
sudo ./setup/run_feed.sh --gofer <PATH_OF_CONFIG> --omnia <PATH_OF_CONFIG> --spire <PATH_OF_CONFIG>
for example:
sudo ./setup/run_feed.sh --gofer /home/oracles/gofer.json --omnia /home/oracles/omnia_feed.json --spire /home/oracles/spire1.json
The setup scripts can also be used configure Omnia as a relay running with systemd
but first make sure spire is running:
sudo ./setup/run_it_relay.sh --gofer <PATH_OF_CONFIG> --omnia <PATH_OF_CONFIG> --spire <PATH_OF_CONFIG>
for example:
sudo ./setup/run_it_relay.sh --gofer /home/oracles/gofer.json --omnia /home/oracles/omnia_relay.json --spire /home/oracles/spire1.json
If you want to run multiple omnia's feed instances then you have to change the name of the systemd files(omnia.service
, spire-agent.service
) which are generated by ./setup/run_feed.sh
or ./setup/run_it_relay.sh
and change the config files path for shell script for example: sudo ./setup/run_it_relay.sh --omnia /home/oracles/omnia2.json --spire /home/oracles/spire.json
and run the shell script again.
you can run the omnia, spire and gofer with systemd by these command:
systemctl start omnia.service
systemctl start gofer-agent.service
systemctl start spire-agent.service
spire is installed through nix.
This is based on libp2p which is a peer-to-peer networking protocol designed to enable decentralized communication and file sharing over the internet. It is a modular, open-source networking protocol that allows nodes to communicate with each other directly, without the need for a central server or infrastructure.
spire have config file which consists of different attributes
"transport":{
"libp2p": {
"directPeersAddrs":[]}}
this attribute is reponsible for the making the peers, So we have to give the info for example /ip4/192.168.18.109/tcp/37705/p2p/12D3KooWPFpaE13gph8p6jdNGJv1M6fwDro8kdst53MUzVpuSJUL
i.e "<ip-version>/<host>/<protocol>/<port>/<type>/<peer_id>" w.r.t the quorum of median. You can get the peer address from the logs of spire, As we are running systemd services, So we have to use journalctl for getting the logs.
sudo journalctl -u <spire-agent.service> -n 100 -b -f
spire agent -c <CONFIG_PATH> --log.verbosity debug
systemctl start <spire-agent.service>
we should run the 3 feeds with the 3 spires every feed should have their own omnia means the config file have the right omnia addr pasted in feed object of spire's config
The installed Scuttlebot config can be found in ~/.ssb.config
, more details
about the Scuttlebot config.
Adding a new configuration parameter to ethereum
relay config section: gasPrice
.
It consist of 3 available options:
source
- source of gas price. Default value: node
There is currently only a single value available.
node
- Getting Gas Price from node (usingcast gas-price
).
multiplier
- A number the gas pice will be multiplied by after fetching. Default value: 1
Example configuration:
{
"mode": "relay",
"ethereum": {
"from": "0x",
"keystore": "",
"password": "",
"network": "goerli",
"gasPrice": {
"source": "node",
"multiplier": 1
}
},
"transports":["ssb"],
"feeds": [
"0xdeadbeef123"
],
...
}