Schema

Define the schema (data output) for EVM Lambdas and Patchs

Summary

The Schema component defines the shape of an object you want to emit from your EVM lambda: it dictates both the structure of your message (e.g., JSON fields), the Kafka topic/stream it is written to, and how the data will be typed in connected persistences and webhooks. You can create schemas directly or within the EVM Lambda component.

Inputs

  1. Name: The name of your schema. Must be unique per canvas.
  2. Fields: Enter a name and select a Type corresponding to that field.
    1. Name: A name for the field in the object. Must be unique per schema.
    2. Type: A Solidity data type, e.g., bytes32 for a transaction hash or address for an address.
      1. Note that you can also define custom types--read more here.

Interactions

Once you've defined a schema, you can save it. Once saved, it can be reedited up until it is connected to a set persistence or used in an active execution, at which point it becomes read-only. When you edit a schema, it deletes all messages previously sent to the corresponding topic.

You can delete and duplicate schema components.

When you connect an EVM Lambda component to a schema, a function specific to that schema is automatically generated and added as an option in the left sidebar within the connected EVM Lambda component.

Allowed edges

Incoming

  • EVM Lambda
  • Patch

Code components can emit messages to a schema. A schema can be connected to more than one EVM Lambda and/or components. Similarly, each EVM Lambda or Patch may be connected to multiple schemas.

Outgoing

  • Persistence. Connect a persistence to your schema if you want to persist the messages in a database.
  • Schema mirror. Connect a schema mirror to your schema if you want to ingest the schema's data into an external DB.
  • Webhook. Connect a persistence to a webhook component if you want to trigger a Webhook for each message written to the schema.

What’s Next