Setting Up Streams with Functions
This section guides you through setting up a Stream with Functions as the destination, leveraging the versatility and power of QuickNode Functions.
Streams Settings
On your QuickNode dashboard, navigate to the Streams page by clicking the Streams tab on the left side-panel. After, click the Create Stream button in the top-right corner. You'll be prompted to first configure your Stream settings:
- Chain and Network: Begin by selecting a target Chain and Network from the list of supported chains and networks. You can check the supported chains and network here
- Dataset: Once you've chosen the network and chain, proceed to select a Dataset that defines the type of data you intend to stream. See the full list of supported data schemas here.
- Stream name: A stream name will be populated by default but you can modify this if needed.
- Region: By default, the region most closest to you will be populated, however, you can modify this if needed.
- Batch size: Configure the batch size for your Stream. By default this will be set to 1 (for minimal latency), however you can update this if needed.
- Stream start: By default, your stream will start at the tip of the chain (e.g., latest block number), however if you are backfilling (retrieving historical data), you can update this value to start from a specific block number.
- Stream end: If you want your Stream to end a specific block number, update this value. Otherise, by default the Stream won't end.
Reorg Handling
Streams come pre-configured to handle reorgs. You can enable the Latest block delay and Restream on reorg settings to properly manage reorgs to your preferences. Check out the Reorg handling page to learn more about Reorgs and how to properly manage them.
Destination Settings
Now, to configure the Stream with a Functions destination, follow these steps:
- Select the URL of the Function you have already deployed and want to use.
- Optionally, you can create and test a new Function in the UI
After configuring all the settings according to your preferences, click on the Create a Stream button located in the bottom right corner. This action will generate a stream for you, utilizing the Function you provided.
Additional Context and Information
- Why Use Functions as a Destination: Functions allow for complex data processing like filtering and transforming blockchain data in real-time. This is particularly useful for applications that need to respond dynamically to blockchain events.
- Capabilities of Functions: With native support for useful packages and web3 libraries, Functions provide a powerful and flexible development environment for your serverless functions.
- Blockchain Optimized: Functions as a destination for Streams is tailored to blockchain applications. Pipe your streaming blockchain data directly into your customized Function instantly, with no need to manage your own infra.