Skip to main content
Use Sync Invoker to execute one user function and receive its result in the same RPC. Use the same explicit chain and block arguments as in Write EVM data functions.

Prerequisites

Connect a gRPC client to an available Sync Invoker using your environment’s connection and authentication setup. The service definition is api/grpc/syncinvoker/sync_invoker.proto in the BlockX repository. EVM functions also require the relevant node backend.

Check and invoke

  1. Submit the function source to Precheck when static auditing is available. Read the returned findings; this operation does not execute the function.
  2. Select exactly one function source: function_id for a registered function, or inline_source.source_code for inline Python.
  3. Encode positional arguments as a JSON array in args_json. For the balance example, supply the chain, concrete block identifier, token, and holder.
  4. Call Invoke for the value, or DebugInvoke when you also need captured output.
  5. Check success. On success, decode result_json; on failure, inspect failure.

Confirm the result

Record call_id with the chain and block you queried. DebugInvoke can return a bounded stdout/stderr tail and failure diagnostics in debug_output. It does not run a task Writer Plugin.

Handle failures

Continue reading