dsteem playground

in steemdev •  7 years ago  (edited)

I made a coding playground for dsteem where you can experiment with the steem API without having to setup your own coding environment, it also sports loading and saving files to GitHub gists for easy sharing.

Go play here: https://playground.steem.vc


playground2.png

Examples:

Share and enjoy!

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Made this a listing on steemtools.com

Awesome, thanks!

Keep up the good work! :-)

Hi @almost-digital why i cannot vote witness you?

Hey! Thanks for the support but I'm not running as a witness (yet)

Damn, there are a lot of useful tools out there for steem! Thank you for your creation!

Geniuses have been reborn, otw to play this!

Great! thanks! Upvoted, Resteemed and Followed! :)

Awesome man! Im really thankful.

Super awesome, going to try this out, thanks!

Thanks! Let me know if you have any problems with it

Awesome tool, thanks for sharing.

Great Man!

Is dsteem still being developed? Is it still better than steem.js? I'm looking forward to making a bot for this.

Yes and yes, IMHO ;)

Thats realy nice! Thank you for such a great contribution!

Cheers!

Where is the correct place to ask a question about client.blockchain.getOperationsStream() ??

Ask away

I am relaying the results stream through socket.io-stream. When the socket.io client disconnects, what is the correct way to .close() .disconnect() .destroy() the dsteem client connection? The dsteem stream functions don't appear to have any methods to disconnect or hang-up.

io.on('connection', function(socket) {

    ss(socket).on('ready', function(){
        var client = new dsteem.Client('https://api.steemit.com');
        var opsStream = client.blockchain.getOperationsStream();
        opsStream.pipe(es.map(function(block, callback) {
            ss(socket).emit('sending', block);
            callback(null, util.inspect(block, {colors: true, depth: null}) + '\n')
        }))//.pipe(process.stdout);
    });

    socket.on('disconnect', function(){
        /* 
          how to disconnect the getOperationsStream() ?? 
       */
        console.log('User Disconnected');
    });
});

Yeah that is a implementation limitation, feel free to open an issue about it. However in your case you don't want to create a new stream for every client that connects, that would be very inefficient. Instead create a proxy stream that you pipe to your connections and unpipe when they disconnect

Also worth noting is that dsteem works in web browsers so if those are your socket clients you can just get the operation stream client side directly