Flux docs
Search…
Data Validators
How to manually answer data requests or run a Validator with the testnet deployment of Flux on NEAR
Follow along with our Youtube tutorial! You should be able to set up your account and Data Validator Node within 10 minutes!

Prerequisites

  • You want to provide answers to data requests on the Flux Oracle (and earn tokens when mainnet launches!)
  • You are comfortable with the command line, GitHub, and crypto wallets
  • You acknowledge this is a testnet version intended to display some of the features of the mainnet and no real funds are exchanged

Setting up Account

If you haven't deployed a contract yet on NEAR, follow the instructions here to set up a mainnet or testnet account and the NEAR CLI, but don't worry about installing the Rust environment (since you aren't required to write any smart contracts to be a validator).
Mainnet:
Log on to the Oracle Mainnet Explorer and log in to your wallet in the top right corner.
Once your mainnet account is displayed at the top, you may notice you have no FLX in your account. In order to use Flux, you need FLX to start staking. You can buy FLX from for example Uniswap and bridge them over using Rainbow Bridge to NEAR.
Testnet:
Log on to the Oracle Testnet Explorer and log in to your wallet in the top right corner.
Once your testnet account is displayed at the top, you may notice you have no wNEAR in your account. To wrap your testnet NEAR, run the following commands in your terminal, replacing YOUR_TESTNET_ACCOUNT_ID with your testnet account id:
1
near call v2.wnear.flux-dev storage_deposit '{"account_id": "YOUR_TESTNET_ACCOUNT_ID"}' --accountId YOUR_TESTNET_ACCOUNT_ID --amount 0.00125 --gas=300000000000000
2
near call v2.wnear.flux-dev near_deposit "{}" --accountId YOUR_TESTNET_ACCOUNT_ID --amount 20 --gas=300000000000000
Copied!
Now you should be able to see the wNEAR amount you have wrapped from NEAR in your account.

Validating requests using Oracle Explorer

Scroll down the navigator and see a list of the requests that have been made. Select one of the recent ones. It will take you to the requests screen where you can view the request in further detail.
Find the bond size in the latest round, or the resolution window. This is the FLX (or wNEAR for testnet) necessary in order for an outcome to be finalized as the resolution. For requests that require a lot of financial security, the bond can be raised in order to deter bad actors from being able to manipulate data in order to exploit the system.
To participate in the validation of the request, scroll back to the top and hit the stake button to stake your FLX (or wNEAR for testnet) in what you believe to be the outcome, or simply copy someone else's answer and post the rest of the FLX (or wNEAR for testnet) needed to fill the bond. If the resolution window closes and nobody disputes your staked answer, you can hit the finalize button and get your rewards!
To find out more about how Data Requests go through the Oracle, check out the Data Requests section of the documentation.

Validating requests using Validator Node

The Oracle Validator Node is set up to automatically provide answers to the API requests that come into the Flux Oracle. If you have the capital and would like to earn a passive income with it, try it out!
The node will listen in on any requests coming to the oracle. If there is an API request that is valid, the node will call the API end_point and extract the outcome from the source_path
Clone the Oracle Validator Node repository and set up your .env file in the directory with either of the following:
Mainnet:
1
# Core options
2
DEBUG = false
3
4
# HTTP server options
5
HTTP_PORT = 28484
6
7
# Database
8
DB_PATH = ./
9
DB_NAME = flux_db_mainnet
10
11
# Providers
12
ACTIVATED_PROVIDERS = near
13
14
# NEAR options
15
NEAR_NO_LOGS = true
16
NEAR_CREDENTIALS_STORE_PATH = /PATH/TO/.near-credentials/
17
NEAR_ACCOUNT_ID = YOUR_MAINNET_ACCOUNT_ID
18
NEAR_RPC = https://rpc.mainnet.near.org
19
NEAR_CONTRACT_ID = v1.fluxoracle.near
20
NEAR_NETWORK_ID = mainnet
21
NEAR_MAX_STAKE_AMOUNT = 2.5
Copied!
Testnet:
1
# Core options
2
DEBUG = false
3
4
# HTTP server options
5
HTTP_PORT = 28484
6
7
# Database
8
DB_PATH = ./
9
DB_NAME = flux_db_testnet
10
11
# Providers
12
ACTIVATED_PROVIDERS = near
13
14
# NEAR options
15
NEAR_NO_LOGS = true
16
NEAR_CREDENTIALS_STORE_PATH = /PATH/TO/.near-credentials/
17
NEAR_ACCOUNT_ID = YOUR_TESTNET_ACCOUNT_ID
18
NEAR_RPC = https://rpc.testnet.near.org
19
NEAR_CONTRACT_ID = 05.oracle.flux-dev
20
NEAR_NETWORK_ID = testnet
21
NEAR_MAX_STAKE_AMOUNT = 2.5
Copied!
the NEAR_MAX_STAKE_AMOUNT is the maximum amount of FLX (or wNEAR for testnet) you would like to post towards the bond for a particular outcome within each resolution window for a given request. If the bond is less than your set amount, you will only post the bond amount.
It will not work if you don't enter the proper path to your .near-credentials folder and replace YOUR_MAINNET_ACCOUNT_ID/YOUR_TESTNET_ACCOUNT_ID with your testnet/mainnet account id.
First install the packages, then start the validator up using the following commands
1
npm install
2
npm start
Copied!
You should be able to see some output on what requests your validator is staking and providing outcomes in from your terminal, and you can check out its work in the Oracle Explorer.
DISCLAIMER — NO INVESTMENT ADVICE The Content is for informational purposes only, you should not construe any such information or other material as legal, tax, investment, financial, or other advice. Nothing contained in this document constitutes a solicitation, recommendation, endorsement, or offer by Open Oracle Association or any third party service provider to buy or sell any securities or other financial instruments in this or in any other jurisdiction in which such solicitation or offer would be unlawful under the securities laws of such jurisdiction. Purchase of Flux Token (FLX) does not constitute an investment contract. FLX is the native utility token of Flux Protocol.
Last modified 30d ago