Dicebot Dev Post #3: Bouncing off the brick wall

Words
378
Reading
2 min
9y
Listen to this post
~3 min

nocturnal-code.png

When we last left off, I was about to dig in to how to actually programmatically post a reply to Steemit, and I feared it might be significantly more difficult than just reading the blockchain as I had been doing so far.

And, yeah, it is. For one, it appears that this is not possible to do with the simple HTTP-based JSON-RPC API endpoint I had been using thus far; instead, I'd have to use Websockets. Websockets were basically invented to allow web browsers to communicate with servers using protocols other than HTTP. They're another one of those things from the people who think that web browsers should not only display primarily text-based documents (which they do very well) but also be entire general-purpose application platforms (which they do very poorly). Posting to the blockchain also involves cryptography. Hey, cryptocurrencies involve cryptography? Go figure.

All right, once again, I'm overwhelmed with what I'm looking at here. Sure, the pieces are in place to implement all of this stuff myself, but I just don't understand yet how those pieces are supposed to fit together.

So, change of plan. I mentioned in my last post about the Steemit libraries and such that are already available but I'm not using because I'm using Swift. Well, is my desire to continue using Swift greater than my desire to accept the help of these libraries? Not anymore. I now intend to implement this bot using Python and the piston-lib library. Its documentation even shows how a reply bot can be written with very little code.

But now I have to learn how to write in Python again, since it's been quite a while since I last did so. And I'm not meaning just code here; I mean things like coding standards, what packages should look like, the correct layout of files in the filesystem, etc. For some reason, I'm a little obsessive about that sort of thing, even though at this stage in a project it's really more important to just get some working code up and keep my motivation going.

Anyway, that's where things are now. As before, I appreciate any feedback anyone may have, particularly those interested in using this bot and those who have developed against the Steemit blockchain before.

Dicebot Dev Post #3: Bouncing off the brick wall | Ecency