BandChain GuanYu Testnet#2: Update & How to Join as a Validator

Sorawit Suriyakarn
Band Protocol
Published in
8 min readAug 3, 2020

Dear Band Community,

After the initial release of testnet#1, we will be now upgrading to testnet#2 after two weeks of testing. Below is a report on some issues and mitigation that we are preparing in our testnet#2 and the newly planned testnet#3.

On July 30 2020, we discovered memory leak and state pruning issues that existed on the Cosmos-SDK 0.38.X node software upon investigation with the Cosmos team and our genesis validators. This is an issue with Cosmos-SDK and its dependencies (Tendermint + iAVL tree), and not directly with BandChain oracle module itself.

We are grateful to contribute and work alongside the Cosmos team to discover bugs and participate as an ecosystem partner as well as a community member.

To our validators who have helped by reporting this issue and with network testing, we thank you very much — testnets are designed to stress-test, monitor and iron out bugs in the network like this one prior to Mainnet release.

Cosmos team has responded to this issue by releasing Launchpad release v0.39 with long term support intention. See the following for more information:

As a result of this error, we will stop running band-guanyu-testnet1 chain and launch a new band-guanyu-testnet2 based on the updated software — BandChain v1.2.3. Notable changes from GuanYu testnet 1 include:

  • Update BandChain software to version 1.2.3
  • Update genesis files and peer addresses
  • Yoda configuration has been updated to add more features

We’ll be adding another testnet #3 in the future to test migration from BandChain Phase 0 Wenchang deployment to the BandChain Phase 1 GuanYu prior to the full public launch.

The deadline for community validators to join GuanYu Testnet #2 will be 5th August Wednesday 12PM UTC, please mark this into your calendars. Below you will find the instructions on how to join GuanYu Testnet #2.

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 testnet2 is v1.2.3.

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 testnet2 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 AWS Lambda (through REST interface). In future releases, yoda will support more executors and allow you to specify multiple executors to add redundancy.

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

We are excited to have a supportive group of validators helping us shape the BandChain decentralized oracle network and this second testnet will be bringing us another step closer towards the Phase 1 Mainnet which will allow nodes to additionally earn data request fees.

To ensure that the BandChain Phase 1 GuanYu Mainnet upgrade is as successful as the Wenchang launch, it is important for validators to actively participate in the testnet and learn the differences between Wenchang & GuanYu. If you have any issues with running or monitoring BandChain node, be sure to reach out to us on Discord ASAP to ensure that issues are solved in preparation for Mainnet.

We look forward to seeing you on GuanYu Testnet #2 — let’s make BandChain Phase 1 GuanYu Mainnet as successful as the Wenchang launch!

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

--

--