-
Notifications
You must be signed in to change notification settings - Fork 3
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
Optimize input and output storage #77
Comments
This scheme does not work, because in the history page, users can search by other's address. |
How about searching by https://github.com/nervosnetwork/ckb-indexer#get_transactions when the user search's address is not theirs? @Keith-CY |
It seems work |
There may exist a problem if the user enters an address(e.g. a miner's address) that has many txs, the RPC may use more times to search txs. |
It will implement by these steps:
|
This method will be called multiple times and most of them are useless, how about remove the historical data by |
I don't get this point. This method is used to sync transactions to DB. I mean remove |
I see, I thought it's used to remove historical data |
I will write migrate to remove historical data in step 1, it's the same as |
I found another problem, when we get the transaction list we need to get all |
But the |
Sound like that, I make a mistake to think it needs another's cell to calculate. |
Here https://github.com/nervosnetwork/neuron/blob/develop/packages/neuron-wallet/src/block-sync-renderer/sync/indexer-cache-service.ts#L81 also can be optimized, it gets all transactions from the node every time. We can cache the last block number and get it from the last block number next time. |
Now, every input cell and output cell in the transaction that includes the user's cell will save in SQLite.
If a user deposits
ckb
from an exchange, the transaction will include many inputs and outputs. I found that a user deposits many times from an exchange. And then the input entity and output entity have 500,000 rows and 1000,000 rows, but most of them are not belong to the user. It may affect SQL execution time.So we can save input cells and output cells that only belong to the users, and if we need to get the transaction's detail, we can get it by RPC service.
The text was updated successfully, but these errors were encountered: