Skip to main content
Combine BlockDB and BlockX in a Notebook when you need control over triggers, task inputs, or result handling.

Subscribe to block events

Subscribe accepts table IDs, and listen() yields (table_id, block) continuously. This example subscribes to the Ethereum event table and exits after one new block. It also stops after 30 seconds without an event, making it useful for checking connectivity.
block provides the block ID, height, and timestamp. Subscriptions consume new events and do not replace a full historical backfill. For a long-running listener, remove the timer and break, then follow Create a continuous schedule.

Configure task inputs and results

Follow Create a Function to create and save demo.usdc_amount. Submit two sets of positional arguments from a Notebook:
The output is [1.5, 2.0]. Each sublist in callList produces one function call. ReturnValueHandler collects values without writing a table. Results are not guaranteed to follow input order; return a business ID with each result when you need to associate it with its input. Choose a result handler for the destination:

Read runtime variables

  1. Switch to the Notebook’s owning account and open Variables in the account menu.
  2. Click New Variable, enter name DOCS_NETWORK and value eth.
  3. Click Add variable, then read it in the Notebook:
Add the DOCS_NETWORK runtime variable to the account
Variables belong to an account; the runtime determines which account is accessible. If the name does not exist, the second argument supplies the default value. Omitting the default returns None. Do not print variables containing secrets to logs.