Chainquery integration #49
No reviewers
Labels
No labels
area: devops
area: discovery
area: docs
area: livestream
area: proposal
consider soon
dependencies
Epic
good first issue
hacktoberfest
help wanted
icebox
level: 1
level: 2
level: 3
level: 4
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
on hold
php
priority: blocker
priority: high
priority: low
priority: medium
resilience
Tom's Wishlist
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/block-explorer#49
Loading…
Reference in a new issue
No description provided.
Delete branch "chainquery"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In this version, the block explorer is directly connected to Chainquery to retrieve all data.
What is changed here is mainly the SQL queries because of the different structures between Chainquery data and the block explorer database. Now the block sync process becomes useless, but the local database is still used to keep Price History.
There may still be some bugs, please share them here so that I can fix them.
Some data is inaccurate, such as the block nonces for first blocks, but it's reflecting Chainquery's data, which is now the reference.
Issues due to data inaccuracy such as #3, #45, #8, #31 are now solved.
Also, it seems that the circulating supply is closer to 200M and not 212M like shown in the previous version. This is because of a repeated address in the old calculation (
3eab838967/src/Controller/MainController.php (L905)
) and wrong balances for addresses.The repeated address would have made the circulating supply smaller, not larger. Also, balance issues only on those addresses would have affected this.
What's the total supply look like in comparison to
584,781,965
(current). 200M does sound closer if subtracting our current reserved balance from the 584M figure, given that we have a few million LBC on hot wallets.@tiger5226 do you think this is ready to go as is?
Thanks @marcdeb1 for taking this on, can't wait to see what other cool things we can do with chainquery here!
@tzarebczan Yes, it is ready to put in a dev environment to play with for a week or two. There are a few known issues with the Chainquery data that the full sync @nikooo777 will be doing with his machine will solve and a few I need to solve. Once that is done, moving it to production should be fine. The price history needs to be moved to internal-apis. There is an issue for that already, I will move it up in priority so it does not block this.
The next step here is for @nikooo777 to provide a machine to run this on, exposed so we can play with it for a bit to find any issues with the data. Most of this data has been in Chainquery for some time now, however, visualizing the data like this is new. So if there are any bugs in this area we will notice them right away.
@marcdeb1 Looks like travis doesn't like this. Can you make sure this still works with travis with your changes? Feel free to adjust the travis.yml so it considers this new integration.
Could you please rebase onto master to get the latest changes in? I'm deploying this on a test server
you can see a running version here: https://beta.explorer.lbry.io/
Sweet! Some things I noticed:
blocksize chart is not working
Suppy is incorrect: https://beta.explorer.lbry.io/api/v1/supply - {"success":true,"utxosupply":{"total":null,"circulating":-381116086.0784012}}
Thanks for the beta link, looks good !
@tzarebczan for the circulating supply it is close to 200M (584 - 381).
It is negative because total amount is taken from redis that might not be setup on the server. 381M is the total balance in reserved addresses.
I will check what's wrong with the blocksize chart.
Yes redis isn't configured on the server for this beta. I left the config default to use "file" rather than redis. shouldn't that work too?
Network on mainpage shows NA, should show GH/s.
When searching for "one" , the controlling claim (https://beta.explorer.lbry.io/claims/008401a48cecef2a13cf5376b696169bb36b18c6) doesn't show. We should show controlling first, mark as such, and then allow sorting of rest:
I'm having issues deploying this last version. is it working?
Hey Niko, what are the issues ?
@marcdeb1 I just pulled the latest changes in and I am getting the following. Hope this helps:
Yep that's the issue I was getting
@shyba noticed that going to https://beta.explorer.lbry.io/claims?page=6360 (last page), takes a really long time to load. Not sure why that would be - maybe pagination not being called correctly somewhere?
Query takes a long time on Chainquery, try : https://chainquery.lbry.io/api/sql?query=SELECT%20*%20FROM%20claim%20LIMIT%20100%20OFFSET%20300000
Please check if there are any issues.
I cannot get Travis to work (For PHP 7.0, check is failing because some packages require 7.1, for 7.1 it's because of the database name chainquery.lbry.io that cannot be parsed).
Updated! good job!
API works too: https://beta.explorer.lbry.io/api/v1/supply?/api/v1/supply
Awesome ! And it's really fast too
Very Fast!!! Very impressive! This is really exciting! I think this was the last block explorer item blocking this(besides CI). The rest are Chainquery items.
For the CI failures, I think we just need to run the composer updates for the
./composer.json
. Then it should be able to find the combination of packages. It sounds like it hit a deadlock on package dependencies. @akinwale Can you take a look at the CI logs? We should make sure this is fixed before we merge.Please let me know when this is ready to be merged/deployed so I can coordinate.
@marcdeb1 Please change the DSN string to
mysql://chainquery.lbry.io:3600
as this is causing the Travis build to fail. Thanks.@nikooo777 This can be merged if there are no other changes required. The Travis build isn't a blocker.
cc @tiger5226 @tzarebczan
@marcdeb1 For the slow query it is because offset is being used. see here https://www.eversql.com/faster-pagination-in-mysql-why-order-by-with-limit-and-offset-is-slow/
We could adjust it to use a seek strategy, but I dont think this is a blocker as the original takes 3 times as long.
alright I merged it, i'm deploying too. Please continue with the non blocking issues if any