Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeremyletang/vega_openoracle_demo
https://github.com/jeremyletang/vega_openoracle_demo
Last synced: 25 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jeremyletang/vega_openoracle_demo
- Owner: jeremyletang
- License: agpl-3.0
- Created: 2023-11-12T14:56:04.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2023-11-13T11:04:27.000Z (12 months ago)
- Last Synced: 2024-06-21T01:56:38.499Z (5 months ago)
- Language: Go
- Size: 26.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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
```