Qortal Project

The future of blockchain platforms

User Tools

Site Tools


trade_portal_coin_recovery

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
trade_portal_coin_recovery [12/05/2021 08:15] gfactortrade_portal_coin_recovery [10/06/2022 14:50] (current) – [LTC, DOGE, DGB, or RVN Recovery] caldescent
Line 3: Line 3:
 {{:45d8cf2d-33c3-469d-8a41-da72c44afea9.jpeg?400|}} {{:45d8cf2d-33c3-469d-8a41-da72c44afea9.jpeg?400|}}
  
-===== QORT Recovery =====+===== LTC, ARRR, DOGE, DGB, or RVN Recovery =====
  
-This only relates to QORT refunds on the seller sideon the rare occasion that a trade fails half way through. LTC/DOGE refunds on the buyer side are unaffected.+If you are buying QORT (by spending LTCARRR, DOGE, DGB, or RVN) and the trade fails, it should enter the "REFUNDING" state after 1 hour. This happens occasionally if they buyer and seller's nodes aren't able to communicate properlyThe LTC, ARRR, DOGE, DGB, or RVN should be returned to your wallet with around 30 mins of the trade entering the REFUNDING state (a total of 1.5 hours after the trade began).
  
-The AT becomes eligible for refunding after a certain amount of time has passed in the TRADING state. We’re still unsure exactly how long this is - will have some more info on this soon+If for some reason you have not received the LTC / ARRR / DOGE / DGB / RVN refund (or the purchased QORT) after 2 hours, you can call the refundAll API to retry any failed refunds.
  
-Since 2.1 (sleeping ATs) you need to issue a cancel request to trigger the refund once that time has passed. This should wake up the AT and execute the refundLonger term we may be able to do this automatically without needing to cancel it.+For this, you will need your node's API key, which can be found in the apikey.txt file in the folder that you installed the core. This will be the same place that you have the qortal.jar and db folder. Copy the contents of this apikey.txt file to your clipboard, then visit this link:
  
-We thought there was a button in the UI, but after checking the code it looks like the UI hides it in this state. We’ll see about modifying that in the next version.+[[http://localhost:12391/api-documentation/#/Cross-Chain%20(Hash%20time-locked%20contracts)/refundAllHtlc|http://localhost:12391/api-documentation/#/Cross-Chain%20(Hash%20time-locked%20contracts)/refundAllHtlc]]
  
-This new requirement to cancel was an unintended consequence of sleeping ATs - essentially a bug. So it may take a little while to smooth things out.+Under "POST /crosschain/htlc/refundAll", click "Try it out", paste the API key, then click "Execute".
  
-An alternate option to cancelling (and only option at the moment) is to send any transaction at all to the ATThe easiest option is to send the AT a tiny amount of QORT:+`true` will be returned if anything was able to be refunded. `false` will be returned if there is nothing to refund. Alternatively, an error will be returned if it's unable to run the refund process.
  
-  - Find the trade's `atAddress` via this API and copy it: http://localhost:12391/api-documentation/#/Cross-Chain%20(Trade-Bot)/getTradeBotStates (you will need to find the one that matches the QORT and/or LTC amount +As an alternative to the link aboveyou can use the command line (replace `apiKeyGoesHerewith your API key):
-  - In the UIgo to ‘Send Coin’ +
-  - Select QORT +
-  - In the amount, enter `0.00000001` +
-  - In the ‘To’ field, paste the `atAddress` value that you copied +
-  - Click ‘Send’+
  
-If the AT has reached its refund timeout (the exact time is still being determined) then it should then enter REFUNDING mode. CalDescent is going to try and keep an eye on failed trades on the network and will take care of this process on behalf of users, so most shouldn't need to worry about this.+''curl -X POST "http://localhost:12391/crosschain/htlc/refundAll" -H  "accept: text/plain" -H  "X-API-KEY: apiKeyGoesHere"''
  
 +Either method is fine and they both achieve the same result.
  
-===== LTC & DOGE Recovery ===== 
  
-There is currently a bug in the core that can cause it to go into the BOB_REFUNDED state even though the coins have soldGenerally calling the <code>redeemAll</code> API should be enough to credit the missing LTC or DOGE to your wallet.+If refundAll returned `false`, you may need to import your archived trades and try againTo do this, you can use the API documentation again: http://localhost:12391/api-documentation/#/Admin/importArchivedTrades
  
-You should be able to run this command directly in a terminal window. It has to be on the same machine that you originally listed the QORT for sale on, the core must be runningand the db folder in your qortal directory must not have been replaced with a bootstrap since listing the QORT.+Under "POST /admin/repository/importarchivedtrades"click "Try it out", paste the API keythen click "Execute".
  
-<code>curl -X GET “http://localhost:12391/crosschain/htlc/redeemAll/LITECOIN" -H  "accept: text/plain"</code> +The command line alternative for this is:
- +
-Alternatively, you can go to the API documentation via this link, click "Try it out", then "Execute": +
- +
-[[http://localhost:12391/api-documentation/#/Cross-Chain%20(Hash%20time-locked%20contracts)/redeemAllHtlc|http://localhost:12391/api-documentation/#/Cross-Chain%20(Hash%20time-locked%20contracts)/redeemAllHtlc]] +
- +
-Either method is fine and they both achieve the same result.+
  
-If you have replaced the db folder since originally listing the QORT, there are a couple of possible options for recovery:+''curl -X POST "http://localhost:12391/admin/repository/importarchivedtrades" -H  "accept: text/plain" -H  "X-API-KEY: apiKeyGoesHere"''
  
-  - If you still have a copy of the old db folder, just stop the core, then rename the current one to something else like “db_new”, then move the old one (named “db”) into its place. Start the core and then try the command again. +Once archived trades are imported, you can re-run the refundAll to speed up any refunds from these trades.
-  If you don't have the old db folder, search your system for both “TradeBotStates.script” and “TradeBotStates.json”. These would normally be found in your qortal directory, or in the “qortal-backup” subfolder. You would then need to import these files in order to give your core access to the trades contained in the backup. The actual import process is quite complicated so we won't detail it out here, but if anyone does find themselves in this situation please let us know and we can write up some instructions.+
trade_portal_coin_recovery.1638710141.txt.gz · Last modified: 12/05/2021 08:15 by gfactor