Skip to content

Instantly share code, notes, and snippets.

@smilingkylan
Created December 10, 2022 15:05
Show Gist options
  • Save smilingkylan/380ab96e2e2db82d0301e47e3b45574e to your computer and use it in GitHub Desktop.
Save smilingkylan/380ab96e2e2db82d0301e47e3b45574e to your computer and use it in GitHub Desktop.
const fetch = require('node-fetch')
const { HyperionStreamClient } = require("@eosrio/hyperion-stream-client")
const client = new HyperionStreamClient({
endpoint: 'https://testnet.telos.caleos.io',
debug: true,
libStream: false
});
client.on('empty', () => {
console.log('Queue Empty!');
});
client.on('libUpdate', (data) => {
console.log('Current LIB:', data.block_num);
});
client.on('fork', (data) => {
console.log('Fork Event:', data);
});
async function run() {
await client.connect();
await client.streamDeltas({
code: 'eosio',
scope: '*',
table: 'rexbal',
payer: '',
read_until: 0,
start_from: 0
})
await client.streamActions({
contract: 'telos.decide',
action: '*',
account: '',
filters: [],
read_until: 0,
start_from: 0
});
}
run().catch(console.log);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment