➡️Test, Deploy & Run Typescript functions
Testing Typescript Functions
To test your Typescript Function locally, run:
Example:
Optional flags:
--logs
Show internal Web3 Function logs--debug
Show Runtime debug messages--network [NETWORK]
Set the default runtime network & provider.
Example:
Output:
Deploying Typescript Functions
To compile your Typescript Function and deploy it to IPFS, use
Example:
Once uploaded, Gelato Nodes will pin the file on your behalf on IPFS. If the upload was successful, you should get the IPFS CID of your Typescript Function returned.
Note: This CID will be different for every new Typescript Function version that you will deploy.
Creating Typescript Function Task
Before creating solidity function tasks, familiarize yourself with the available Trigger Types!
Selection of Function
Navigate to the What to trigger section.
Within the Typescript Function subsection, find the IPFS CID input box.
Function Details Input
Input the CID you secured after deploying your Typescript function. Upon entry, you should see a message like "Typescript Function code imported," signifying a successful connection.
Network Configuration
Scroll to the Network dropdown menu.
Choose the blockchain network where the Typescript function should work, e.g., "Göerli."
Task Configuration
If your Typescript function needs secret variables or API keys, securely enter them in the Task Secrets section. For every secret:
Key: Define the name of the variable or key, e.g., "API_KEY".
Value: Enter the associated secret value.
Click Save after each input to guarantee its safe storage.
Last updated