Created
December 10, 2022 15:05
-
-
Save smilingkylan/380ab96e2e2db82d0301e47e3b45574e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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