MockApp

MockApp, an end to end application using Earlybird

This document outlines how an example MockApp can be used on public Testnets to pass messages across multiple blockchains. You can find the code for the MockApp in our repository here; the code has both the Thunderbird and Rukh versions showcasing how to use the Thunderbird and libraries respectively.

The application demonstrates the following:

  1. Implementing the recommendations contract

  2. Configuring the application with the Earlybird endpoint

  3. Sending messages and paying fees

  4. Receiving messages that have been sent from other chains

Actors

MockApp

The MockApp is a smart contract that initiates message sending on a specific blockchain. Users interact with the MockApp through the sendMessage function, triggering a message transmission to the Earlybird Endpoint. The MockApp also implements the IReceiver interface to receive messages sent to it.

FeeCollector

FeeCollector is used to deploy configuration contracts for SendingOracle and SendingRelayer. These contracts handle the configuration of oracle and relayer fees charged for passing messages on behalf of the MockApp.

MockRecsContract

The MockRecsContract for performing additional per message settings such as using a different relayer and dispute periods based on the message.

MockDisputerContract

The MockDisputerContract is used for disputing messages when using the library. It intervenes when messages are sent, performing a dispute process to ensure integrity and reliability of the transmitted messages.

Using the MockApp on Testnet

Install Dependencies

Run the workflow

The aforementioned MockApp is deployed on all the s and is ready to send/receive messages utilizing Message-Passing with Earlybird.

  1. Binance Testnet

  2. Polygon (MATIC) Mumbai

  3. Ethereum Goerli

  4. Optimism Goerli

  5. Arbitrum Goerli

Setting up your environment

  1. Clone the Earlybird Examples repository

  2. Init submodules

  3. Replace <ADD YOUR MNEMONIC HERE> with your crypto wallet's mnemonic phrase in the following files (Ensure you have testnet tokens. Check the earlybird-mock-app readme for more details)

    1. /earlybird-mock-app/script/sendMessageOnMockRukhApp.sh

    2. /earlybird-mock-app/script/sendMessageOnThunderbirdRukhApp.sh

Your repository should be ready to use. Run any of the following functions to interact with the MockApp powered by Message-Passing with Earlybird

Functions

  1. make send-thunderbird-message

    1. Send a message across chains using the thunderbird library

  2. make send-rukh-message

    1. Send a message across chains using the rukh library

  3. make get-thunderbird-messages

    1. View sent/received messages using the thunderbird library

  4. make get-rukh-messages

    1. View sent/received messages using the rukh library

In case you have any questions DM us on Discord so we can help you answer your questions.

Last updated