Programming Diary #12: Bridging between "Steem Island" and the rest of the Internet

in hive-151113 •  last year  (edited)

Summary

Here's a summary of my Java coding activities during the two weeks since Programming Diary #11. Short version: I accomplished the two goals I had set for myself, made some additional progress with my toy Steemometer program, and also advanced with my ability to use (and potentially modify) the SteemJ libraries.

Background

It's becoming regular practice for me to start these posts by recounting my previous goals and reporting on my progress against those goals, and this seems to be working well. So, here are the goals that I set for the previous fortnight:

  1. Display "vanity messages" in the VAAS area of the Steemometer application, alternating between vanity messages and @null beneficiary posts.
  2. Develop a shading mechanism for both the vanity messages and the @null beneficiary posts that uses a red/orange color gradient, but is not linked to the actual text - i.e. something in the AnchorPane fill color, bordering, or shadowing, TBD.

And, for the second week in a row, I'm pleased to say that I accomplished both (though I still have a lot of cosmetic work to do).

Progress

Vanity Messages and gradient coloring:

Here's what the vanity message (aka broadcast message) and the shading look like, at the moment:

In this post, the sender wants to promote a Steem community, so they send a message to @null and the message gets transmitted to all Steemometer users.

And here's a use that hadn't occurred to me when I wrote Programming Diary #11. In this message, the user wants to promote a web site that exists outside of the Steem ecosystem.

In both cases, you can see that I added a light shadow and I also colored the author label to indicate the amount of STEEM/SBD that was burned by the sender. I had trouble with the label coloring, and may still change them, but I basically followed the color of real flame temperatures: red -> orange -> yellow -> green -> blue. The more that gets burned, the "hotter" the coloring. The coloring of SBD transfers is scaled by the blockchain's median price for (approximate) equivalence with the coloring of STEEM transfers.

