This guide assumes you have a Tenderly account and basic familiarity with Web3Actions.
Prerequisites
Before you begin, make sure you have:- Tenderly CLI installed
- A Tenderly account with appropriate permissions
- Basic understanding of Web3Actions
Setup Process
You can set up Alert triggers for Web3Actions through either the UI or CLI approach.Create New ActionAlertaccount_id: "<YOUR_ACCOUNT_ID>"
actions:
<YOUR_ACCOUNT_ID>/<YOUR_PROJECT_SLUG>:
runtime: v2
sources: actions
specs:
<YOUR_ACTION_NAME>:
description: "Description of what your action does"
function: example:actionFn
trigger:
type: alert
alert: { <YOUR_ALERT_ID> }
execution_type: parallel
project_slug: "<YOUR_PROJECT_SLUG>"
Make sure to replace all placeholder values (
<YOUR_ACCOUNT_ID>, <YOUR_PROJECT_SLUG>, and <ALERT_ID>) with your actual values.Understanding the Configuration
Here’s what each configuration element means:account_idandproject_slug: Identify your Tenderly account and projectruntime: Specifies the runtime version for your actionsources: Indicates the directory containing your action codespecs: Defines the specifications for your actiontrigger: Configures how your action is triggeredexecution_type: Determines how multiple instances are handled
Best Practices
- Use descriptive names for your actions and alerts
- Keep your action code modular and focused
- Use environment variables for sensitive information
- Test thoroughly before deployment
- Monitor your action executions regularly
Following these best practices will help ensure smooth operation of your Web3Actions.
Troubleshooting
If you encounter issues:- Verify your
ALERT_IDmatches the created alert - Check alert conditions are properly configured
- Review Tenderly dashboard logs for errors
- Ensure CLI is up to date and properly authenticated