मुख्य सामग्री पर जाएं
यह गाइड आपको Tenderly CLI का उपयोग करके Web3 Action project को initialize, build, और deploy करने के लिए आवश्यक commands दिखाती है। चरण 1: Tenderly CLI स्थापित करें अपने local machine पर Tenderly CLI binary को download और install करने के लिए curl command का उपयोग करें। macOS पर स्थापित करें:
example
curl https://raw.githubusercontent.com/Tenderly/tenderly-cli/master/scripts/install-macos.sh | sh
Linux पर स्थापित करें:
example
curl https://raw.githubusercontent.com/Tenderly/tenderly-cli/master/scripts/install-linux.sh | sh
चरण 2: CLI के माध्यम से Tenderly में Log in करें इस command को चलाकर अपने credentials के साथ Tenderly CLI में log in करें:
example
tenderly login
चरण 3: एक Web3 Actions project को Initialize करें एक Web3 Action project को initialize करने के लिए, यह command चलाएँ:
example
tenderly actions init
आप दो flags के साथ default initialization settings बदल सकते हैं: root Web3 Actions folder का नाम (default: actions) और Action functions लिखने के लिए भाषा (default: typescript या javascript) बदलें।
example
tenderly actions init --sources=actions --language=typescript
आपको अपने Web3 Actions को Tenderly project में जोड़ने के लिए कहा जाएगा। आप या तो एक नया project बना सकते हैं या एक मौजूदा चुन सकते हैं। चरण 3: आपको जो भी NPM dependency चाहिए वह स्थापित करें tenderly init चलाने के बाद, आपके पास एक NPM project उपलब्ध है, इसलिए आप किसी भी परिचित तरीके से आपको जो भी NPM library चाहिए उसे स्थापित कर सकते हैं।
example
cd actions
npm i --save-dev axios ethers
cd ..
चरण 4: Web3 Actions को Build और Deploy करें अपना function और trigger configuration tenderly.yaml में लिखने के बाद, आप Web3 Action को build और deploy करने के लिए ये commands चला सकते हैं।
example
# run within the folder containing tenderly.yaml

# Build the project (optional)
tenderly actions build

# Publish the project to Tenderly without running it (start manually)
tenderly actions publish

# Deploy the project to Tenderly Runtime (or re-deploy any changes you make)
tenderly actions deploy
publish चलाने के तुरंत बाद, आपका Web3 Action Dashboard में उपलब्ध है और आपके configuration के अनुसार events के लिए listen कर रहा है।
आप function और trigger configuration को edit करने के बाद publish command चलाकर बिना किसी downtime के अपने Web3 Actions को upgrade कर सकते हैं।
वैकल्पिक: अपने tenderly.yaml को Validate करें deploy करने से पहले, आप अपने tenderly.yaml की संरचना और trigger configuration को locally validate कर सकते हैं। कोई login आवश्यक नहीं है।
example
# Validate all projects in tenderly.yaml
tenderly actions validate

# Validate a single project only
tenderly actions validate --project username/project-slug

# Machine-readable JSON output (useful in CI pipelines)
tenderly actions validate --json
--json flag एक structured result emit करता है। जब सब कुछ मान्य होता है:
{ "valid": true }
जब validation विफल होती है, तो schema_errors और/या trigger_errors शामिल किए जाते हैं (खाली होने पर omit किए जाते हैं):
{
  "valid": false,
  "schema_errors": ["..."],
  "trigger_errors": [
    { "project": "my-org/my-project", "action": "myAction", "errors": ["..."] }
  ]
}
वैकल्पिक: समर्थित features का अन्वेषण करें सभी समर्थित trigger types, runtimes, execution types, और intervals का machine-readable manifest देखने के लिए:
example
# Print the capabilities manifest
tenderly actions capabilities

# Include the full embedded JSON Schema in the output
tenderly actions capabilities --include-schema
यह editor integrations और उन tools के लिए उपयोगी है जिन्हें documentation parse किए बिना यह पता लगाने की आवश्यकता है कि CLI क्या समर्थन करता है। वैकल्पिक: Tenderly Runtime का locally उपयोग करना अपने Web3 Action Functions को locally test करने के लिए @tenderly/actions-test package स्थापित करें। यह मानते हुए कि आप पहले से ही npm project में हैं, निम्न चलाएँ:
example
npm install @tenderly/actions-test
web3-actions project के size को बढ़ाने से बचने के लिए, web3-actions के लिए tests और run scripts को actions directory के बाहर रखने की सिफारिश की जाती है।
अधिक विवरण और उदाहरणों के लिए Web3 Actions के local development और परीक्षण पर गाइड देखें।