Configuration with oapp-utils-bd

Setting up Blockdaemon's LayerZero Oracle with your LayerZero Version 2 application.

Blockdaemon has developed a tool called oapp-utils-bd that facilitates the seamless setup of Blockdaemon Oracles for omnichain apps.

Check the detailed steps below for an in-depth guide:

Step 1: Requirements

  1. Get the oapp-utils-bd by downloading it from the GitHub repository.
  2. We recommend using NVM for node version management as this is a Typescript project that uses NPM as its package manager and node.
  3. Test the oapp-utils-bd using the provided mainnet chain. See the documentation for more information.

Step 2: Installing Node 21.5.0

Install Node v21.5.0 using NVM (Node Version Manager): nvm install 21.5.0 && nvm use 21.5.0.

Step 3: Installing Dependencies

  1. Open a command line and navigate to the root of your project.
  2. Run the npm install command. This will download and install all dependencies listed in this project's package.json file.

Step 4: Configuring a .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.

  1. Use the .env.example file as a template by copying the environment variables using the command cp .env.example .env.
  2. 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:

VariablesDetails
BLOCKDAEMON_API_KEYYour Blockdaemon API key which available at app.blockdaemon.com.
MNEMONICThe private key for signing transactions. Ensure your wallet has sufficient balance to cover gas fees.
OAPP_ADDRESSThe address of your LayerZero v2 application (OApp).

Note: In the application, grant permission to modify Oracle to the public key corresponding to the mnemonic listed in the .env file.
SOURCE_NETWORKThe network you are operating on.

Note: Please ensure you choose the supported network.
TARGET_NETWORKThe destination network you intend to interact with.

Note: Please ensure you choose the supported network.
MESSAGE_LIB_ADDRESS
(Optional)
The message library address corresponds to the target network.

Note: Please choose send302 for each network. You can find the options in the message library list.

Step 5: Running the Script

  1. Save your changes to the .env file.
  2. Run the main script using thenpx ts-node src/main/main.ts command. This command starts the main TypeScript file for your application.
  3. The script validates all environment variables in the .env file and establishes a connection with Blockdaemon's LayerZero Oracle.
  4. You can monitor the output on your command line as the script performs the necessary configuration and setup.

Step 6: Finalizing the Setup

  1. Once setup is complete, Blockdaemons Oracle will appear in the terminal window as the Updated Oracle address.
  2. The wallet used for the transaction has a deducted balance to cover the gas fees.
  3. The application will be fully configured and connected to the Blockdaemon Oracle or LayerZero network.

👋 Need Help?

Contact us through email or our support page for any issues, bugs, or assistance you may need.