Streams API / Prod flag turns off

Hello again,

I am using streams api for the first time through the GUI. I have not yet tested programmatically.

This is how I have configured the stream:

Address to be listened: 0x5559b95d26666c1d2e373cce9160552bcea2274a
Network: Polygon mumbai

When a log is emitted the GUI shows me the following:

But it does not send the information to the web socket until I enable the prod flag. Once I enabled that flag the log server shows me the following information (empty object):

Every time I enable the prod flag, a few seconds pass and it appears as disabled again.

Regards

what you see there is the test webhook request that you will receive, the server will have to respond with a 200 http code and after that you should receive the normal webhook requests

1 Like

I understand, but when I send the tx to emit the event the GUI shows me the result but I am not receiving the information in the API.

what do you mean with the API?

The webhook URL I ment

what is the status for that particular stream? if it is paused then that could be the reason

you can check the status for a stream here: https://docs.moralis.io/streams-api/reference/get-stream

if the server doesn’t respond with a 200 HTTP code for that test request then it will not receive the normal requests

Based on experience that’s what I understand, if I activate the prod flag it should stay activated, right? I am getting this as a response (200 OK).

Stream ID: 9b528b1d-d422-45a4-b3bf-6c6c56958238

{
  "id": "9b528b1d-d422-45a4-b3bf-6c6c56958238",
  "webhookUrl": "https://wssqa.vikunft.com/streamAPI",
  "description": "Streams Viku NFT",
  "tag": "vikunft",
  "demo": true,
  "topic0": [
    "BuyAsset(address,address,uint256,uint256,address,uint256,uint256)"
  ],
  "allAddresses": false,
  "includeNativeTxs": false,
  "includeContractLogs": true,
  "includeInternalTxs": false,
  "getNativeBalances": [],
  "triggers": [],
  "abi": [
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "nftAddress",
          "type": "address"
        },
        {
          "indexed": false,
          "internalType": "address",
          "name": "assetOwner",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "uint256",
          "name": "tokenId",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "quantity",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "address",
          "name": "buyer",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "uint256",
          "name": "price",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "fee",
          "type": "uint256"
        }
      ],
      "name": "BuyAsset",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "uint8",
          "name": "buyerFee",
          "type": "uint8"
        }
      ],
      "name": "BuyerFee",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "nftAddress",
          "type": "address"
        },
        {
          "indexed": false,
          "internalType": "address",
          "name": "assetOwner",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "uint256",
          "name": "tokenId",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "quantity",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "address",
          "name": "buyer",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "uint256",
          "name": "price",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "fee",
          "type": "uint256"
        }
      ],
      "name": "ExecuteBid",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "previousOwner",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "newOwner",
          "type": "address"
        }
      ],
      "name": "OwnershipTransferred",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "bytes32",
          "name": "role",
          "type": "bytes32"
        },
        {
          "indexed": true,
          "internalType": "bytes32",
          "name": "previousAdminRole",
          "type": "bytes32"
        },
        {
          "indexed": true,
          "internalType": "bytes32",
          "name": "newAdminRole",
          "type": "bytes32"
        }
      ],
      "name": "RoleAdminChanged",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "bytes32",
          "name": "role",
          "type": "bytes32"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "account",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "sender",
          "type": "address"
        }
      ],
      "name": "RoleGranted",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "bytes32",
          "name": "role",
          "type": "bytes32"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "account",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "sender",
          "type": "address"
        }
      ],
      "name": "RoleRevoked",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "uint8",
          "name": "sellerFee",
          "type": "uint8"
        }
      ],
      "name": "SellerFee",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "previousTraesuryHolder",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "newTreasuryHolder",
          "type": "address"
        }
      ],
      "name": "treasuryHolderChanged",
      "type": "event"
    }
  ],
  "advancedOptions": null,
  "chainIds": [
    "0x13881"
  ],
  "status": "active",
  "statusMessage": "Stream is active"
}

yes, it should stay activated, now if you send a transaction what happens?

you will see same status here and no webhook request sent to your server?

you have to activate it, now it is still demo

When I activate the prod option and send a tx, the gui shows me the information correctly but does not communicate with the webhook url. If I wait a few seconds or refresh the moralis stream configuration url the prod option is now shown as a demo.

In short, the option disables itself

This can be the issue, you can change it to prod directly from the api, just update that demo entry to false from true (you don’t have to include the other fields when you make an update)

Im sending this json but Im getting error status code 504

{
  "webhookUrl": "https://wssqa.vikunft.com/streamAPI",
  "description": "Streams Viku NFT",
  "tag": "vikunft",
  "demo": false,
  "topic0": [
    "BuyAsset(address,address,uint256,uint256,address,uint256,uint256)"
  ],
  "allAddresses": false,
  "includeNativeTxs": false,
  "includeContractLogs": true,
  "includeInternalTxs": false,
  "getNativeBalances": [],
  "triggers": [],
  "abi": [
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "nftAddress",
          "type": "address"
        },
        {
          "indexed": false,
          "internalType": "address",
          "name": "assetOwner",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "uint256",
          "name": "tokenId",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "quantity",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "address",
          "name": "buyer",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "uint256",
          "name": "price",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "fee",
          "type": "uint256"
        }
      ],
      "name": "BuyAsset",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "uint8",
          "name": "buyerFee",
          "type": "uint8"
        }
      ],
      "name": "BuyerFee",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "nftAddress",
          "type": "address"
        },
        {
          "indexed": false,
          "internalType": "address",
          "name": "assetOwner",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "uint256",
          "name": "tokenId",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "quantity",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "address",
          "name": "buyer",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "uint256",
          "name": "price",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "fee",
          "type": "uint256"
        }
      ],
      "name": "ExecuteBid",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "previousOwner",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "newOwner",
          "type": "address"
        }
      ],
      "name": "OwnershipTransferred",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "bytes32",
          "name": "role",
          "type": "bytes32"
        },
        {
          "indexed": true,
          "internalType": "bytes32",
          "name": "previousAdminRole",
          "type": "bytes32"
        },
        {
          "indexed": true,
          "internalType": "bytes32",
          "name": "newAdminRole",
          "type": "bytes32"
        }
      ],
      "name": "RoleAdminChanged",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "bytes32",
          "name": "role",
          "type": "bytes32"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "account",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "sender",
          "type": "address"
        }
      ],
      "name": "RoleGranted",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "bytes32",
          "name": "role",
          "type": "bytes32"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "account",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "sender",
          "type": "address"
        }
      ],
      "name": "RoleRevoked",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "uint8",
          "name": "sellerFee",
          "type": "uint8"
        }
      ],
      "name": "SellerFee",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "previousTraesuryHolder",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "newTreasuryHolder",
          "type": "address"
        }
      ],
      "name": "treasuryHolderChanged",
      "type": "event"
    }
  ],
  "advancedOptions": null,
  "chainIds": [
    "0x13881"
  ]
}

I deleted this stream. I created a new one by using the gui, getting same error, it could something with my account maybe

I’ll test tomorrow, when you update with the API it should work, you tried multiple times and you got same error?

you can also look in network tab in the browser when you change to prod, you can also try to click on update, but after you wait a while, not instantly (you can delete and add back a character in the webhook url)

I tested now, It works for me as expected, did you get any error in admin interface when you tried to enable prod?

if you get an error then it will change automatically to demo, for example if the webhook url doesn’t respond with a 200 HTTP code

it looks like it is related to the webhook url, if we can not get a response from the webhook url then you could get that behaviour that you see

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