Configuration with oapp-utils-bd
Setting up Animoca-Blockdaemon DVNs with your LayerZero Version 2 application.
Note:As of now, our DVN supports only mainnet. Please refer to our DVN address list.
Blockdaemon has developed a tool called oapp-utils-bd that facilitates the seamless setup of Animoca-Blockdaemon's DVN for omnichain apps.
Throughout this documentation, we use the term "Oracle" interchangeably with "DVN"
Check the detailed steps below for an in-depth guide:
Step 1: Requirements
- Get the oapp-utils-bd by downloading it from the GitHub repository.
- We recommend using NVM for node version management. This is a Typescript project that uses NPM as its package manager and node.
- Test the oapp-utils-bd using the provided mainnet chain. See the documentation for more information.
Step 2: Installing Node
Install Node v21 using NVM (Node Version Manager): nvm install 21 && nvm use 21
Note: This tool was tested with Node v21.5.0
Step 3: Installing Dependencies
- Open a command line and navigate to the root of your project.
- Run the
npm install
command. This will download and install all dependencies listed in this project'spackage.json
file.
Step 4: Configuring a .env
File
.env
File
Note:The
.env
file is storing sensitive information such as API keys and private keys. This file should never be shared or included in a public repository.
- Use the .env.example file as a template by copying the environment variables using the command
cp .env.example .env
. - Open the
.env.example
file in your code editor.
BLOCKDAEMON_API_KEY=
MNEMONIC=
OAPP_ADDRESS=
SOURCE_NETWORK="ethereum"
TARGET_NETWORK="polygon"
MESSAGE_LIB_ADDRESS=“0x6c26c61a97006888ea9e4fa36584c7df57cd9da3”
LOG_LEVEL="info"
You need to adjust the following variables:
Variables | Details |
---|---|
| Your Blockdaemon API key which available at app.blockdaemon.com. |
| The private key for signing transactions. Ensure your wallet has sufficient balance to cover gas fees. |
| The address of your LayerZero v2 application (OApp).
|
| The network you are operating on.
|
| The destination network you intend to interact with.
|
| The message library address corresponds to the target network.
|
Step 5: Running the Script
- Save your changes to the
.env
file. - Run the main script using the
npx ts-node src/main/main.ts
command. This command starts the main TypeScript file for your application. - The script validates all environment variables in the
.env
file and establishes a connection with Blockdaemon DVNs. - You can monitor the output on your command line as the script performs the necessary configuration and setup.
Step 6: Finalizing the Setup
- Once setup is complete, Blockdaemon DVN will appear in the terminal window as the Updated Oracle address.
- The wallet used for the transaction has a deducted balance to cover the gas fees.
- The application will be fully configured and connected to the Blockdaemon DVN and LayerZero network.
👋 Need Help?
Contact us through email or our support page for any issues, bugs, or assistance you may need.
Updated 25 days ago