ODIN Protocol
  • Introduction
  • ODIN NODE
  • Before Getting Started
    • Prerequisites
    • Running an ODIN Node in the Cloud
  • Getting Started
    • Validator private key
    • odin alias (optional)
    • Port Forwarding
  • Creating an ODIN Wallet
    • variables
    • ODIN Wallet operations
  • Becoming ODIN Validator
  • Editing a validator
  • Oracle Validators
    • Google Cloud Run executor
    • AWS Lambda executor setup
  • Baldur to Heimdall
  • Restarting ODIN node
  • CLI delegation
    • Delegation queries
  • Using ODIN Web
  • Unjailing a Validator
  • FAQ
  • ODIN token
    • Testnet Reward Program
    • Testnet Staking
  • RESOURCES
  • Website
  • Whitepaper
  • Github
  • Whitepaper
    • Abstract
      • ROLES
Powered by GitBook
On this page

Was this helpful?

  1. Oracle Validators

AWS Lambda executor setup

configuration of Amazon Web Services Lambda executor

PreviousGoogle Cloud Run executorNextBaldur to Heimdall

Last updated 3 years ago

Was this helpful?

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 select 'create function'

Select Author from Scratch

Choose your Function name It will be your endpoint route.

Set Runtime to Python 3.7

For permission, if you don't have an existing role, create a new one.

Once the function has been created, you will want to uploas the oracle executor runtime source code zip.

In the upper right cornee of the "Source Code" window, click on "Upload from" and select "zip file".

After uploading the runtime zip, the rest of the function needs to be configured.

Here is what the settings page looks like when setting or editing basic settings;

Use 512Mb, and a role should've been created when the function was created. Set the timeout to 12 seconds, and optionally add a description. Next we will move on to adding the environment variables.

Add the following environment variables to the function instance;

MAX_EXECUTABLE to 8192

MAX_DATA_SIZE to 256

Next you will need to add a trigger. Use the following settings;

After creating the API trigger using the wizard, you will need to copy the API endpoint URL. This will be neesed to test the AWS executor as well as for yoda configuration, to move forward as an oracle validator.

Your lambda executor can now be tested with curl, using the following command;

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

Of course you will need to <your_api_endpoint> with the API endpoint URL of your own specific instance.

If everything has been configured correctly, the expected result of the test command consists of this output;

{
     "returncode": 0,
     "stdout": "Hello lambda\n",
     "stderr": "",
     "error": "",
     "version": "lambda:1.1.2"
 }                         

14MB
odin_oracle_executor.zip
archive
download link for untime zip
creqting AWS lambda
upload runtime zip
final result of basic config
setting environment variables
creation of API HTTP trigger using wizard
copy the API endpoint URL