Programming Diary #8: A Standalone Java ApplicationsteemCreated with Sketch.

in #steemexclusivelast year (edited)

About a month ago, I decided that I wanted to have a standalone tool to engage with the Steem blockchain from my Windows desktop. Web sites are great - especially for off-chain visitors - but blockchains are supposed to be accessible by "peer to peer" methods, too. So, I thought I'd put forward some effort in that direction.

Since I was already aware of a couple apps that were in use several years ago, my first step was to clone them and see if I could bring them up to date. I was hoping it would be simply a matter of compiling and then making a few configuration changes. No such luck, though. I failed miserably.

  • esteem Desktop compiled but it was still configured to use websockets. I had no idea where to begin in order to switch it over to https connections.
  • I couldn't get esteem Surfer to compile at all because of version problems with nodejs, npm, npx, and who knows what else...

So, first I started reading/watching tutorials for nodejs and npm, but everything I looked at pointed me back to a series of prerequisites, so it seemed like I kept moving away from my goal, instead of towards it. After about half a month, I gave up on that line of activity (for now?).

Next up:

So, I "failed fast" and moved on to dusting off the Java --- stuff that I was working on a couple years ago. I am far from expert with Java, but at least I could get a program running and have it talk to the Steem blockchain. Hopefully, then, I can be a little bit productive with Java while I learn the additional skills I need to make a useful Open Source client of some sort.

A big part of the reason that I stalled with Java a couple of years ago was that I had no idea how to make it useful for anyone else. I could only run my program in the IDE. So, this time, I wanted to tackle that problem before moving on to do much actual programming.

Thus, my first two goals were:

  1. Remember how the heck I was able to get java working with Steem and SteemJ in the first place; and
  2. Create a toy standalone app that interacts with the Steem blockchain and can be executed from the Windows Start menu (i.e. outside of the IDE).

I'm pleased to say that after a great deal of cursing at the computer, I accomplished both. In this case, the toy app just displays the number of Steem operations per block in a speedometer type of visualization (hence, "Steemometer"). Here's what my toy app looks like (at the moment):

To get this far, I have installed and configured the following components:

Along the way, I also had to start learning about Maven, which is a build manager for Java. Netbeans also offers Gradle and Ant, but I chose Maven because that's the first one I got working. So... instead of learning about npm, I'm learning about Maven. ;-)

For an IDE, in addition to Netbeans, I also played around with Eclipse and VSCode, but I stuck with Netbeans because that's where I had SteemJ working, and I didn't feel like fighting with another IDE in order to get that configured again.

Goals

For the next two weeks, I have the following goals:

  1. Update the "Steemometer" to show the number of posts & votes per block, in addition to overall operations. There are a couple ways I might display these values.
  2. Add an option to choose from a list of APIs. (right now, I'm using UPVU's API).

I have some other things in mind, too, but I can basically only work on this during spare time on the weekends, so I'm trying not to be overly ambitious with my goals.

Longer term, I also have some unrelated ideas that I want to pursue, if I can ever make the time:

  1. A protocol and framework that I'm bouncing around in my head for decentralized abuse measurement and resistance.
  2. A new version of @penny4thoughts that will be more tolerant to Steem API interruptions, extend a post's engagement lifecycle beyond 7 days, and let the author be more flexible in rewarding commenters.

These are queued up behind creation of a java UI for posting, commenting, and curating, though... so @penny4thoughts remains offline now, and we'll have to be patient.


Thank you for your time and attention.

As a general rule, I up-vote comments that demonstrate "proof of reading".




Steve Palmer is an IT professional with three decades of professional experience in data communications and information systems. He holds a bachelor's degree in mathematics, a master's degree in computer science, and a master's degree in information systems and technology management. He has been awarded 3 US patents.


image.png

Pixabay license, source

Reminder


Visit the /promoted page and #burnsteem25 to support the inflation-fighters who are helping to enable decentralized regulation of Steem token supply growth.

Sort:  

"I am far from expert with Java, but at least I could get a program running and have it talk to the Steem blockchain."

I'm not an expert on it either, but I never give up, there are no limits to learning something as long as there is interest. A hobby that takes a lot of time.

"So, first I started reading/watching tutorials for nodejs and npm, but everything I looked at pointed me back to a series of prerequisites, so it seemed like I kept moving away from my goal"

I know, I haven't read them all yet, there are so many tutorials about it, I also like experimenting with steem-python. To experiment, I set up a laptop with Ubuntu 20.04 LTS.

I wish you much success with this 👍

I also like experimenting with steem-python.

Yeah, me too. For me, steem-python is still the easiest way to interact with the blockchain (programmatically).

Penny4thoughts is a great help, it helped me achieve the highest POWER UPs.
I wish you a happy day

Your plans sound very interesting. I wish you good luck.

but I can basically only work on this during spare time on the weekends

I know that very well. 😔 I would like to do a lot more, but it's just a hobby...

A windows executable has the crucial disadvantage that it's not so easy to leave it running permanently. Unless you have a Windows Server.

A windows executable has the crucial disadvantage that it's not so easy to leave it running permanently. Unless you have a Windows Server.

Well, what I'm hoping to do with the windows executable would only have to be as permanent (or not) as the browser. Of course, it could be built into a standalone executable for Linux or MacOS, too, but that's a long way away.

On another note, add FXML to the things I need to learn about... It's always something. Everything is so modular these days, that there's almost no such thing as "learning a language" any more...

Because of penny4thoughts, I thought that it had to run permanently.

Yes, I think there are still some things they could added on your way... 👍

Oh, now I get it. Yeah, I'm only doing java for my attempt at a UI. Penny4thoughts will probably stay in python. I just want to redesign the logic. I've had that running in a linux VM inside of windows Home edition for years, so probably no change on that front.

Loading...

Coin Marketplace

STEEM 0.18
TRX 0.18
JST 0.034
BTC 88157.98
ETH 3083.80
USDT 1.00
SBD 2.74