Also, as with burned beneficiary posts, the Visibility as a Service (VAAS) display box is clickable. In this case, it might send the browser to any of three locations:

  1. If it contains a valid URL (i.e. https://www.example.com), it will take the browser there.
  2. If it contains a valid Steem permlink (i.e. /business/@remlaps/steem-token-burning-visibility-as-a-service), it will take the browser there.
  3. Otherwise, it takes the browser to the Steem profile of the person who sent the message.

I actually think that I'll disable the first use temporarily, though, because the risk of phishing attacks is too high without some sort of curation capability.

So, we can declare "Mission Accomplished" on the prior goals. I also made some additional progress that I hadn't planned:

Post promotion, more about vanity messages, and weighted randomness

Post promotion

Having created the vanity message capability, I found that it was easy enough to apply the same code (SBD, instead of STEEM) in order to also add promoted posts to the display. Here's what that looks like right now.

And the VAAS box is clickable, taking the browser to the actual promoted post. My intention for promoted posts is to change the display so it looks like the posts with burned beneficiary rewards, i.e. like this:

An interesting thing, here, is that - unlike the blockchain promotion function - it is also possible to promote a post that has passed its payout time (remember, the goal here is "audience building", not "reward harvesting"):

Again, this will eventually be updated to look like the burned beneficiary posts.

More about vanity messages

And this brings me back to the idea of vanity messages. My thinking when I last posted was that "vanity messages" would come from burning STEEM whereas post promotion would come from burning SBD (like it does now). I also had no thoughts, last time, about linking away from the Steem ecosystem.

My thinking has changed, however. Now, I'm thinking that there doesn't need to be any difference between SBD and STEEM burns. Basically, either SBD or STEEM can fuel a post/link promotion type of display or a vanity message type of display.

So, that's where I'm going next. If the memo comment contains a valid Steem link, I intend to display it like today's burned beneficiary posts. If not, I intend to display it as a vanity message (with/without a link to an external site).

Weighted Randomness

Finally, I made a change to the random selection algorithm. The Steemometer is maintaining three lists: posts with burned beneficiaries; SBD transfers to @null; and STEEM transfers to @null. So, the first choice is to display one of those three types. This is done as a simple 1 of 3 selection (defaulting to a second and third choice if the first type(s) are not available).

What I changed, however, was the selection criteria for individual posts/messages. At first, the program was using a simple random selection. A transfer of 1 STEEM was just as likely to be picked as a transfer of 0.001 STEEM. Now, however, I changed it to select randomly according to the size of the beneficiary setting or the transferred amount. So what we see now, for example, is the following:

  • For posts with an @null beneficiary setting, a 50% beneficiary setting is twice as likely to be displayed as one with a 25% setting, and that's 25x more likely to be displayed than a post with a 1% setting.
  • For STEEM transfers to @null, a transfer with 1 STEEM is one thousand times more likely to be displayed than a post with a 0.001 STEEM transfer.
  • For SBD transfers to @null, a transfer with 1 SBD is one thousand times more likely to be displayed than a post with a 0.001 SBD transfer.

SteemJ - Compilable but missing a testnet

As noted in Programming Diary #11, I gave myself a scare when I cleaned up my Maven repository and SteemJ stopped working. Eventually, I was able to get it working again by updating the version and downloading from jitpack.io. However, I was concerned because there's a risk of that site becoming unavailable, so I wanted to compile a working version for myself. With this, I had limited success.

Basically, it doesn't seem that there's a release in the primary repo that actually works (or, at least, I couldn't get one working...). However, I did find what I think is the commit that's used in the jitpack.io distribution. Notably, the commit contains this warning:

However, I was able to copy that commit to a git repo of my own and eventually got it to compile. So, at this point, even if the jitpack jar file goes away, I'm confident that I can at least use SteemJ in its current form, and potentially even make improvements to it (I already updated most of the dependency versions, for example.)

The caveat here is that I had to disable testing in order for it to compile. It seems that the "surefire" (whatever that is) test modules depended on having a Steem testnet, and I suspect that none is presently available, so future enhancements seem to depend on restoration of a testnet (as well as skill improvements on my part).

Steem Links Creator

I still use the Steem Links Creator (SLC) as my interface to SteemJ, so while I was working out the issues above with SteemJ, I also made some cosmetic changes to the SLC and modified it to use my locally compiled version of SteemJ instead of the one from jitpack.io. The current formatting of posts from the SLC now looks like this.

If you're curious, here's what the app looks like now. I haven't changed it much since I first worked on it a couple years ago:

This was done with Java Swing, instead of JavaFX, which I'm using for the Steemometer app. After hitting "Post to Steem", here is the corresponding post.

Next Up

I already know that I have plans next weekend, and unexpected family activities arise frequently at this time of year, so I'll be especially modest with my two goals for the next fortnight. Here they are:

  1. Change Steemometer VAAS format for post promotion to look like the format for burned beneficiary posts.
  2. Change the top section of the Steemometer so that the one minute average is computed based on historical numbers, instead of naively multiplying a single block by 20.

Reflections

In this week's "Reflections" section, I want to revisit and extend one idea from the previous post, and also add a new one. The repeated topic is API reliability. The new topic is mentioned in this post's title: Building a bridge between "Steem Island" and the rest of the Internet. So, let's start with the newest topic first.

Bridging between Steem Island and the Internet

Maybe it should have been obvious, but this past cycle is the first time that I ever realized that someone can easily promote external web sites by burning STEEM/SBD. If we enhance that capability in the ecosystem, it gives whole new (real world) communities a reason to participate.

The fact that we have constant "link spamming" activities suggests to me that there might be a demand for this sort of capability, so I think it's something that all developers should think about. Obviously, I don't want to just move SPAM from one place to another, but maybe we can do more to help promote external sites in a way that is not intrusive, spammy, or scammy - and grow our community at the same time.

As I mentioned before, one unexplored use of Steem's Visibility as a Service capability is that we could put lists of #burnsteem25 posts in apps and websites that really have little else to do with Steem in order to help our authors build their audiences. Now, it's clear that the reverse use is also possible. By providing a link-out capability in exchange for token burning, we can give people a reason to buy and use Steem's tokens, even if they have no interest in blogging or curating.

And, of course, if STEEM's value is influenced by Metcalfe's Law, then every bridge from Steem Island to the Internet has the potential to increase its value.

API Stability

Instead of API Stability, let's call it infrastructure. Simply put, we need to find a way to improve Steem's. Here are four examples:

  • As I noted in my previous posts, many of the public STEEM APIs seem to be overloaded. The only ones that I find to be consistently reliable are the ones from @pennsif and @moecki.
  • Even on the reliable APIs, there are frequent "pauses" that I don't think are related to the APIs themselves, but maybe (?) due to missed blocks and corresponding chain reorganizations. As I understand it, we should see a steady "tick tick tick" of blocks, one every three seconds. However, the Steemometer pulls the "last irreversible block" on every poll, and it advances in fits and starts. It might take 12 seconds for one block, then the next 4 might come quickly.
  • As @moecki pointed out, here, different APIs sometimes give back different answers.
  • If we want to cultivate an army of developers, we need a testnet.

Now, I don't point these things out to be a "Negative Nellie", so I want to explore solutions. I get that everyone is resource constrained, but (IMO), the need to fix infrastructure topics like these is a fundamental requirement for any blockchain. We, as a community, need to find solutions. Four possible approaches come to mind for discussion:

  1. Steemit's Development Incentive Program
  2. Increasing rewards for witnesses (which, of course, means taking them from elsewhere)
  3. Unlocking the Steem DAO (SPS).
  4. Measurement and reporting of metrics for Steem API availability, accuracy, and responsiveness (I believe @justyy already does some of this).

Anything else?

I'm sure that this is solvable, but it's something that needs attention and prioritization.

Looking ahead

Again, I'll pull forward from previous weeks so that I don't lose sight of things:

(It's a shame that it's so much easier to have an idea than it is to implement it. 😉)

  1. A standalone desktop UI that gives the user independence from web sites and focuses on increasing social media velocity;
  2. A protocol and framework that I'm bouncing around in my head for decentralized abuse measurement and resistance; (note to self, I'd better write this down before I forget what I have in mind... Nov 18 and Nov 30: Still haven't written it down.)
  3. 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.
  4. After I get done with the Steemometer, I think my next project will be a fairly simple 2 person game that will utilize Steem's content for the subject matter and use custom_json transactions for communications between the players.

Not necessarily in the order above.

Additionally, related to #2 - I have now had an idea for bringing Quorum Sensing to bear on the abuse problem. It's slightly different from the other approach I have in mind, and the two approaches might or might not be complementary. I haven't thought through it enough yet.

Also, I've been thinking about the possibility of a private messaging/chat application that encrypts its messages using memo keys and sends them using custom_json transactions. I might give that a try, too. Although, with this post from @blockseater, that might not make sense.

That's it for today. Hope to see you again in 2 weeks!


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.

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:  

An interesting thing, here, is that - unlike the blockchain promotion function - it is also possible to promote a post that has passed its payout time (remember, the goal here is "audience building", not "reward harvesting"):

I spent a large portion of my time implementing promoted posts excluding posts that had passed their payout time. I'm wondering if I was correct to do so!

I noticed all of your messages to @null whilst I was coding - now I understand what they were all for!

Basically, either SBD or STEEM can fuel a post/link promotion type of display or a vanity message type of display.

That's how I've implemented my post promotion - I convert SBD to STEEM in order to prioritise which is "most valuable" 🙂

For posts with an @null beneficiary setting, a 50% beneficiary setting is twice as likely to be displayed as one with a 25% setting, and that's 25x more likely to be displayed than a post with a 1% setting.
For STEEM transfers to @null, a transfer with 1 STEEM is one thousand times more likely to be displayed than a post with a 0.001 STEEM transfer.
For SBD transfers to @null, a transfer with 1 SBD is one thousand times more likely to be displayed than a post with a 0.001 SBD transfer.

I like this idea 🙂

By providing a link-out capability in exchange for token burning, we can give people a reason to buy and use Steem's tokens, even if they have no interest in blogging or curating.

I think that I've inadvertently added this capability 🙂 Via a post which expires of course so any lasting promotion would require a lasting commitment.

After I get done with the Steemometer, I think my next project will be a fairly simple 2 person game that will utilize Steem's content for the subject matter and use custom_json transactions for communications between the players.

It's very doable and how I approached my choose-your-own-adventure project. I even went to the effort of encrypting the messages stored in the metadata so that people couldn't cheat 🙂 It's a fun project but my codebase was so horrendous that I stopped working on it fairly quickly. Perhaps I'll revisit the idea - motivated by what you're doing 🙂

  ·  last year (edited)

I spent a large portion of my time implementing promoted posts excluding posts that had passed their payout time. I'm wondering if I was correct to do so!

Yeah, it's arguable. Some people might be annoyed at clicking on a link to a post with an expired payout, so if we include the expired ones, it's probably also good to also indicate whether they've already paid out or not. Fortunately, we can just experiment and optimize over time. I'm actually planning to eventually calculate a "suggested voting percentage" based on factors about the author and the post, so I'll stuff that value with zeros on a paid out post.

I noticed all of your messages to @null whilst I was coding - now I understand what they were all for!

Lol. I can only imagine what you were thinking. 😄

I convert SBD to STEEM in order to prioritise which is "most valuable" 🙂

I do this conversion for the coloring, but I divide STEEM and SBD into two separate time partitions. I have been debating whether I should keep doing that or just collapse it into a single list and a single time slice.

It's very doable and how I approached my choose-your-own-adventure project. I even went to the effort of encrypting the messages stored in the metadata so that people couldn't cheat 🙂 It's a fun project but my codebase was so horrendous that I stopped working on it fairly quickly. Perhaps I'll revisit the idea - motivated by what you're doing 🙂

which brings me back to the keys/security problem that you mentioned in your reply to @moecki @o1eh (sorry - no idea how I managed that mixup!) from your own post. 😉 At the rate I'm going, this is months or years away, anyway.

sorry - no idea how I managed that mixup!

I was already wondering :-)
However, I had already talked about it some time ago, so it could have been that only the link went wrong.

TEAM 1

Congratulations! This comment has been upvoted through steemcurator04. We support quality posts , good comments anywhere and any tags.
Curated by : @o1eh



Thank you, @o1eh!