A sends a transaction to B. Now, A goes offline and after hours the transaction hasn't been confirmed, so B wants to reattach it to ensure confirmation. How should that be performed, in a user-friendly manner, since all B has is the transaction hash?
3 Answers
Note that the code posted here is not a user-friendly solution, but somebody could easily wrap it up on a webpage with a nice UI.
Just give the code the tail hash (i.e. transaction hash of the transaction with index 0) of the bundle you want to get confirmed:
var node = 'http://service.iotasupport.com:14265';
var tailHash = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA';
var depth = 3;
var minWeightMagnitude = 14;
var IOTA = require('iota.lib.js');
var iota = new IOTA({
'provider': node
});
iota.api.replayBundle(tailHash, depth, minWeightMagnitude, function(error, bundle) {
if (error) {
console.log(error);
} else {
console.log(bundle);
console.log('Reattached successfully');
}
});
Since B has the transaction hash, he can find the transaction inside of the Tangle (full node or tangle explorer)
He would take the transaction, do the tip selection + the Proof of work again and then broadcast the transaction. (=reattaching)
B does not need the seed (or private keys) of A to sign the transaction because it has already been signed by A.
It would work that way, but there is no GUI (i know of) that you can use to do it in a user-friendly way.
-
I understand it, but how to do that? There is no user-friendly manner of doing that, at least i don't know how yet.– Th3B0YCommented Dec 3, 2017 at 0:22
Although @Laurence's answer is correct, I would like to point out a website developed by a community member which does the reattachment/promoting in a user-friendly manner: http://www.reattach.online