Skip to main content

Setting Up Streams with Webhook Streams

Updated on
Jun 27, 2024
Note

To learn more about validating incoming streams webhook messages, you can take a look at this in-depth guide: How to Validate Incoming Streams Webhook Messages

Setting Up Streams with Webhooks

In the following section, we'll show you how to set up a Stream and configure your destination settings to use Webhooks.

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 first to configure your Stream settings:

Stream Settings


  • Chain and Network: Begin by selecting a target Chain and Network from the list of supported chains and networks.
  • Dataset: Once you have chosen the network and chain, 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 closest to you will be populated; however, you can modify this if needed.
  • Batch size: Choose initial batch size to stream messages as an array. As you reach the chain tip, batch size auto-adjusts to 1 for optimal, near-real-time streaming.
  • 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. Otherwise, by default, the Stream won't end.

Reorg Handling

Streams can be configured to handle reorgs. You can enable the Latest block delay and Restream on reorg settings to manage reorgs to your preferences properly. Check out the Reorg handling page to learn more about Reorgs and how to properly manage them.

Reorg Handling

Destination Settings

To initiate the stream creation process through Webhooks, follow these steps:

Destination Settings

  • Destination type: Select the destination type as Webhook. It will open a new section for adding destination settings.
  • Destination URL: Put the Webhook/destination URL in the destination URL section.
  • Payload compression: For optimal bandwidth usage in production, you can use compression. You can leave this value as None if you prefer human-readable messages from Streams
  • Metadata: Choose where you want to attach the metadata to from options such as None, Header, and Body. - Checkout the sample example of metadata below
  • Timeout: Set the duration for the timeout in seconds.
  • Retry Data Fetch Interval: Determine how often the system retries data fetch
  • Pause Stream After: Determine the number of tries after which the Stream should pause. When we exhaust retries, we terminate your stream, and you’ll be able to resume anytime the delivery issue is resolved.
  • Add Custom Headers: You can also add an arbitrary custom header by clicking on the check box for Add custom headers. You can add a custom header key value to it.
Note:

For testing Streams without deploying your own Webhook server, you can consider using free services like typedwebhook.tools, webhook.site, or similar platforms to examine the payloads that would be streamed to you. Explore more about Webhook functionalities here.

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 Webhook URL you provided earlier.

Example Deployments

For sample code for deploying a webhook service, check out the Deployment Examples.

Share this doc