Managing streams via Axios

Using the Moralis object is proving to be a headache in the context of Streams. Iโ€™ve decided that I prefer axios for stream management.

That said, axios seems to work well for listing and deleting existing streams, but I consistently receive Error 524

Per CF docs: Error 524 indicates that Cloudflare successfully connected to the origin web server, but the origin did not provide an HTTP response before the default 100 second connection timed out.

My axios headers (for PUT/GET/DELETE) are as follows:

  headers: {
    "content-type": "application/json",
    "accept": "application/json",
    "X-API-Key": process.env.MORALIS_API_KEY,
  },

Again, GET and DELETE work just fine. But creating new streams fails via this method passing the following fields in the correct formats:

chainIds
abi
topic0
description
tag
webhookUrl
includeNativeTxs
includeContractLogs

What completely obvious thing am I missing? :thinking:

NOTE: Yes my webhook endpoint is active.

Hey @coder,

so to confirm that you get error 524 constantly for creating a stream and what chains are you listening to and when does this happen?

Listening to chains 0x38 and 0x61.

If I establish the stream via the admin panel, or via Moralis object (when itโ€™s not complaining), it works. However, using Axios, creation simply times out. My guess is Iโ€™m missing something required, but I receive no errors and I followed the doc to the letter as far as I can tell. :confused:

you can use the swagger interface directly:
https://api.moralis-streams.com/api-docs/

there you will have a curl example when you test it

you will also have an example there on how to set the

does it work from the swagger interface?

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.