๐Ÿš€ Upgrading Hive Onboarding: From Snail Speed ๐ŸŒ to Lightning Fast โšก๏ธ with API Magic

@sagarkothari88 ยท 2025-08-06 04:31 ยท HiveDevs

Hello Hive Community Members! ๐Ÿ‘‹๐Ÿ

Letโ€™s dive into the latest happenings from the CheckinWithXyz project and how we've transformed the onboarding experience like a boss! ๐Ÿ˜Ž


๐Ÿ”™ Earlier Implementation: Snail Speed Mode

longer wait time for users

Before our API glow-up:

  • Onboarding approvals were comment-based ๐Ÿ—จ๏ธ
  • Onboarders dropped comments on intro posts
  • A cronjob on the server gobbled them later ๐Ÿ“ก
  • Result? Long wait time โฑ๏ธ... like 2-3 minutes!
  • Not very Hive-like when blocks are born every 3 seconds โณ

Thatโ€™s like delivering pizza with pigeons when drones are available! ๐Ÿ•


๐Ÿ” New Flow: API-Driven Approvals for the Win!

instant reward transfer

To fix the delays, we moved to API-based approvals ๐Ÿ’ก

  • Whitelisted onboarders can now approve directly via the app
  • It fires off approval comment ๐Ÿ’ฌ + instant reward ๐Ÿ’ฐ
  • We now store approval details too (fancy, huh?) ๐Ÿง 

๐Ÿง‘โ€๐Ÿ’ป Shoutout to @starkerz, @meno, @ecoinstant, @eddiespino & all the onboarders โ€“ they loved the upgrade! ๐Ÿ’™


๐Ÿ“Š Onboarding Reports: Data is the New Oil!

Onboarding reports

Now that weโ€™re storing data, reports are possible ๐ŸŽ‰

  • Changes took effect from July 2025
  • But wait! We did onboardings before that too ๐Ÿ˜ฎ
  • For example, at TalentLand, many Hive souls joined ๐ŸŒฑ
  • Sent reports to @starkerz, but they said, โ€œHey, some juicy details are missing!" ๐Ÿ•ต๏ธ

๐Ÿค“ Let's Write a Script & Hunt Down That Data!

JavaScript

Buckle up, itโ€™s time for detective coding with Node.js! ๐Ÿ•ต๏ธโ€โ™‚๏ธ๐Ÿ’ป


โœ… Step 1: Get Transfers

const dhive = require("@hiveio/dhive");

async function getTransfers(client, author, limit, start) {
  const op = dhive.utils.operationOrders;
  const operationsBitmask = dhive.utils.makeBitMaskFilter([op.transfer]);
  const records = await client.database.getAccountHistory(
    author,
    start,
    limit,
    operationsBitmask
  );
  return records;
}

exports.getTransfers = getTransfers;

This gets us the juicy transfer records from Hive ๐Ÿฏ


โœ… Step 2: Fetch Transfers for threespeakselfie

async function updateCheckinRecords() {
  let transfers = await getTransfers(
    dhiveClient,
    "threespeakselfie",
    1000,
    -1
  );

Boom! ๐Ÿ’ฅ Pulling the latest 1000 transactions ๐ŸŽฏ


โœ… Step 3: Filter the Right Kind of Transfers

Look for transfers that:
1. Are outgoing ๐Ÿ’ธ
2. Have memos ๐Ÿงพ
3. Contain blog links ๐Ÿ”—

let onboardings = transfers
  .filter((r) => {
    return (
      r.op.from === "threespeakselfie" &&
      r.op.memo.length > 0 &&
      r.op.memo.includes("Your blog (https://hive.blog/@")
    );
  })

โœ… Step 4: Shape the Data to Our Needs

Transform raw memos into onboarding records ๐Ÿ“ฆ

  .map((r) => {
    const memo = r.op.memo;
    const regex = /Your blog $$https:\/\/hive\.blog\/@(.+)\/(.+)$$/;
    const match = memo.match(regex);
    return {
      username: match,
      memo: r.op.memo,
      dateOfApproval: r.timestamp,
      permlink: match,
      status: "approved",
    }
  })

Now we have:
- โœ… Username
- โœ… Memo text
- โœ… Approval timestamp
- โœ… Permlink

Smells like reporting gold ๐Ÿช™โœจ


โœ… Step 5: Find Out Who Did the Onboarding

Since transfer doesnโ€™t tell us who approved, we gotta extract it from the postโ€™s title ๐ŸŽฏ

for (const item of onboardings) {
  try {
    const postDetails = await dhiveClient.database.call('get_content', [item.username, item.permlink]);
    const title = postDetails.title || "No Title";
    const regex = "by @(.+)";
    const match = title.match(regex);
    const onboarder = match ? match : "unknown";

Boom! ๐Ÿง™โ€โ™‚๏ธ We got their names from the shadows (aka post titles).


๐ŸŽฏ Wrapping Up

Thanks to this script, we were able to recover all missing onboarding data ๐Ÿ› ๏ธ
Itโ€™s now updated in our backend database, making reporting & tracking future-proof! โœ…๐Ÿ“Š

Next up: Work on the front-end! ๐ŸŽจ๐Ÿ–ฅ๏ธ


๐Ÿ™ Thank You!

That's it for now, folks! Thanks for scrolling all the way down ๐Ÿ™Œ

๐Ÿ’™ More power to the Hive Blockchain ๐Ÿ
๐Ÿ’ช More power to all our community members
๐Ÿš€ Until next time, Happy Coding! ๐Ÿ’ปโœจ


๐Ÿ“ Final Note

  • I asked Perplexity to help optimize this post to make it more readable and viewer-friendly.
  • Here is the link where you can find both original content & improvements made by AI
  • https://www.perplexity.ai/search/4125659a-303b-46d9-8565-9d91cb298b1a

๐Ÿš€ My Contributions to โ™ฆ๏ธ Hive Ecosystem

Contribution To Hive Ecosystem
Hive Witness Node Hive API Node (in progress) 3Speak Video Encoder Node Operator (highest number of nodes) 3Speak Mobile App Developer
3Speak Podcast App Developer 3Speak Shorts App Developer 3Speak Support & Maintenance Team Distriator Developer
CheckinWithXYZ Hive Inbox HiFind Hive Donate App
Contributed to HiveAuth Mobile App Ecency โ†” 3Speak Integration Ecency โ†” InLeo Integration Ecency โ†” Actifit Integration
Hive Stats App Vote for Witness App HiveFlutterKit New 3Speak App

๐Ÿ™Œ Support Back

โค๏ธ Appreciate my work? Consider supporting @threespeak & @sagarkothari88! โค๏ธ

Vote For Witness
sagarkothari88 @sagarkothari88
threespeak @threespeak

#hive #development #india #waiv #neoxian #witness #checkinwithxyz #pimp #pob #bro
Payout: 0.000 HBD
Votes: 253
More interactions (upvote, reblog, reply) coming soon.