Overview
Theinit command guides you through setting up a new node extension in your project. It populates the node_extensions section in your tenderly.yaml file by linking a custom RPC method to an existing Web3 Action.
Prerequisites
Before initializing an extension, ensure you have:-
Authenticated with Tenderly
-
At least one eligible Web3 Action configured in
tenderly.yamlwith:- Trigger type:
webhook - Webhook authentication:
false - Not already used by another extension
- Trigger type:
Flags
Name for the extension. This is a unique identifier used in your
tenderly.yaml configuration.Human-readable description of what the extension does. Helps document the purpose of your custom RPC method.
The JSON-RPC method name that will be used to call this extension. Must follow the naming convention.Requirements:
- Must start with
extension_ - Followed by a lowercase letter
- At least 3 characters after the prefix
- Can contain letters and numbers
- Use camelCase (no underscores after the prefix)
- Must match regex:
^extension_[a-z][A-Za-z0-9]{2,}(?:[A-Z][a-z0-9]+)*$
Interactive Mode
When you run the init command, if multiple eligible actions are available, you’ll be prompted to select which action to use with your extension:Examples
Basic Initialization
Initialize an extension with required flags:Custom Data Aggregation
Create an extension for aggregating data from multiple sources:Transaction Validation
Set up an extension for custom transaction validation:Configuration Result
After successful initialization, the command updates yourtenderly.yaml file:
tenderly.yaml
Validation and Errors
The init command performs several validations:Invalid Method Name
If your method name doesn’t match the required pattern:Common mistakes:
- Not starting with
extension_ - Using underscores after the prefix
- Starting with uppercase or number after prefix
- Method name too short (less than 3 chars after prefix)
No Eligible Actions
If no actions with non-authenticated webhook triggers exist:tenderly.yaml
All Actions Already In Use
If all eligible actions are already associated with extensions:Duplicate Method Name
If the method name is already used by another extension in the same project:Workflow
Create Web3 Action
First, ensure you have a Web3 Action with a non-authenticated webhook trigger in your
tenderly.yaml.Verify Configuration
Check your
tenderly.yaml file to confirm the extension was added correctly under the node_extensions section.Best Practices
Use Descriptive Method Names
Use Descriptive Method Names
Choose method names that clearly indicate what the extension does:
- Good:
extension_getVestedBalance,extension_calculateRewards - Avoid:
extension_method1,extension_temp
Document Your Extensions
Document Your Extensions
Always provide meaningful descriptions that explain:
- What the extension does
- What parameters it expects
- What data it returns
Plan Your Actions First
Plan Your Actions First
Before initializing extensions, design and implement your Web3 Actions. This ensures your extension logic is ready before creating the RPC endpoint.
Keep Method Names Consistent
Keep Method Names Consistent
Follow a consistent naming convention across your extensions:
- Use camelCase consistently
- Group related methods with common prefixes
- Example:
extension_getBalance,extension_getRewards,extension_getStaked
Next Steps
Deploy Extensions
Learn how to deploy your configured extensions
Web3 Actions
Understand how to create and configure Web3 Actions
Configuration Reference
Complete node_extensions configuration reference
Extensions Overview
Learn more about Node Extensions concepts