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

txo_list adds many new ownership filters such as --is_my_input, --is_my_output, etc and some metadata filters such as --channel_id, --reposted_claim_id, etc and a new command txo_sum which takes the same arguments as txo_list and produces sum of outputs #2862

Merged
merged 11 commits into from
Mar 21, 2020

Conversation

eukreign
Copy link
Member

@eukreign eukreign commented Mar 18, 2020

fixes #2853
fixes #1853
release-text-lines:
This release includes changes to the client side database schema which will trigger a reset of your blockchain.db and perform full sync on startup.

In this release the txo_list command has reached its full potential in being able to filter specific transaction outputs based on who made them and who controls them which allows for differentiating between "supports" and "tips" and many other use cases. This release also introduces a new txo_sum command which takes almost all of the same arguments as txo_list but produces a sum of the outputs that txo_list would have returned in full, useful for making reports.

Below are some examples and use cases of how to use txo_list.

Get all of the tips you've received from others on claim "xyz" (assuming "xyz" is your claim):
lbrynet txo list --is_my_output --is_not_my_input --type="support" --claim_id="xyz" --unspent

Sum of all of the tips you've sent to claim "xyz" (assuming "xyz" is not your claim):
lbrynet txo sum --is_my_input --is_not_my_output --type="support" --claim_id="xyz"

Note: --unspent is missing above, this is because the local database (at least in desktop app) doesn't know the status of outputs after you've sent them to someone else, therefore filtering by unspent is meaningless here (anytime you pass --is_not_my_output).

Sum of all of the non-tip supports you've sent to claim "xyz" (assuming "xyz" is not your claim):
lbrynet txo sum --is_my_input --is_my_output --type="support" --claim_id="xyz" --unspent

Anything someone just sent me:
lbrynet txo list --is_not_my_input --unspent

Emulate channel list:
lbrynet txo list --type=channel --unspent

Emulate support list:
lbrynet txo list --type=support --unspent

Another flag added is --no_totals which is useful if you expect a very large result set, want a performant pagination and don't need to know total number of pages. (or, a more clever strategy, is to get total once and cache the size for some period of time and then do subsequent calls with --no_totals as user paginates)

Also, --order_by supports a value of none which is useful in certain situations where you don't care about the order and want maximum performance (or, if you just want to see performance impact actually is of sorting the result).

@eukreign eukreign force-pushed the txo_list_support_sent_outputs branch from 29bf647 to 6293e22 Compare March 20, 2020 23:08
@eukreign eukreign changed the title WIP: txo_list returns txo funded by my account but sent to external address WIP: txo_list adds many new ownership filters such as --is_my_input, --is_my_output, etc and some metadata filters such as --channel_id, --reposted_claim_id, etc and a new command txo_sum which takes the same arguments as txo_list and produces sum of outputs Mar 21, 2020
@eukreign eukreign changed the title WIP: txo_list adds many new ownership filters such as --is_my_input, --is_my_output, etc and some metadata filters such as --channel_id, --reposted_claim_id, etc and a new command txo_sum which takes the same arguments as txo_list and produces sum of outputs txo_list adds many new ownership filters such as --is_my_input, --is_my_output, etc and some metadata filters such as --channel_id, --reposted_claim_id, etc and a new command txo_sum which takes the same arguments as txo_list and produces sum of outputs Mar 21, 2020
@eukreign eukreign added area: api type: new feature New functionality that does not exist yet labels Mar 21, 2020
@eukreign eukreign merged commit 0bba72b into master Mar 21, 2020
@eukreign eukreign deleted the txo_list_support_sent_outputs branch March 21, 2020 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: api type: new feature New functionality that does not exist yet
Projects
None yet
1 participant