Compose and Gelato Web3 Functions (W3F) have a lot of similarities and solve similar problems, but they work a bit differently. For the most part, anything you’ve done
with W3F can be done in a similar fashion with Compose but there some differences to be aware of.
Task - In Compose a “task” is a typescript file with your code logic, it can import from other files and libraries and it must have a single main function. This is effectively the equivalent of a “function” in W3F terms.
Trigger - In Compose a “trigger” encompasses the concept of both “triggers” and “tasks” in W3F.
Compose apps are completely configured within your code repository; all configuration for Compose apps is done in the Manifest yaml file. Compose apps are deployed with the CLI and the manifest is responsible for provisioning infra and dependencies.
Compose has similar triggering options to W3F with a few differences:
Compose doesn’t differentiate between cron and time intervals, Compose just uses cron expressions for time-based triggering.
Compose has HTTP triggers allowing your application logic to trigger tasks and send payloads over HTTP with optional bearer token authentication.
Like W3F, Compose tasks can be triggered with onchain events, this is powered by our Turbo indexing product. When you deploy a Compose app that uses onchain triggers, we’ll provision a Turbo pipeline which will connect to your task over HTTP. The compose manifest allows for simple configuration of the pipeline, but you have the option of creating more complex pipelines that use webhook sinks to power your Compose tasks. This is a slightly more verbose / complex setup than W3F’s approach, but allows for significantly more complex systems.
Compose doesn’t support per-block triggers currently as an out-of-the-box feature. However, you can recreate this functionality by building a Turbo pipeline (with a webhook sink) that indexes every block to accomplish the same outcome.
All task authoring is done in Typescript for Compose apps, we do not currently support authoring tasks in Solidity like W3F. Unlike W3F, Compose tasks don’t output onchain transactions by default. They can return a JSON payload when called with an HTTP Trigger but all other effects are done with task code. Tasks can execute any number of onchain transactions, make HTTP calls to external systems, store data in collections for use later or by other tasks, etc. Since external interactions are just done in code, as opposed to task output, Compose apps can include any number of external interactions.
Both platforms have a web UI dashboard for monitoring, logs etc. Compose also has an event log that gives details about task execution steps and failures. This is useful for both auditing and debugging the behavior of Compose Apps. Compose’s event log is also built to be publicly sharable as an audit trail for users to verify the behavior of apps, but currently it’s only visible to users logged into a Goldsky project at app.goldsky.com.Compose does not currently have any notification system for App errors beyond proactively checking the UI and our own internal monitoring and oncall rotation for platform issues. However, logging can be set up within Compose apps to external systems. Compose doesn’t make assumptions about what constitutes a failure within a task run, allowing users to manually define success/failure conditions and wire up logging to existing systems. We are currently designing a system for task logic to define it’s own critical failure conditions which would allow us to use our existing email notification system and to flag Compose apps with critical failures in the dashboard with an error status. If this is a strict requirement, please contact us with your specific requirements.
Gas funding in Goldsky doesn’t rely on users depositing gas tokens in our system. Rather, transactions are made by wallets created in code and any number of wallets
can be created within your Compose app. By defaults, wallets are Privy smart wallets and have built-in gas funding. Gas is measured as you use it and paid for as part of your monthly Goldsky bill. Compose also allows you to store your own EOA private keys as secrets and use those to create wallets. When using EOA wallets you’ll need
to ensure they’re funded for gas or any other transactions you may need to make. Compute costs are included in your monthly Goldsky bill, paid in fiat.