vega_openoracle_demo

command module
v0.0.0-...-915a8db Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: AGPL-3.0 Imports: 21 Imported by: 0

README

vega_openoracle_demo

This repository provide a small package to send prices feeds to the vega network using the open oracle format. The code doing so is located under the /prices folder, and exposes a Prices type and a single public method named Send.

The requirement to use this package are:

  • a vega wallet mnemonic
  • an ethereum private key (hex formatted)
  • the address of a vega node on the network with the grpc API enabled.

The Prices type will do the following:

  • convert the price inputs into the open oracle using sign the payload, and return using the code.vegaprotocol.io/oracles-relay/openoracle package.
  • a valid OracleSubmission transation is then built
  • then emitted to the vega network using the wallet specified.
Demo

A demonstration binary is available at the root. It can be installed using go 1.20.x.

$ go install github.com/jeremyletang/vega_openoracle_demo

A configuration is required to run it, here's an example:

node_addr = "n06.testnet.vega.xyz:3007"
ethereum_private_key = "0xd58575992709768084bf898fcafbb07d25746c566f53a75ee428708833677d2b"
wallet_mnemonic = "elder december include distance diary pizza bean churn fatigue repeat museum hello unfair march always loyal million video maple rich illegal industry borrow coral"

Assuming this configuration is save in a file name config.json, we could send price to vega with the following command:

$ vega_openoracle_demo -config=config.json -price=3354500 -timestamp=1699613159 -asset=BTC

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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