Public Deployment of Gladios-Testnet Nodes (Second Phase/second part)

Due to the inaccessibility of the real world off-chain data, the blockchain needs an oracle platform to extract trustable data sources from the real world. Ensuring the validity and safety of the data sources is one of the vital parts of building the validator nodes which further guarantees the accuracy of the price quotation on Gladios.

Currently, there are two ways to extract off-chain data sources on Gladios testnet
1. Directly apply data sources supported by Ares Procol to configurate
2. Apply self-built off-chain data sources

Operate official data sources

The IP address of price quotation server identical with official address :
https://api.aresprotocol.io/

./target/release/gladios-node — base-path /tmp/aura/one — name ocw_one — telemetry-url ‘wss://telemetry.polkadot.io/submit/ 0’ — warehouse http://api.aresprotocol.io/ — validator

parameters: (compulsory) — warehouse specifies IP address of ares price quotation server.
parameters: (compulsory) — validator specifies launching of a validator node.

*before running data sources, you need to run validator nodes and operate staking; for specification please reach out to: node deployment of Gladios testnet( second phase/ third part)

Data Source Interface

Enter: “http://warehouseui.aresprotocol.io/"; it currently supports 77 kinds of trading pairs.

Data sources are from Bitstamp, Bitfinex, OKEx, Binance, Kucoin, Huobi, Coinbase etc. exchanges for cryptocurrency. According to the officially authorised weight percentage, it will manage to do a live price quotation.

In each 1 minute, the Warehouse price quotation system will collect trading figures from each data source to proceed most recent price quotation. In the meantime, the data figures will be saved every 5 mins into the database.

Build data sources

While you are choosing self-built off-chain data sources, you have Docker and compile original data sources, those two ways to turn to.

Method A: Run Docker

Getting the source
You can get the source from github, run

git clone https://github.com/aresprotocols/warehouse.git

go to the deploy folder

cd warehouse/price_server/deploy

Configuration
Copy env_example to .env

cp env_example .env

modify .env file and change mysql password

MYSQL_ROOT_PASSWORD=xxx

If you want to modify other configs, you can follow section Configuration to modify the configs/config.toml file

Up service
Use docker-compose to up service

docker-compose up -d

Down service
Use docker-compose to down service

docker-compose down

Method B: Compile the source code

Extracting data sources
You can get the source from github, run

git clone https://github.com/aresprotocols/warehouse.git

Compiling source code requires a go
Install with ubuntu

## install
wget https://studygolang.com/dl/golang/go1.13.4.linux-amd64.tar.gz
tar xfz go1.13.4.linux-amd64.tar.gz -C /usr/local
## config
vim ~/.bashrc
export GOPATH=/usr/local/go
export PATH=$GOPATH/bin:$PATH
source ~/.bashrc

Install with mac

brew install go

Once you installed, then execute

cd price_server
go build

Installation completed.

Configuration
Before run, you should config your project. Using the editor you like, such as

vim conf.toml

There is some config you need to know.

port = 5566 # server listen, default is 5566

proxy = “http://127.0.0.1:7890/" # your proxy ip and port, or

proxy = “” # Not use proxy

symbols = [“btc-usdt”, “eth-usdt”, “dot-usdt”, “xrp-usdt”] #Transaction pair you interesting

[mysql] # add your mysql config in here,db mean database name, just use a name you like

Configure mysql
Install mysql server and start.

Install with ubuntu

sudo apt update
sudo apt install mysql-server

Install with mac

brew install mysql

If mysql version >= 8.0, config with:

mysql -u root -p
use mysql;
GRANT ALL ON *.* TO ‘root’@’%’;
flush privileges;
ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘$yourpassword$’ PASSWORD EXPIRE NEVER;
ALTER USER ‘root’@’%’ IDENTIFIED WITH mysql_native_password BY ‘$yourpassword$’;
FLUSH PRIVILEGES;

Start
Run

./start.sh

Set Warehouse API

Acquire exchange price
URL: api/getPrice/$symbol/$market

Acquire prices after aggregation
URL: api/getPartyPrice/$symbol

Acquire all trades of a certain trade pair
URL: api/getPriceAll/$symbol

Acquire bulk of prices of trade pairs
URL: api/getBulkPrices

Acquire config request
URL: api/getReqConfig

Acquire error info requested from exchanges
URL: api/getHttpErrorInfo

Set price weights
URL: api/setWeight

For details see Warehouse interface documentation (https://docs.aresprotocol.io/docs/en/WarehouseApi)

It includes api interface, relevant showcase and effects you may use when you are self-building relevant data.

Data source interface display

Open https://warehouseui.aresprotocol.io/”, Click [switch source] and input ip address of the specified ARES price quotation server in the box; for example http://167.179.113.240:5566/,click「add source」.

After adding the source, you need to switch to the new IP address, as below:

You will see the quoted price computed according to the weight percentage.

After you build the data source, generate the latest quotation database.

This is the end of the second part, thanks for reading. Specification on “deploying the nodes, running validator nodes’’ will be manifested in the next article “Public deployment of Gladios — test network nodes (second phase/third part). ”

Ares Protocol-decentralised cross-chain oracle platform in Polkadot ecosystem.

Ares Protocol is a decentralized cross-chain Oracle that truly implements a new generation of cross-chain Oracle service protocol for data on-chain verification, and is the first to open a compensation channel for data users who suffer business losses from using Oracle data.

Ares Protocol is a stochastic secure Oracle solution developed based on the Substrate framework, supporting hybrid Babe and off-chain workhorses, incorporating Polkadot’s latest on-chain governance, bringing the Optimistic Rollup challenge model into the Oracle space, supporting the Ink contract ecosystem, and bringing better quality Oracle services to Defi developers.

🌐 Ares Protocol Social Media Telegram Group:

Telegram Group: https://t.me/aresprotocollab
Telegram Channel:
https://t.me/AresProtocolAnnouncements
Twitter:
https://twitter.com/AresProtocolLab
Facebook:
https://www.facebook.com/aresprotocollab
Instagram:
https://www.instagram.com/aresprotocollab/
Medium:
https://aresprotocollab.medium.com
Discord:
https://discord.gg/cqduK4ZNaY
Reddit:
https://www.reddit.com/r/AresProtocolLabs/
Email:
info@aresprotocol.io
Youtube:
https://www.youtube.com/channel/UCgwY4NwkoP8Hx1Fqmp_rJUw

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ares Protocol

Ares Protocol

2.6K Followers

The first chain-verified decentralised cross-chain oracle service protocol, please visit this link www.aresprotocol.io.