---
# System prepended metadata

title: Upgrading Yoda to v1.2.1 on GuanYu testnet2

---

# Upgrading Yoda to v1.2.1 on GuanYu testnet2

Please follow the instructions below to upgrade Yoda program. Note that we are deprecating support of Docker execution due to its unreliability and resource consumption. To ensure that we have a robust testnet, we ask all validators to use AWS lambda as the executor while we continue testing testnet2.

In the near future, we will introduce more cloud function executors like Google Cloud Function or Microsoft Serverless. We will also revisiting Docker execution once we verify that AWS lambda is mature enough.

**Please complete the steps below as soon as possible so we can continue testing the testnet.**

## Step 1 Setup lambda executor

### For those who already use Lambda Executor
We are upgrading to a new runtime. Please replace your lambda cloud function with the following zip file: https://github.com/bandprotocol/bandchain/releases/download/v1.2.1/lambda-yoda.zip

### For those who need to switch from Docker to Lambda

In your [AWS account](https://aws.amazon.com/lambda), go to AWS Lambda Page and click Create function.

![](https://i.imgur.com/YdtXY6A.png)

### Follow the following steps:
- 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.

![](https://i.imgur.com/YE0hiCE.png)

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

![](https://i.imgur.com/GNOHIaj.png)

Scroll down to `Function code` panel and click `Actions -> Upload a .zip file`. You will need to upload [the runtime zip](https://github.com/bandprotocol/bandchain/releases/download/v1.2.1/lambda-yoda.zip).

![](https://i.imgur.com/ZJqZEhK.png)

![](https://i.imgur.com/jZKbUTZ.png)

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

![](https://i.imgur.com/VVfKEQj.png)

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

![](https://i.imgur.com/nx15jnH.png)

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.

![](https://i.imgur.com/GRNlpZj.png)

![](https://i.imgur.com/zlgJavI.png)

![](https://i.imgur.com/qhyFdVY.png)

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.

```bash
curl --location --request POST '<your_api_endpoint>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "executable": "IyEvdXNyL2Jpbi9lbnYgcHl0aG9uMwoKaW1wb3J0IHN5cwoKZGVmIG1haW4oZGF0YSk6CiAgICByZXR1cm4gZGF0YQoKCmlmIF9fbmFtZV9fID09ICJfX21haW5fXyI6CiAgICB0cnk6CiAgICAgICAgcHJpbnQobWFpbigqc3lzLmFyZ3ZbMTpdKSkKICAgIGV4Y2VwdCBFeGNlcHRpb24gYXMgZToKICAgICAgICBwcmludChzdHIoZSksIGZpbGU9c3lzLnN0ZGVycikKICAgICAgICBzeXMuZXhpdCgxKQo=",
    "calldata": "\"Hello lambda\"",
    "timeout": 3000
}'
```

The expected result should be:
```json
{
    "returncode": 0,
    "stdout": "Hello lambda\n",
    "stderr": "",
    "version": "lambda:v1.0.3"
}
```

## Step 2 Install a version of yoda


### Build new version of yoda
```bash
cd bandchain/chain
git checkout master
git pull
git checkout v1.2.1
make install
```

### Confirm Yoda version
```bash
yoda version
# should show v1.2.1
```

### Config executor endpoint
```bash
yoda config executor "rest:<your_aws_lambda_endpoint>?timeout=10s"
```

### Restart yoda service
```bash
sudo systemctl restart yoda
```

## Step 3 Activate Oracle Functionality
Check on guanyu-testnet2.cosmoscan.io/validators if your validator has been deactivated. If so you must submit an activate transaction to your node. Note that you must wait 10 minutes after you get deactivated.

```
bandcli tx oracle activate --from <your_key>
```

It is very important that you keep your oracle status activate all the time. With the current parameter setting, validators (and their delegators) with inactive oracle status get 70% lower staking rewards.