Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Instruction for apply to be an oracle validator on Guanyu mainnet

Bun Uthaitirat edited this page Oct 13, 2020 · 1 revision

Prerequisites

  1. You need to setup a Lambda function executor before running yoda. We recommend using different lambda from testnet, so you can keep track of the traffic separately. If you haven't done this setup yet, please follow the instructions on this page
  2. A Guanyu node that already synced to current block.
  3. The correct yoda CLI version installed (v1.2.6)
yoda version
> 1.2.6

Configure yoda

  1. Configure yoda's basic function
rm -rf ~/.yoda # clear old config if exist
yoda config chain-id band-guanyu-mainnet
yoda config node http://localhost:26657
yoda config validator $(bandcli keys show YOUR_WALLET -a --bech val)
yoda config broadcast-timeout "5m"
yoda config rpc-poll-interval "1s"
yoda config max-try 5
  1. yoda work with multiple reporter addresses to allow it to submit multiple transactions concurrently. You can add new addresses using yoda keys command.
yoda keys add REPORTER_1
yoda keys add REPORTER_2
yoda keys add REPORTER_3
yoda keys add REPORTER_4
yoda keys add REPORTER_5
  1. Setup lambda executor
yoda config executor "rest:<your_aws_lambda_endpoint>?timeout=7s"

Start yoda service

  1. Create the following config at /etc/systemd/system/yoda.service
[Unit]
Description=Yoda Daemon
After=network-online.target 

[Service]
User=ubuntu
ExecStart=/home/ubuntu/go/bin/yoda run
Restart=always
RestartSec=3
LimitNOFILE=4096

[Install]
WantedBy=multi-user.target
  1. Install the service and start the yoda service
sudo systemctl enable yoda
sudo systemctl start yoda

You can tail the log output with journalctl -u yoda.service -f. Example logs are provided below. Once verified, you can stop tailing the log by typing Control-C.

... systemd[...]: Started Yoda Daemon.
... yoda[...]: I[...] ⭐  Creating HTTP client with node URI: tcp://localhost:26657
... yoda[...]: I[...] 🚀  Starting WebSocket subscriber
... yoda[...]: I[...] 👂  Subscribing to events with query: tm.event = 'Tx'...

Activate Oracle Functionality

  1. You must supply your reporter addresses (the addresses that yoda controls) with some BAND tokens to trigger account creations
bandcli tx multi-send 1uband $(yoda keys list -a) \
  --from YOUR_WALLET \
  --chain-id band-guanyu-mainnet
  1. You can now register the reporter addresses to your validator, again using bandcli
bandcli tx oracle add-reporters $(yoda keys list -a) \
  --from YOUR_WALLET \
  --chain-id band-guanyu-mainnet
  1. You are ready to become an oracle provider, send MsgActivate to activate yourself as an oracle provider.
bandcli tx oracle activate \
  --from YOUR_WALLET \
  --chain-id band-guanyu-mainnet

If everything works well, you can query oracle validator status and expect is_active to be true

bandcli query oracle validator $(bandcli keys show -a YOUR_WALLET --bech val)
# Expect output
{
  "is_active": true,
  "since": ...
}