All Products
Search
Document Center

Blockchain as a Service:Function Compute

Last Updated:Mar 31, 2026

Blockchain as a Service (BaaS) can automatically run off-chain business logic whenever a blockchain event occurs. Upload your logic to Function Compute, configure the mapping between blockchain events and your function, and BaaS will prepare computing resources and invoke the function reliably whenever a matching event is detected.

Prerequisites

Before you begin, ensure that you have:

  • The cloud service integration module installed

Integrate BaaS with Function Compute

  1. Log in to the Alibaba Cloud BaaS console. In the left navigation bar, go to Hyperledger Fabric > Overview.

  2. In the My Organizations section, find the target organization and click Cloud service integration on the right.

  3. Click the Function Compute tab.

  4. Click Condition detection to check the integration status.

  5. If Function Compute is not yet enabled, click Enable service.

  6. If BaaS is not yet authorized to access Function Compute, click Authorization Service.

  7. When the integration is complete, the following page appears. Click Add configuration to set up an event trigger.

    Configure an event trigger

Configure a Function Compute trigger

Complete the integration steps above before configuring a trigger.
  1. On the Function Compute tab, click Add configuration.

  2. In the Add function compute configuration pane, set the following parameters:

    ParameterDescription
    NameA name for the trigger, used for identification.
    Channel/networkThe Fabric channel the trigger listens on and pushes events from.
    Event typeThe type of blockchain events to push to Function Compute. For information about event types, see Subscribe to events.
    Function compute domain nameThe endpoint of your Function Compute service. Find it on the Common Info page in the Function Compute console, or look it up in Function Compute service addresses.
    Service nameThe name of the Function Compute service that contains the target function.
    Function nameThe name of the target function.
    Version(Optional) The version of the target function.
    Failure threshold(Advanced) The maximum number of cumulative failures before the trigger enters the failed state and stops processing. Set to -1 for unlimited failures (the trigger will not enter the failed state).
    Filter(Advanced, optional) For more information, see Use Filter.
  3. Click Add. The new trigger appears in the trigger list.

    Creation completed

Manage triggers

After a trigger is created, you can perform the following operations:

  • Delete: Permanently removes the trigger.

  • Disable: Pauses event pushes.

    Important

    Events generated while the trigger is disabled are permanently discarded. They are not delivered when you re-enable the trigger. Plan maintenance windows carefully to avoid missing critical blockchain events.

  • Enable: Resumes event pushes from the latest block. If a trigger was in the failed state, the failure count resets to zero after you repair and re-enable it.

How error handling works

When a trigger pushes a blockchain event, two types of errors can occur:

  • Service processing error or parameter configuration error: The trigger status changes to Exception. Hover over Exception to view the error details.

  • Exception returned by the integrated service: The trigger retries automatically. If all retries fail, the event is discarded and counted as one failure.

The trigger then compares its cumulative failure count against the Failure threshold:

  • If the count is within the threshold, the trigger continues pushing subsequent events.

  • If the count exceeds the threshold, the trigger enters the failed state and stops processing.

After you repair the trigger or the integrated service and re-enable the trigger, the failure count resets to zero.

The Block height field shows the latest block the trigger has processed, which reflects its current progress.

What's next

  • Subscribe to events — learn about event types and data schemas

  • Use Filter — configure filter expressions to push only the events your function needs