Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream is not picking up full history or live events #14

Open
ryoung48 opened this issue Dec 31, 2022 · 1 comment
Open

Stream is not picking up full history or live events #14

ryoung48 opened this issue Dec 31, 2022 · 1 comment

Comments

@ryoung48
Copy link

Description
My goal is to use this stream to pick up historical and live actions for specific accounts on mainnet and testnet.

|endpoint                       |accounts   
---------------------------------------------------                    
https://mainnet.telos.net       |dapp.bennyfi
https://testnet.telos.net       |bennyfitestm

My socket setup is below:

import { HyperionStreamClient } from '@eosrio/hyperion-stream-client'

const client = new HyperionStreamClient({
  endpoint: 'https://mainnet.telos.net',
  debug: true,
  libStream: false
})

client.on('connect', () => {
  console.log('connected!')
})

client.setAsyncDataHandler(async payload => {
  console.log(
    `${payload?.content?.['@timestamp']} :: ${payload?.content?.act?.account} :: ${payload?.content?.act?.name} :: ${payload?.content?.block_num}`
  )
})

const main = async () => {
  await client.connect()
  client.streamActions({
    contract: 'dapp.bennyfi',
    action: '',
    account: '',
    start_from: '2020-03-15T00:00:00.000Z',
    read_until: 0,
    filters: []
  })
}

main()

According to https://mainnet.telos.net/v2/history/get_actions?filter=dapp.bennyfi%3A*, dapp.bennyfi should have many historical transactions. The client debugger reports a successful connection to the mainnet endpoint. However, the client only picks up ~20 historical actions starting on 2021-08-25T19:41:49.500 and then stops. It then proceeds to pick up more history at very irregular intervals every couple hours and has not yet picked up any live events. If I shift the start time, it will pick up another ~20 actions starting at the new start time and then halts. I do not see any console prints suggesting the socket has disconnected. Adding accounts and actions to the stream actions call does not seem to make any difference. I see similar behavior with https://testnet.telos.net and bennyfitestm. Is this kind of behavior expected? Am I using the stream incorrectly?

Environment
node version: 16.14.2
hyperion-stream-client version: 1.0.3

@kylanhurt
Copy link

Yeah I have found the streaming of the actions to be very inconsistent, making it nearly unusable until this issue is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants