Giter Site home page Giter Site logo

Comments (23)

h4nz4 avatar h4nz4 commented on August 22, 2024 1

from moralis-js-sdk.

b4rtaz avatar b4rtaz commented on August 22, 2024

Hi @h4nz4! Thanks for reporting. We are looking at this.

from moralis-js-sdk.

b4rtaz avatar b4rtaz commented on August 22, 2024

@h4nz4 are you certain that you're not exceeding your account limits?

from moralis-js-sdk.

h4nz4 avatar h4nz4 commented on August 22, 2024

from moralis-js-sdk.

b4rtaz avatar b4rtaz commented on August 22, 2024

I've executed the below code and I'm receiving data without any problems for an hour now.

Maybe your hook throws an error. The webhook should return HTTP 200.

import Moralis from 'moralis';
import { EvmChain } from '@moralisweb3/common-evm-utils';

async function main() {
  Moralis.start({
    apiKey: '<API_KEY>',
  });

  const stream = await Moralis.Streams.add({
    chains: [EvmChain.ETHEREUM],
    description: 'test sdk',
    tag: 'test',
    webhookUrl: '<WEBHOOK_URL>',
    abi: [
      {
        anonymous: false,
        inputs: [
          {
            indexed: true,
            name: 'from',
            type: 'address',
          },
          {
            indexed: true,
            name: 'to',
            type: 'address',
          },
          {
            indexed: false,
            name: 'value',
            type: 'uint256',
          },
        ],
        name: 'Transfer',
        type: 'event',
      },
    ],
    topic0: ['Transfer(address,address,uint256)'],
    includeContractLogs: true,
  });

  console.log('stream', stream.toJSON());

  const addr = await Moralis.Streams.addAddress({
    id: stream.result.id,
    address: '0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0',
  });

  console.log('addr', addr.toJSON());
}

main();

from moralis-js-sdk.

h4nz4 avatar h4nz4 commented on August 22, 2024

from moralis-js-sdk.

b4rtaz avatar b4rtaz commented on August 22, 2024

https://docs.moralis.io/streams-api/evm/error-handling

Your Stream can enter into error state on the following 2 scenarios:

- Your webhook success-rate is below 70%
- Your server is not consuming the webhooks  (...)

from moralis-js-sdk.

h4nz4 avatar h4nz4 commented on August 22, 2024

from moralis-js-sdk.

b4rtaz avatar b4rtaz commented on August 22, 2024

The stream will get the error state if the webhook is broken. But if you reach out the limit then the state is paused.

"status": "paused",
"statusMessage": "Streams paused because of exceeded records",
"status": "error",
"statusMessage": "Stream in error state due to too many failed webhook requests, you can activate it by either updating the stream or through the /streams/evm/{id}/status endpoint"

You may check the statusMessage for your stream by the SDK:

  const streams = await Moralis.Streams.getAll({
    limit: 20,
  });

If that won't help, please write a message to our support: [email protected] More details like your account info may be necessary.

from moralis-js-sdk.

b4rtaz avatar b4rtaz commented on August 22, 2024

@h4nz4 have you solved the problem?

from moralis-js-sdk.

h4nz4 avatar h4nz4 commented on August 22, 2024

The problem is sadly still there. I also posted on Moralis forum, and got no helpful suggestion from the community. I would understand, if the streams went into errored state, but they switch into paused state, by themselves, and they have to be manually reset to the active state. The usage limits have never been achieved, not even 20% of the Free plan usage cap.

Please, help!

from moralis-js-sdk.

b4rtaz avatar b4rtaz commented on August 22, 2024

What a message do you have in the statusMessage after the problem occurs?

from moralis-js-sdk.

h4nz4 avatar h4nz4 commented on August 22, 2024

from moralis-js-sdk.

b4rtaz avatar b4rtaz commented on August 22, 2024

You can read it by calling the API for the list of your all streams.

  const streams = await Moralis.Streams.getAll({
    limit: 10
  })
  console.log(streams.result[0].statusMessage);

from moralis-js-sdk.

h4nz4 avatar h4nz4 commented on August 22, 2024

I checked now. The paused streams have statusMessage "Disconnected from Demo" - what does it mean? Could this be the reason the streams pause by themselves?

from moralis-js-sdk.

b4rtaz avatar b4rtaz commented on August 22, 2024

I have this status when:

  • I've created a demo stream from the admin panel.
  • The stream is in the demo mode image
  • I've closed the browser tab with the preview of the stream.

Are you sure that you have created a stream by the SDK? Please be sure that, you don't have the admin panel opened in the background.

from moralis-js-sdk.

h4nz4 avatar h4nz4 commented on August 22, 2024

from moralis-js-sdk.

b4rtaz avatar b4rtaz commented on August 22, 2024

For the demo mode it's not possible. The demo mode is only for testing purposes. You need to switch the mode to prod.

from moralis-js-sdk.

h4nz4 avatar h4nz4 commented on August 22, 2024

from moralis-js-sdk.

b4rtaz avatar b4rtaz commented on August 22, 2024

It could be. You need to test it on your side.

from moralis-js-sdk.

b4rtaz avatar b4rtaz commented on August 22, 2024

@h4nz4 Have you tested it? Can we close this issue?

from moralis-js-sdk.

b4rtaz avatar b4rtaz commented on August 22, 2024

@h4nz4 can we close this issue?

from moralis-js-sdk.

b4rtaz avatar b4rtaz commented on August 22, 2024

Due to inactivity I close this issue. If the problem still occurs, please open a new one.

from moralis-js-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.