Skip to main content
यह गाइड आपको Tenderly CLI का उपयोग करके Web3 Action project को initialize, build, और deploy करने के लिए आवश्यक commands दिखाती है। चरण 1: Tenderly CLI स्थापित करें अपने local machine पर Tenderly CLI binary को download और install करने के लिए curl command का उपयोग करें। macOS पर स्थापित करें:
example
Linux पर स्थापित करें:
example
चरण 2: CLI के माध्यम से Tenderly में Log in करें इस command को चलाकर अपने credentials के साथ Tenderly CLI में log in करें:
example
चरण 3: एक Web3 Actions project को Initialize करें एक Web3 Action project को initialize करने के लिए, यह command चलाएँ:
example
आप तीन flags के साथ default initialization settings बदल सकते हैं: --sources root Web3 Actions folder का नाम सेट करता है (default: actions), --language Action functions लिखने की भाषा सेट करता है (typescript, default, या javascript), और --template Tenderly/tenderly-actions repository के starter template से project initialize करता है।
example
आपको अपने Web3 Actions को Tenderly project में जोड़ने के लिए कहा जाएगा। आप या तो एक नया project बना सकते हैं या एक मौजूदा चुन सकते हैं। चरण 3: आपको जो भी NPM dependency चाहिए वह स्थापित करें tenderly actions init चलाने के बाद, आपके पास एक NPM project उपलब्ध है, इसलिए आप किसी भी परिचित तरीके से आपको जो भी NPM library चाहिए उसे स्थापित कर सकते हैं।
example
चरण 4: Web3 Actions को Build और Deploy करें अपना function और trigger configuration tenderly.yaml में लिखने के बाद, आप Web3 Action को build और deploy करने के लिए ये commands चला सकते हैं।
example
deploy चलाने के तुरंत बाद, आपका Web3 Action Dashboard में उपलब्ध है और आपके configuration के अनुसार events के लिए listen कर रहा है। publish किया गया action Dashboard में दिखाई देता है लेकिन inactive रहता है: जब तक आप deploy नहीं चलाते या उसे Dashboard से start नहीं करते, वह scheduled नहीं होता और events के लिए listen नहीं करता।
आप function और trigger configuration को edit करने के बाद deploy command चलाकर बिना किसी downtime के अपने Web3 Actions को upgrade कर सकते हैं।
वैकल्पिक: अपने tenderly.yaml को Validate करें deploy करने से पहले, आप अपने tenderly.yaml की संरचना और trigger configuration को locally validate कर सकते हैं। कोई login आवश्यक नहीं है।
example
--json flag एक structured result emit करता है। जब सब कुछ मान्य होता है:
जब validation विफल होती है, तो schema_errors और/या trigger_errors शामिल किए जाते हैं (खाली होने पर omit किए जाते हैं):
वैकल्पिक: अपने editor के लिए JSON Schema generate करें schema command tenderly.yaml के actions अनुभाग का वर्णन करने वाली JSON Schema output करता है। file edit करते समय autocomplete और validation पाने के लिए इसे VS Code YAML extension (redhat.vscode-yaml) या JetBrains IDEs के साथ उपयोग करें।
example
वैकल्पिक: समर्थित features का अन्वेषण करें सभी समर्थित trigger types, runtimes, execution types, और intervals का machine-readable manifest देखने के लिए:
example
यह editor integrations और उन tools के लिए उपयोगी है जिन्हें documentation parse किए बिना यह पता लगाने की आवश्यकता है कि CLI क्या समर्थन करता है। वैकल्पिक: Tenderly Runtime का locally उपयोग करना अपने Web3 Action Functions को locally test करने के लिए @tenderly/actions-test package स्थापित करें। यह मानते हुए कि आप पहले से ही npm project में हैं, निम्न चलाएँ:
example
web3-actions project के size को बढ़ाने से बचने के लिए, web3-actions के लिए tests और run scripts को actions directory के बाहर रखने की सिफारिश की जाती है।
अधिक विवरण और उदाहरणों के लिए Web3 Actions के local development और परीक्षण पर गाइड देखें।