Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR to add komodo rewards data to insight explorer ui #4

Open
wants to merge 9 commits into
base: kmd-rewards
Choose a base branch
from

Conversation

gaeacodes
Copy link

Pending rewards display format change.

@gaeacodes gaeacodes marked this pull request as ready for review March 8, 2021 13:03
@gaeacodes
Copy link
Author

updated kmd rewards
Updated KMD rewards view as suggested.
was not able to add reward info to the getRawTransaction RPC :( .
can update all the layers to use the reward info from getRawTransaction if someone else can add it to komodod.

cc: @ca333

@pbca26
Copy link

pbca26 commented Mar 9, 2021

can you elaborate on getRawTransaction?
i'm familiar with insight explorer internals, perhaps i can offer a suggestion

@gaeacodes
Copy link
Author

We are calculating the reward info of a transaction in the bitcore-node layer.This means we are sending too many RPC calls to komodod to get data for each transaction and it's inputs.If we have the reward info in the getrawtransaction of komodod already, then all the spammy requests to komodod can be prevented.

@pbca26
Copy link

pbca26 commented Mar 10, 2021

node.services.bitcoind.getDetailedTransaction already provides pre-populated inputs and outputs data which doesn't require additional overhead to pull data for each input
you can call this method from insight-api-komodo module
i believe this should solve the issue and no extra code into komodod will be needed

@gaeacodes
Copy link
Author

gaeacodes commented Mar 10, 2021

node.services.bitcoind.getDetailedTransaction

We are already using this to access transaction data.but for a transaction, to calculate the reward claimed/was eligible to be claimed, we need the locktimes,height etc., of the transactions of each of the inputs.So, if a transaction has 20 inputs we need to call node.services.bitcoind.getDetailedTransaction 20 times for the data of each of the inputs.

But,if this reward info for a transaction is available from komodod in an RPC, all these requests are not needed.

cc: @pbca26

@pbca26
Copy link

pbca26 commented Mar 10, 2021

right, i missed that
since you already pulling details for each input the only way to reduce the load is to keep a local index of all transactions with extra details (locktime, blocktime)
i mean you already have most of the code written, just a matter of further optimization
perhaps it's best to keep things as they are w/o bloating komodod

@gaeacodes
Copy link
Author

As far as I know bitcore-node-komodo just has caches for transactions,addresses etc., and the caches are lost with each restart of the explorer.Do you know if there is a database already integrated in the bitcore-node layer so that the data can persist across restarts/crashes?

@pbca26
Copy link

pbca26 commented Mar 10, 2021

Yes you are correct, unfortunately this is a legacy product and it doesn't have a DB on it's own. I'm working on a related changes for the explorer and ran into the same issue where local DB is needed.

I know for a fact that insight explorer v8.0 is using a local DB instance since bitcoind doesn't have insight related code anylonger in it's code base. However, their API completely changed and it would require quite an amount of work to add KMD support to v8. I might be wrong but I think Zcash is not supported either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants