dashed-slug.net › Forums › TurtleCoin Adapter extension support › I’m getting ready to replace my hacked up monero adapter with yours
Tagged: coin adapters, installation
- This topic has 38 replies, 2 voices, and was last updated 4 years, 5 months ago by alexg.
-
AuthorPosts
-
July 21, 2020 at 4:55 pm #8916alexgKeymaster
OK, so there’s your culprit. Can you disable W3 Total Cache and try again?
Normally it should work as it is, but it looks like W3TC or memcached may be misconfigured, so transients are not stored.
July 21, 2020 at 5:21 pm #8917alexgKeymasterAlternatively you could go to Performance -> General Settings -> Database Cache and change Database Cache Method: from memcached to disk. This will use your
wp-content/cache
dir for caching. It will be somewhat slower but it should work. If it does, then you can go ahead and debug your memcached server.July 22, 2020 at 10:12 pm #8934d3vnu77ParticipantWe are connected now. Disabling cache completely did that.
But my balance is way off… there should be about 28,000 ARMS in the wallet. But the screenshot shows… much more
And my admin account shows… -40,700 ARMS
This is hooked up to a copy of the original server wallet renamed to n2aa.org.wallet
Attachments:
You must be logged in to view attached files.July 22, 2020 at 10:22 pm #8939d3vnu77ParticipantIt is also displaying the balance with 4 decimals instead of 8 decimals.
Through the API, it looks like it is slowly scanning the block-chain (as seen in screenshot)
Attachments:
You must be logged in to view attached files.July 23, 2020 at 6:51 am #8942alexgKeymasterHello,
That’s great news!
To understand the differences between the “Hot Wallet Balance”, “User Balances”, and “Unavailable Balance”, see the Glossary chapter in the documentation.
In short, the “Hot Wallet Balance” is the result of the
/balance
call to thewallet-api
. The “User Balance” is the sum of transactions for any one user.To find out why your balance is negative, inspect your user’s transactions.
The adapter is supposed to scan the wallet on each cron job, with increasing block heights to conserve bandwidth. The first time it retrieves most of the transactions, and on subsequent runs it scans the remaining blocks that have not yet been scanned. This is expected behavior. If you want to see the logic behind this, it’s at the function
cron_discover_deposits()
.with regards
July 23, 2020 at 6:59 am #8943alexgKeymasterThe number of decimals is set in the filter that defines the coins.
The filter is initialized with values in assets/coins.csv
ARMS,2ACoin,100,0.00001,arms:%s,%01.4f,https://explorer.2acoin.org/?hash=%s#blockchain_transaction,,4
%01.4f is the pattern for displaying amounts, and the last value of 4 is the number of decimals. These values should match.
To modify the values, use the
wallets_turtle_coins
filter described in the adapter’s homepage, to modify the values. Something like:function wallets_turtlecoin_adapter_filter( $coins ) { $coins['ARMS']['amount pattern'] = '%01.8f'; $coins['ARMS']['decimals'] = 8; return $coins; } add_filter( 'wallets_turtle_coins', 'wallets_turtlecoin_adapter_filter' );
However, I don’t think it’s necessary, as 2ACoin has 4 decimals I believe.
with regards
EDIT: Changed
$coins['2ACOIN']
to the correct indexing,$coins['ARMS']
.July 23, 2020 at 2:02 pm #8946d3vnu77ParticipantOk. currently waiting for the blocks to continue scanning. We are to 406000 height at the moment. When it finishes we can check to see if there are still issues.
July 23, 2020 at 2:13 pm #8947d3vnu77ParticipantUnless there is a faster way to force the scanning of the blocks?
July 24, 2020 at 1:49 am #8948alexgKeymasterNot sure but I believe that when the scan finishes, your user balances may not be correct.
1. If a balance is negative, is it possible that you have deleted or cancelled a deposit?2. The hot wallet balance will remain as is after the plugin syncs with the wallet.
If your blockchain daemon is synced to the network, and the wallet api is synced to the blockchain, then the plugin will also sync. If you want to make the plugin go faster, you can go to Wallets -> Cron job and trigger the cron job url several times.
It would be best if you could start with a new wallet and empty wp_wallets_txs DB table, if you are building a new site.
Please let me know what you find.
with regards
-
AuthorPosts
- You must be logged in to reply to this topic.