🤔 Got questions? Schedule an office hours session.
Web3 Actions

FAQ: Web3 Actions

What's the difference between parallel and sequential execution?

During configuration of your Web3 Action, you can choose between the two modes of execution.

When there’s several triggered Web3 Actions (e.g. transactions from the same block), these two modes behave in the following way:

  • sequential: execution will respect the order in which the triggers have happened; until completion of trigger N-1, trigger N is awaiting for execution. The order of execution is guaranteed.
  • parallel: all triggers will be submitted for execution, and the execution order can not be guaranteed.

Different rate limits apply.

What’s the difference between WRITE, COPY ON WRITE, and EMPTY storage types?

  • Write: This type is selected by default. It’s always used in automatic triggers and writes data on the main storage. Please note that this type can potentially overwrite data on the main storage.
  • Copy on write: This type creates a copy of the main storage as temporary storage. It can be selected for manual triggers. Once a trigger stops running, everything that was written in the temporary storage won’t be saved.
  • Empty: This type creates temporary empty storage. It can be selected for manual triggers. The empty storage type doesn’t have any reference to the main storage. Once a trigger stops running, everything that was written on this type of storage will disappear.

Do contracts need to be verified to be used in Web3 Actions?

Yes, contracts need to be verified and added to your project on Tenderly to be used in Web3 Action triggers. Otherwise, the CLI will throw a warning.

Learn more about triggers and how they work here.

What is the allowed number of Web3 Actions per project?

The allowed number of Web3 Actions per project is 10. If you try to deploy an Action and you’ve reached the limit, you’ll get the following error message:

The request failed with a status code of 400 and status message of '400 Bad Request'

What is the storage limit?

The limit for key-value storage us 100KB, which is not limited by the number of keys. You’re able to add as many keys as you want as long as their combined size is equal to or less than 100KB.

What's the size limit to the Web3 Action project?

When you create a Web3 Action using the CLI, the entire NPM project will be zipped and uploaded to Tenderly. The maximum size of the zipped archive, including node_modules is 40 MB.

What's the maximum duration of Web3 Action execution?

Web3 Action execution is limited to 30 seconds, at which point it will be terminated.

What's the rate limit for Web3 Actions?

The standard rate limit in 5-minute window is:

  • 500 for sequential Web3 Actions
  • 2000 for parallel Web3 Actions

For custom rate limit reach out to support.

What is the execution timeout for Web3 Actions?

The current execution timeout is 20s, after which the execution will be terminated. If more time is needed, you can contact our support team to discuss your use case. Get more information on the execution status types.

I have a `tenderly.yaml` file with two Web3 Actions with the same trigger (a certain contract event). Will the first action declared in the manifest file always be invoked before the second one?

Two separate Web3 Actions with the same trigger are executed in parallel since they’re isolated entities unaware of one another.

What are Webhook-based Web3 Actions?

Webhook-based Web3 Actions are triggered by incoming HTTP requests, allowing Web3 Actions to act as backends for dapps or other services.

What's available in Web3 Actions Runtime?

The following libraries are available:

  • Ethers.js
  • Bignumber.js
  • Axios
  • Luxon

How do Web3 Actions interact with blockchain data?

Web3 Actions can interact with blockchain data by reading blocks, transactions, and logs, enabling smart contract monitoring. Example:

const { ethers } = require("ethers");
const provider = new ethers.providers.JsonRpcProvider(RPC_URL);
const latestBlock = await provider.getBlockNumber();

What are the trigger types available for Web3 Actions?

Web3 Actions support block, transaction, webhook, and periodic (CRON) triggers, which define when the action should be executed.

How do I deploy Web3 Actions?

Web3 Actions can be deployed via the Tenderly Dashboard or using the CLI. The CLI provides more advanced configuration options. Example CLI command:

tenderly actions deploy --name MyAction --triggers triggers.yaml

How are errors handled in Web3 Actions?

Errors in Web3 Actions are logged and can be viewed in the Tenderly Dashboard. Failed actions can be re-executed for further debugging.

What’s the rate limit for Web3 Actions?

The rate limit is 100 executions per 5 minutes per Web3 Action.

Can I store data in Web3 Actions?

Yes, you can use key-value storage to persist data and manage secrets for sensitive information like API keys. Example:

const value = await kvStore.get("key");
await kvStore.put("key", value);

What are common use cases for Web3 Actions?

Common use cases include monitoring blockchain transactions, automating tasks, and building webhook backends for dapps.

Can Web3 Actions be tested locally?

Yes, using the @tenderly/actions-test npm package, Web3 Actions can be tested locally. Example:

npm install @tenderly/actions-test
tenderly actions run local MyAction.js

What are the supported programming languages for Web3 Actions?

Web3 Actions are written in JavaScript or TypeScript. Example:

async function main() {
  console.log("Running Web3 Action");
}

How can I manage secrets in Web3 Actions?

You can securely store and retrieve sensitive data, such as API keys, using the secrets management feature. Example:

const apiKey = await secrets.get("API_KEY");

What are block-based Web3 Actions?

Block-based Web3 Actions are triggered by new blocks on the blockchain, making them ideal for block-level monitoring.

What are transaction-based Web3 Actions?

Transaction-based Web3 Actions are triggered by specific blockchain transactions, enabling monitoring and custom reactions.

Can Web3 Actions interact with external APIs?

Yes, you can interact with external APIs using libraries such as Axios for HTTP requests. Example:

const axios = require("axios");
const response = await axios.get("https://api.example.com/data");

What is the purpose of CRON triggers in Web3 Actions?

CRON triggers allow Web3 Actions to run periodically at specific intervals, automating recurring tasks. Example:

cron:
  interval: "*/15 * * * *"

What is key-value storage in Web3 Actions?

Key-value storage allows Web3 Actions to persist state between executions. Example:

await kvStore.put("myKey", "value");
const value = await kvStore.get("myKey");

How do I use the Tenderly CLI to deploy Web3 Actions?

Use the CLI to deploy Web3 Actions by specifying configurations in a YAML file. Example:

tenderly actions deploy

What are Webhook-based Web3 Actions?

Webhook-based Web3 Actions are triggered by incoming HTTP requests, allowing Web3 Actions to act as backends for dapps or other services.

How does Tenderly handle logs for Web3 Actions?

Tenderly logs every execution of Web3 Actions. Logs can be accessed and reviewed on the Tenderly Dashboard for debugging.

What is the purpose of simulations in Web3 Actions?

Web3 Actions can run transaction simulations to test and verify outcomes before broadcasting transactions. Example:

const simulationResult = await simulateTransaction(txData);