I'm trying to import blocks from the chain immediately as they are posted. I'm tired of waiting a full minute before I can see what's being posted to the platform.
const stream = client.blockchain.getOperationsStream({ mode: BlockchainMode.Latest })
This threw an error for me using javascript.
const stream = client.blockchain.getOperationsStream({mode: dsteem.BlockchainMode.Latest})
This doesn't throw an error in JavaScript, but it also doesn't work.
Does anyone know?
You'd think the most basic things you could do would be documented.
Guess not.
I can get the latest block in python like this:
from steem import Steem
import pprint
stm = Steem()
num = stm.head_block_number
newest_block = stm.get_block(num)
pprint.pprint(newest_block)
Have you tried asking in SteemDev discord? You may be able to get a better answer there.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Gah I'm actually trying this and have the same damn problem.
Gives me a block that is a minute old.
Are you sure Python is giving brand new blocks?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Yes, just tested with this while loop and compared with head block numbers on steemd.com.
Seems to be returning the correct block numbers.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I miss Python... it's been so long.
So apparently getOperationsStream() is just broken.
getBlockStream() is working for getting the new blocks.
Thanks for your time though and reminding me how awesome Python is.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I was thinking about "cheating" like this.
Best suggestion so far though so... 100% upvote and all that.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
The tutorial on Steem Dev portal works https://developers.steem.io/tutorials-javascript/stream_blockchain_transactions ... Well the tutorial sucks but you can look at the repo the code runs as is from codepen. One thin I do however since a while ago is only use dsteem 0.10 and not higher since higher just does weird things not sure if it just me, don't care. There is always steemjs I can use also. Codepen
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
im using version 10 as well... was thinking about changing it up to see if i get different results.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
unfortunately the linked tutorial you gave me doesn't have the word "Latest" in it.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Did you check to make sure you are on same UTC time synced with steemit since your JavaScript browser time is different?
https://mktcode.github.io/steemit-widgets/
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I'm pretty sure my time isn't synced. Not sure if/why that matters.
The blocks I'm receiving are immutable. I want blocks that are fresh off the line.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Yeah u want them fresh off the line steemit time! What does the error code say?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I created a repo for u to test this out https://github.com/superoo7/steem-stream-example
It's streaming straight from the blockchain
source: https://developers.steem.io/tutorials-javascript/stream_blockchain_transactions
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Nice, but I'm trying to do it in javascript. And I don't want Immutable blocks. I want Latest blocks.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
The blocks that this script retrieves are 20 blocks late. (immutable)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Actually could you tell me how to run this?
I'm a super noob when it comes to GitHub.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I've only got experience with the python library.
Maybe look at the post promoter code and see how they did it?
Posted using Partiko Android
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
It's concerning, because this is the most basic thing someone can try to do.
And yet, when you look at the official API documentation and search for the word "stream" there are zero matches... so... bad...
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Have you declared what nodes you're connecting to?
Posted using Partiko Android
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Only connected to Steemit I think...
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I just realised you referenced the condenser api, you might wanna take a look at steem-js instead. I'm 80% sure they're different things.
This is old but may still be relevant
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Magic Dice has rewarded your post with a 38% upvote. Thanks for playing Magic Dice.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Classic.
All hail, stinc!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Using steemjs:
steem.api.streamOperations()
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit