Proposition to recover data on Hive. (SOLVED)

avatar
(Edited)

(Hello, if you are reading this, I want to let you know that the problem has been solved, and everything is now OK. There's no need to worry anymore! ๐Ÿ™‚ )

Hi!

Last night I made an oopsie, and erased the content of many of my posts on the Hive blockchain.

I used the Steempruner app, and forgot to change the RPC server on my Steem keychain from anyx.io to a Steem specific server. That resulted in Steempruner pruining many of my posts on the Hive blockchain.

Now, I have been suggested that I either copy the content back from the Steem posts, or from the Hive database. But I know it can be done through a similar script or app to the Steempruner.

The only problem: I can't code my way out of a paper bag.

So, what I am proposing is. If someone knows the Hive/Steem blockchain in and out and is proficient in programming, I am willing to pay 2000โ‚ฌ in BTC to the person who comes up with a quick and easy solution to recover my content.


Hive bee approves this offer.

Remember, I don't want to answer questions like "why don't you...?" ever. I just want to reward you if you can do the job, and respect my reasons for wanting to get my content back online.

I am not rich by far, but here's my offer:

2000โ‚ฌ in BTC to the one who comes up with a quick and easy, working solution!

I don't want to spend hours in trying to copypaste my content, so if that's your solution, don't even bother. I want to get back to producing content, not having to worry that people end up on empty pages under my account.

Suggestion: Find current content View this post on Hive:, or created with / via pruner and repopulate the contents of that post with its previous content.

If the solution is easy and quick, I will add a bonus 200โ‚ฌ to the price.



0
0
0.000
16 comments
avatar

Oh, man. You did it on both chains too. Oops. It shouldn't be too hard to code, but then again, I'm not a coder.

0
0
0.000
avatar

Yep... I think it should not be an impossible feat. But I haven't got a slightest clue how to do it. I've done some basic coding excercises when I was younger, but I can't say it's of much use. So it's a bit problematic. Hopefully @engrave will find a way to help.

0
0
0.000
avatar

Too bad it was even possible to prune one's Hive posts with the app in the first place. There was a warning on the page, but a slip up is always possible.

@engrave, it would be nice if you could do it for free with a tweak to your app.

0
0
0.000
avatar

You're in full control of your keys and API nodes when using Keychain. The app cannot decide, force you or prevent from interacting with any node so it's not possible, unfortunately.

0
0
0.000
avatar

Yes, the warning came after the fact I had already messed up. I guess @engrave put it there, and I thank him for doing so for all those other people who might otherwise had done the same mistake I did.

0
0
0.000
avatar

I see. It wasn't there at the time, yet.

Indeed, this wasn't the only case of odd behavior. Some witness nodes had suddenly shifted from witnessing blocks from Steem to doing that for Hive. The worst that happened to me was confusion because I accidentally started powering down on Hive.

0
0
0.000
avatar

How many posts did you lose? I'm already coding a crossposter but it's hive->steem

0
0
0.000
avatar
(Edited)

Everything beginning 12th February 2019. I'm not sure why it didn't prune everything, and even left some posts untouched in between then and now, but gladly it didn't compromise it all. (Although I'm not sure, I didn't do extensive checking for the whole 4 years after all.)

I tried copypasting them back but it was a bit too much to do manually.

I'm already coding a crossposter but it's hive->steem

That sounds interesting. Although I think on my part the story of Steem is over and it is time to turn over a new leaf.

0
0
0.000
avatar
(Edited)

I still have a lot of money on Steem so even though I intend to promote Hive to my maximum ability, I also want to milk these last 3 months while the power down takes place. :P

If the other person who offered services doesn't deliver, ping me and I'll make you the code. I'm in a severe lack of money and I'm a proficient coder ;) And if you need anything else don't hesitate to tell me. I'm making an autovoter, trails, a crossposter and other similar subscription services.

0
0
0.000
avatar

Thank you, I will definitely keep you in mind if I come across something I would need done on the blockchain. :)

0
0
0.000
avatar
(Edited)

I made a little .html page that can copy pruned stuff from Steem back over to Hive. There are better ways of recovering your posts by going through your account history, but that would be harder to do than just copying from Steem.

