Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

kv support cleos #9536

Merged
merged 3 commits into from
Sep 30, 2020
Merged

kv support cleos #9536

merged 3 commits into from
Sep 30, 2020

Conversation

kimjh2005
Copy link
Contributor

@kimjh2005 kimjh2005 commented Sep 30, 2020

Change Description

Cleos needs to be updated to use this new get_kv_table_rows API similarly to how the current cleos get table command uses get_table_rows.

Change Type

Select ONE

  • Documentation
  • Stability bug fix
  • Other
  • Other - special case

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

Syntax)

cleos get kv_table --help
Retrieve the contents of a database kv_table
Usage: bin/cleos get kv_table [OPTIONS] account table index_name

Positionals:
account TEXT REQUIRED The account who owns the table
table TEXT REQUIRED The name of the kv_table as specified by the contract abi
index_name TEXT REQUIRED The name of the kv_table index as specified by the contract abi

Options:
-h,--help Print this help message and exit
-l,--limit UINT The maximum number of rows to return
-k,--key TEXT Deprecated
-L,--lower TEXT JSON representation of lower bound value of key, defaults to first
-U,--upper TEXT JSON representation of upper bound value of key, defaults to last
--encode-type TEXT The encoding type of index_value, lower bound, upper bound 'bytes' for arbitrary hexdecimal bytes 'dec' for decimal encoding string of (uint64t , uint128_t , float64, float128) 'hex' for hexdecimal encoding string
-b,--binary Return the value as BINARY rather than using abi to interpret as JSON
-r,--reverse Iterate in reverse order
--show-payer Show RAM payer
ex)
cleos get kv_table --encode-type name -L boba -U bobj kvtable kvtable primarykey
cleos get kv_table --encode-type name -k boba kvtable kvtable primarykey
cleos get kv_table --encode-type hex -k 1 kvtable kvtable foo
cleos get kv_table --encode-type dec -k 1 kvtable kvtable foo
cleos get kv_table --encode-type dec -L 2 -U 5 kvtable kvtable foo
cleos get kv_table -r -b --encode-type dec -L 2 -U 5 kvtable kvtable foo

plugins/chain_plugin/chain_plugin.cpp Show resolved Hide resolved
plugins/chain_plugin/chain_plugin.cpp Show resolved Hide resolved
plugins/chain_plugin/chain_plugin.cpp Outdated Show resolved Hide resolved
plugins/chain_plugin/chain_plugin.cpp Show resolved Hide resolved
plugins/chain_plugin/chain_plugin.cpp Outdated Show resolved Hide resolved
plugins/chain_plugin/chain_plugin.cpp Outdated Show resolved Hide resolved
programs/cleos/main.cpp Outdated Show resolved Hide resolved
plugins/chain_plugin/chain_plugin.cpp Show resolved Hide resolved
tests/get_kv_table_nodeos_tests.cpp Show resolved Hide resolved
tests/get_kv_table_tests.cpp Outdated Show resolved Hide resolved
@kimjh2005 kimjh2005 merged commit 0c33d16 into develop Sep 30, 2020
@heifner heifner deleted the kv_support_cleos branch June 10, 2021 16:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants