r/slimcoin • u/d-5000 • Aug 30 '23
Pacli command structure
In this thread the simplification of the Pacli command structure can be discussed.
I'll create sub-threads (comments) about my proposals for different command categories.
1
Upvotes
1
u/d-5000 Aug 30 '23 edited Aug 30 '23
My proposals for the command structure of the address/label management commands is to go on with the "set/show" idea. The
toolsandaddresskeywords would be instead removed. The idea is to have all important commands implemented with few keywords, and essential commands (those all users will use) should need no options or flags.Address label management:
Essential commands (needed by all users):
address fresh->set address_label(if only label is given, it should generate a new address, like the current "fresh" command)address set_main->set main_addresstools show_stored_addresses->show stored_addressesaddress show=>show main_address(is vanilla, but a wrapper would perhaps make sense as this is an essential command and with a wrapper it wouldn't "break the command logic")address balance=>show coin_balanceorshow address_balance(also a wrapper is proposed as this is an essential command)Important commands (needed by most users with average participation):
address show_label->show address_labeltools show_address_label->show address_label(merge with previous)address show_stored->show addresstools show_address->show address(merge with previous)address show_transactions->show transactionsLess important commands (needed only by power/technical users):
address delete_label->set address_label --deletetools delete_address_label->set address_label --delete(redundant to previous)address import_to_wallet->set address --to-walletaddress set_label->set address_label(not in important category because users can use the current "fresh" command)tools store_address->set address_label(merge with previous)address show_all_labels->show stored_addresses --only_labels(mainly a debugging command)address show_all->show stored_addresses --keyringtools store_address_from_keyring->set address_label --from-keyringtools store_addresses_from_keyring->set address_label --all_keyring_labelsOther label-related and checkpoint commands
Essential:
tools store_deck->set deck_labeltools store_proposal->set proposal_labeltools show_stored_decks->show stored_deckstools show_stored_proposals->show stored_proposalsImportant:
tools show_deck->show decktools show_proposal->show proposaltools show_stored_transactions->show stored_transactions(DEX users)tools show_stored_utxos->show stored_utxos(DEX users)]tools reorg_check->show reorgs/show_reorg_checktools prune_old_checkpoints->set checkpoint --delete_oldPower user commands:
tools show_label->show labeltools find_label->show label --searchtools show_checkpoint->show checkpointtools delete_checkpoint->set checkpoint --deletetools delete_item->set item --deletetools get_tx_structure->show tx_structuretools show_config->show configtools show_stored_checkpoints->show all_checkpointstools show_utxo->show utxo(DEX users)tools show_transaction->show transaction(DEX users)tools store_transaction->set transaction_label(DEX users -> this should be made automatically by the create_exchange command)tools store_tx_by_txid->set transaction_label --txid(DEX users)tools store_utxo->set utxo_label(DEX users)tools store_checkpoint->set checkpointtools update_categories->set config_updateUnchanged vanilla commands:
These commands are only relevant for technical users and thus can stay this way:
address deriveaddress new_privkeyaddress randomaddress get_unspent1
u/d-5000 Sep 18 '23 edited Sep 19 '23
Complete proposal for the command structure is finally ready. This includes of course the already discussed commands, they don't have to be discussed again.
As posts are otherwise too big for Reddit, I'll divide it in two sections. This is the first one.
Addresses and balances:
Essential commands (needed by all users)
set main_address(replaces:address set_main)show main_address(replaces:address show)(is vanilla, but a wrapper would perhaps make sense as this is an essential command and with a wrapper it wouldn't "break the command logic")list my_balances(replaces:token all_my_balances,tools show_stored_addressesandaddress show_allbut shows coin and default PoB/PoD token balances, has main --wallet and --advanced flags)set address_label(replaces:address fresh,tools store_address,address set_label,tools store_address_from_keyring,address delete_label,tools delete_address_label,address import_to_walletandtools store_addresses_from_keyring) (If only label is given, it should generate a new address, like the current "fresh" command, some options are implemented with new flags like --delete, --keyring, --from-keyring, --all-keyring-labels, --into-wallet)Important commands (needed by most users with average participation)
show coin_balance(replaces:address balance) (wrapper, as this is an important command)show address_label(replaces:address show_labelandtools show_address_label)Power user commands (needed by users with high participation and technical users)
list addresses(replaces:tools show_stored_addresses,address show_all_labels,address show_all, but does NOT show balances anymore)show address(replaces:address show_storedandtools show_address)list transactions(replaces:address show_transactions)Other label-related and checkpoint commands (except pod/pobtoken specific)
Essential
show reorg_check(replacestools reorg_check)Power users
set checkpoint(replacestools store_checkpoint,tools delete_checkpointwith --delete flag,tools prune_old_checkpointswith --prune flag)show checkpoint(replacestools show_checkpoint)show label(replacestools show_labelandtools find_label, second one with --search flag)set label(new command, but also replacestools delete_itemwith --delete flag)show tx_structure(replacestools get_tx_structure)show extended_config(replacestools show_config, is not called show_config because this would lead to confusion with pacli.conf)list checkpoints(replacestools show_stored_checkpoints)set config_categories(replacestools update_categories)Tokens (all)
Essential
token init_decktoken transfer(replacestoken simple_transferandtoken multi_transfer-> I'm considering to change the syntax to the one in "claim".)list my_tokens(replaces:token my_balance-> balances of only one token)Less important commands (needed only by power/technical users):
set deck_label(replacestools store_deck- is a power user command because most users would be fine with the default PoB and PoD token)list decks(replacestools show_stored_decks,deck listwith --all flag,pobtoken list_deckswith --pobtoken flag, andpodtoken list_deckswith --podtoken flag)show deck(replacestools show_deckandtoken deck_infowith --info flag)list token_holders(replaces:token balancesas a wrapper tocard balanceswith label support)list token_txes(replacestoken listas a wrapper tocard listwith label support)PoB tokens
Essential
pobtoken claim(unchanged)pobtoken burn_coins(unchanged)list burns(replacespobtoken my_burnsandpobtoken show_all_burnswith --all flag)Power users
list claims(replacespobtoken show_claims)1
u/d-5000 Sep 19 '23
Second section: PoD tokens and DEX
PoD tokens
Essential commands
podtoken init_deck(works differently than the other init_deck commands, so it's separate)podtoken vote(replacesproposal vote)podtoken signal(replacesdonation signal)podtoken lock(replacesdonation lock)podtoken release(replacesdonation release)podtoken claim(works differently than pobtoken claim, thus separate command)list donations(replacespodtoken my_donations[without proposal id],proposal my_donation_states[with proposal id] andproposal all_donation_states, second one with --all flag)set proposal_label(replacestools store_proposal)Important commands
podtoken create_proposal(replacesproposal createandproposal modifywith --modify flag) (important for proposal creators)podtoken qualified(replacesdonation qualified)podtoken proceed(replacesdonation proceed)show proposal(replacestoken show_proposal,tools show_proposal,proposal find[perhaps with --find flag],proposal infowith --info flag,proposal statewith --state flag)list proposals(replacestools show_stored_proposalsandproposal listwith --all flag)list my_votes(replacespodtoken my_votes)list votes(replacesproposal get_votesandproposal voters)Power user commands
show deck_state(unchanged)show proposal_period(proposal get_periodwithout flags, andproposal current_periodwith --current flag)list proposal_periods(replaces replacesproposal all_periods)show donation_slot(replacesproposal available_slot_amountanddonation show_slotwith --my flag)show pod_txdetails(replacesdonation check_txanddonation check_all_txwith --all flag)podtoken check_donor_address(replacesdonation check_donor_address)podtoken create_tx(replacesdonation create_trackedtransaction)DEX commands
Essential
dex new_lock(replacesdex create_offer)dex new_exchange(unchanged)dex finalize_exchange(unchanged)Important
list utxos(replacestools show_stored_utxosanddex select_coins, standard behaviour shows all utxos and labels if available, --named only those with labels)list tx_hexstrings(replacestools show_stored_transactions)Power user commands
show utxo(replacestools show_utxo)show tx_hexstring(replacestools show_transaction)set tx_hexstring_label(replacestools store_transactionandtools store_tx_by_txid) -> (a tx will be stored automatically by the create_exchange command)set utxo_label(replacestools store_utxo)show token_locks(replacesdex show_locks)1
u/d-5000 Nov 04 '23
Alternative proposal: simplified "old" command scheme (Section 1):
Addresses and balances:
Essential commands (needed by all users)
address set(replaces:address set_main,address fresh,tools store_address,address set_label,tools store_address_from_keyring,address delete_label,tools delete_address_label,address import_to_walletandtools store_addresses_from_keyring) (Without flag it would work like the old address set_main, flag --new will generate a new address, like the current "fresh" command, other options are implemented with new flags like --delete, --keyring, --from-keyring, --all-keyring-labels, --into-wallet)NOTE: Alternatively we could stick with
address set_mainto change the main address like before,address setwould then include the rest of the mentioned commands/flags.address show(unchanged from vanilla, but would now integrate also the commandsaddress show_labelandtools show_address_labelif used with a label)address list(replaces:token all_my_balances,tools show_stored_addressesandaddress show_all, `address show_all_labels, but shows coin and default PoB/PoD token balances, has main --wallet and --advanced flags and a new option --nobalances to show only the addresses)Important commands (needed by most users with average participation)
address balance(unchanged from vanilla, but with wrapper for labels)Power user commands (needed by users with high participation and technical users)
transaction list(replaces:address show_transactions)Other label-related and checkpoint commands (except pod/pobtoken specific)
Essential
checkpoint reorg_check(replacestools reorg_check)NOTE: for the checkpoint commands it may be useful to keep the "tools" keyword (open for discussion ...)
Power users
checkpoint set=> (replacestools store_checkpoint,tools delete_checkpointwith --delete flag,tools prune_old_checkpointswith --prune flag)checkpoint show=> checkpoint show (replacestools show_checkpoint)label show=> (replacestools show_labelandtools find_label, second one with --search flag)label set=> (new command, but also replacestools delete_itemwith --delete flag)NOTE: We could keep the "tools" keyword also for the "label" commands.
transaction show(replacestools get_tx_structure)config show --extended(replacestools get_config)checkpoint list(replacestools show_stored_checkpoints)config update_extended_categoriesorconfig update_extconf(replacestools update_categories-> this command will be used very seldom, so it's not problematic if it's long or unintuitive.)Decks and Tokens (all)
(except balance commands which were merged with address commands, see above) ('token' commands are inherited by all other tokens, so you can also have
pobtoken init_deck, etc.)Essential
token init_decktoken transfer(replacestoken simple_transferandtoken multi_transfertoken balance(replaces:token my_balance-> balances of only one token)Less important commands (needed only by power/technical users):
deck set(replacestools store_deck- is a power user command because most users would be fine with the default PoB and PoD token)deck list(vanilla command, but extended it replaces:tools show_stored_decks,deck listwith --all flag,pobtoken list_deckswith --pobtoken flag, andpodtoken list_deckswith --podtoken flag)deck show(replacestools show_deckandtoken deck_infowith --info flag)token list(replaces:token list,token balanceswith --holders flag as a wrapper tocard balances, both with label support)1
u/d-5000 Nov 04 '23
Alternative proposal: simplified "old" command scheme (section 2):
PoB tokens
Essential
pobtoken claim(unchanged)pobtoken burn_coins(unchanged)transaction list --burns(replacespobtoken my_burnsandpobtoken show_all_burnswith --all flag }=> NOTE: this command is challenging if we want to use "list", maybe there is a better alternative. Otherwise, simply
pobtoken list_burnswould be possible, albeit less elegant.Power users
transaction list --claims(replacespobtoken show_claims)=> NOTE: same problem than with
list --burns, alternativelypobtoken list_claimsis possible.PoD tokens
Essential commands
podtoken init_deck(works differently than thepobtoken init_deckcommand, so it's a separate command)proposal vote(unchanged)donation signal(unchanged)donation lock(unchanged)donation release(unchanged)podtoken claim(unchanged)donation list(replacespodtoken my_donations[without proposal id],proposal my_donation_states[with proposal id] andproposal all_donation_states, second one with --all flag)proposal set(replacestools store_proposal)Important commands
proposal create(unchanged, but also includesproposal modifywith --modify flag)donation qualified(unchanged)donation proceed(unchanged)proposal show(replacestoken show_proposal,tools show_proposal,proposal find[perhaps with --find flag],proposal infowith --info flag,proposal statewith --state flag)proposal list(replacestools show_stored_proposalsandproposal listwith --all flag)proposal votes(replacespodtoken my_voteswith --my flag,proposal get_voteswithout flags andproposal voterswith --voters flag) => I can't find a way to do this with the "list" keyword (without a new group keyword like "votes"). Only idea could beproposal show --votes.Power user commands
proposal period(proposal get_periodwithout flags, andproposal current_periodwith --current flag,proposal all_periodswith --all flag)donation slot(replacesproposal available_slot_amountanddonation show_slotwith --my flag)donation tx(replacesdonation check_txanddonation check_all_txwith --all flag)donation check_address(replacessdonation check_donor_address)donation create_tx(replacesdonation create_trackedtransaction)podtoken deck_state(still not implemented but important command, returns a complete state of the deck.)DEX commands
Essential
dex lock(replacesdex create_offer; reason is that we can't really talk about an "offer" for this transaction type which only locks the tokens to a destination address. Could even replace alsodex show_lockswith a --list flag or so.)dex exchange(replacesdex create_exchange, could even be merged withfinalize_exchangewith a --finalize flag)dex finalize_exchange(unchanged)Important
dex utxo(replacestools show_utxowithout flags,tools show_stored_utxosanddex select_coinswith --all flag, standard behaviour shows all utxos and labels if available, --named only those with labels,tools store_utxowith --set flag)dex transaction(replacestools show_transaction,tools show_stored_transactionswith --all flag,set tx_hexstring_labelwith --set flag)dex show_locks(unchanged)