Here is my janky but working approach, to use it, just create a test.html file and copy that text using a text editor like editor.exe into it, then you can open it in your browser locally and use it. I've seen that people already want to help you, I just wanted to show my approach, I don't expect a reward. ๐Ÿ˜ธ

<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/steem/dist/steem.min.js"></script>
<script src="https://unpkg.com/dsteem@^0.8.0/dist/dsteem.js"></script>
<script>

function startRecovery(){
    window.repairposts = {};
    window.username = document.getElementById("username").value;
    window.postingkey = document.getElementById("key").value;
    recoverposts(window.username,window.postingkey); 
}

function recoverposts(username,postingkey){
    steem.api.setOptions({ url: 'https://anyx.io' });
    steem.api.getDiscussionsByBlog({tag: username, limit: 100, "start_permlink": window.permlink, "start_author": window.author}, function(err, result){
        window.lastpermlink = window.permlink;
        if (err !== null){
            recoverposts(username,postingkey);
        } else {
            result.forEach(recoverpostdata);
            if (window.lastpermlink !== window.permlink){
                setTimeout(function(){ recoverposts(username,postingkey); }, 500);
            } else {
                var repairposts = window.repairposts;
                printStatus("Searched all posts! Repairing now all found pruned posts.");
                startRepair();
            }
        }
    });
}

function recoverpostdata(post, index){
    window.permlink = post.permlink;
    window.author = post.author;
    var meta = JSON.parse(post.json_metadata);
    if (meta.app == "pruner") {
        printStatus("@" + post.author + "/" + post.permlink + " has been pruned, added it to the repair list.");
        var repairposts = window.repairposts;
        repairposts[post.author + "/" + post.permlink] = true;
        window.repairposts = repairposts;
    }
}

function printStatus(text){
    var node = document.createElement("li");
    var textnode = document.createTextNode(text);
    node.appendChild(textnode);
    document.getElementById("status").appendChild(node);
}

function startRepair(){
    var repairlist = window.repairposts;
    var waitperpost = 5000;
    var timesused = 0;
    for (let [key, value] of Object.entries(repairlist)) {
        timesused++;
        var waittime = timesused * waitperpost;
        sleep(waittime).then(() => {
            printStatus("Copying Steem > Hive for @" + key + ".");
            var postdata = key.split("/");
            repairSpecificPost(postdata[0],postdata[1])
        });
    }
}

function repairSpecificPost(author,permlink){
    var client = new dsteem.Client('https://api.steemit.com')
    client.database.call('get_content',[author,permlink]).then(function(post){
        if (post.author == author) {
            if (post.author == author) {
            steem.api.setOptions({ url: 'https://anyx.io' });
                steem.broadcast.comment(window.postingkey, post.parent_author, post.parent_permlink, author, permlink, post.title, post.body, post.json_metadata, function(err, result) {
                    console.log(err, result);
                    if (err !== null){
                        printStatus("Error while repairing @" + post.author + "/" + post.permlink + ":");
                        printStatus(JSON.stringify(err));
                    } else {
                        printStatus("Repaired @" + post.author + "/" + post.permlink + ".");
                    }
                })      }
;
        }
    })
}

function sleep (time) {
  return new Promise((resolve) => setTimeout(resolve, time));
}

</script>
</head>
<body>
    Username: <input type="text" id="username"><br/>
    Posting Key (Private): <input type="text" id="key"><br/>
    <input type="button" onclick="startRecovery()" value="Repair pruned Hive posts"/>
    <ul id="status"></ul>
</body>
</html>
0
0
0.000
avatar

That seems interesting. I'll need to check it out, but I think you were a bit late because a couple hours earlier, @engrave had provided me with a recovery web page of his own.

I don't expect a reward. ๐Ÿ˜ธ

Altruism... I personally love it, but for some it may spoil their efforts. It does create an interesting moral dilemma though. Especially hadn't @engrave delivered first.

But I thank you nevertheless. This looks like an interesting piece of code and I will try to learn a bit of how the blockchains work. Maybe one day I'll be able to do such feats myself who knows.

0
0
0.000
avatar
(Edited)

it may spoil their efforts

That said, I won't give any special support regarding how to use it and there is no warranty that it works as expected. ๐Ÿ˜›

0
0
0.000