BandChain GuanYu Testnet#1: How to Join as a Validator

Sorawit Suriyakarn
Band Protocol
Published in
8 min readJul 15, 2020

Last week, we announced that Band Protocol is now ready to proceed towards the mainnet upgrade to Phase 1 which will bring oracle functionality to the BandChain Mainnet. We’re excited to share this guide on how to join the Phase 1 (GuanYu) Testnet #1 as a validator and learn more about the responsibilities going forward.

Validators participating in the Guan Yu Testnet #1 will have the first-mover advantage to set up a Phase 1 Mainnet node, being the first to capture data request fee upon Mainnet release and opportunity for delegation from the Band Foundation.

This is an important time for validators to help Band Protocol emerge as a more resilient and secure oracle solution by uncovering attack vectors on the network and oracle functionality.

Step 1: Setting Up Validator Node

For this guide, we are assuming that you are running an Ubuntu 18.04 LTS machine that allows incoming connections on port 26656. We start by installing utility tools and Golang on the machine.

Next, you will need to clone and build BandChain. The canonical version for this GuanYu testnet1 is v1.0.5.

Initialize the blockchain environment, download the official testnet genesis file, and add the initial peers to your node.

With all configurations ready, you can now start your node. In this tutorial, however, we will show you a simple way to set up systemd to run the node daemon with auto-restart.

  1. Create a config file, using the contents below, at /etc/systemd/system/bandd.service. You will need to edit the default ubuntu username to reflect your machine’s username. Note that you may need to use sudo as it lives in a protected folder.

2. Install the service and start the node.

You can tail the log output with journalctl -u bandd.service -f. If all goes well, you should see that the node daemon has started syncing. Now you should wait until your node caught up with the most recent block.

... bandd: I[..] Executed block  ... module=state height=269819 ...
... bandd: I[..] Committed state ... module=state height=269819 ...
... bandd: I[..] Executed block ... module=state height=269820 ...
... bandd: I[..] Committed state ... module=state height=269820 ...

See the explorer for the height of the latest block. Syncing should take a few hours depending on your internet connection.

⚠️ NOTE: You should not proceed to the next step until your node caught up to the latest block.

Step 2: Becoming a Validator

Create your account using bandcli and request 10 testnet BAND tokens with curl. Feel free to change YOUR_WALLET to whatever wallet name you want.

Send a transaction to apply as a validator. You can change YOUR_MONIKER to any name you want reflected on the block explorer.

Once the transaction is mined, you should see yourself on the validator page.
Congratulations — you are now a working BandChain GuanYu testnet1 validator! Don’t worry if you have low voting power, we will delegate more testnet tokens to your validator node within a few days.

Step 3: Setting Up Yoda — The Oracle Daemon

For phase 1, BandChain validators are also responsible for supplying oracle data to BandChain. Whenever a person submits MsgRequest to BandChain, the chain will autonomously choose a subset of active oracle validators to perform the task. Chosen validators must submit MsgReport to BandChain within a given timeframe as specified as a chain parameter (100 blocks in this testnet). We provide a program called yoda to do this task for you.

We first start by config basic setting of yoda.

yoda work with multiple reporter addresses to allow it to submit multiple transactions concurrently. You can add new addresses using yoda keys command.

Yoda uses an external executor to resolve requests to data sources. Currently, it supports two types of executors: Docker and AWS Lambda (through REST interface). You can choose either one to proceed. In future releases, yoda will support more executors and allow you to specify multiple executors to add redundancy.

Choice 1: Using Docker

To use docker as an executor, you first need to install Docker on the machine. You can follow the instruction here.

Once installed, pull Band’s runtime docker image from Docker Hub and configure yoda to use the docker image as its executor.

Choice 2: Using Amazon Lambda

Alternatively, you can use AWS Lambda as the executor. In your AWS account, go to AWS Lambda Page and click Create function.

Follow the following steps:
- Select Author from scratch
- Fill your Function name It will be your endpoint route.
- Select Runtime to Python 3.7
- For permission if you don’t have an existing role, just create a new one.

Click Create function. Once everything is complete, You will see this page.

Scroll down to Function code panel and click Actions -> Upload a .zip file. You will need to upload the runtime zip.

Scroll down to “Environment variables” section and add 2 environment variables: MAX_EXECUTABLE to 8192 (8 MB) and MAX_DATA_SIZE to 256.

Scroll down to Basic Settings and update the runtime configurations. We recommend using 512MB RAM and 12 seconds timeout.

We will use API Gateway for receiving a request from our yoda program. Let’s create a new trigger by clicking + Add trigger -> API Gateway and follow the wizard to create a new API endpoint connecting to your Lambda function.

Once completed, you will see the endpoint API endpointthat will be used as the endpoint URL to test your Lambda function. You can test it with CURL.

The expected result should be:

If all goes well, you can configure the endpoint as yoda’s executor.

Once you have set up yoda’s executor, you can now start the service. We will use systemd for this guide, similar to how you run bandd.

  1. Create the following config at /etc/systemd/system/yoda.service.

2. Install the service and start the yoda service.

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'...

Step 4: Activate Oracle Functionality

Once you have yoda up and running, you can now activate your validator to serve as an oracle provider.

In BandChain phase 1, validators who do not maintain active oracle provider status get significantly lower block rewards.

First, you must supply your reporter addresses (the addresses that yoda controls) with some BAND tokens to trigger account creations.

You can now register the reporter addresses to your validator, again using bandcli.

At this point, you are ready to become an oracle provider, send MsgActivate to activate yourself as an oracle provider.

That’s it! You can verify that your validator is now an oracle provider on the block explorer. Your yoda process must be responding to oracle requests assigned to your node. If the process misses a request, your oracle provider status will automatically get deactivated and you must send MsgActivate to activate again after a 10-minute waiting period and make sure that yoda is up.

Closing Remarks

To all new, existing and interested validators — this is your chance to participate directly in securing smart contracts and decentralized applications in DeFi, DAOs, gaming, prediction, identity and more!

Validators will be responsible for fulfilling data requests in return for a fee while ensuring that smart contracts are securely connected with external data and APIs.

Validators will receive direct support from the Band Protocol team and we look forward to having you on the BandChain decentralized oracle network. If you have any questions, please message us on our Discord — the main communication channel for validators.

Thank you in advance to everyone that runs a validator node on BandChain — every effort on the testnet helps increase the degree decentralization and resilience of the Band Protocol oracle network for the numerous partners we are working with on oracle integrations.

This officially begins our process to kickstart oracle integration onto mainnet along with all of our partners.

Onwards and upwards!

About Band Protocol
Band Protocol is a cross-chain data oracle platform that aggregates and connects real-world data and APIs to smart contracts. Blockchains are great at immutable storage and deterministic, verifiable computations — however, they cannot securely access data available outside the blockchain networks. Band Protocol enables smart contract applications such as DeFi, prediction markets, and games to be built on-chain without relying on the single point of failure of a centralized oracle. Band Protocol is backed by a strong network of stakeholders including Sequoia Capital, one of the top venture capital firms in the world, and the leading cryptocurrency exchange, Binance.

Website | Whitepaper | Telegram | Medium | Twitter | Reddit | Github

--

--