# State Query Commands
State-related operations will query the world state of Miyabi and get related information. These commands are all online general reference commands.
# Get Tables
# Usage
Usage: miyabi-cli gettables [Options]
Options:
--help Show help information
# Functionality
Return all tables' descriptors.
# Example
$ ./miyabi-cli.exe --pretty gettables
[
{
"acl": {
"granted": [
[ "0315ebc05445e3f9936732210aefb03781fe38558582666082571d4d6901c18cb9"
],
[ "0315ebc05445e3f9936732210aefb03781fe38558582666082571d4d6901c18cb9"
],
[ "0315ebc05445e3f9936732210aefb03781fe38558582666082571d4d6901c18cb9"
]
]
},
"isReadRestricted": false,
"name": "ContractAssemblies",
"tracked": false,
"supportProofs": false,
"type": "PermissionedBinaryTable"
},
{
"admins": [ "0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"
],
"rules": [
0,
1,
2
],
"voidAddress": "00",
"trustedEntities": [],
"name": "test_asset",
"tracked": false,
"supportProofs": false,
"type": "AssetTable"
},
...
]
# Get History
# Usage
Usage: miyabi-cli gethistory [Options]
Options:
--help Show help information
-t|--table <name> Table name
-k|--key <hex> Key of the entry
-d|--detail Show details
# Functionality
Return the historical transactions that update the entry specified by -t
and -k
.
# Example
$ ./miyabi-cli.exe getheight
[
{
"tx": {
"timestamp": "2019-11-13T05:01:19.5741017Z",
"validFrom": "2019-11-13T05:01:19.5741017Z",
"validTo": "2019-11-13T06:01:19.5741017Z",
"entries": [ "d2a55e00410193b2746573745f61737365745f686973746f7279a431303030c42102c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5"
],
"requiredCredentials": [ "0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"
],
"evidence": [ "3044022064c7ed9b4525a011bcaef07a0d1ecf39ed946dfebe98c923beef07c70e338f6f0220283320e078c0e0c9b910eeefb284ae236ad0ea184097de955df6a193192b1334"
],
"id": "58b65e73812b72754eddb5924b9e8637a1c08b58c8223a8e9e2484484a14e8a7",
"witId": "5b96d4dcb4d14e18a92ae8fbef274338b938f2a18d48f040609a729439b2d4ee"
},
"txPtr": {
"height": 14,
"idx": 0
},
"result": "Success"
},
{
"tx": {
"timestamp": "2019-11-13T05:01:27.8381513Z",
"validFrom": "2019-11-13T05:01:27.8381513Z",
"validTo": "2019-11-13T06:01:27.8381513Z",
"entries": [
"d2a55e00420194b2746573745f61737365745f686973746f7279a3313030c42102c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5c42102f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9"
],
"requiredCredentials": [
"02c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5"
],
"evidence": [ "30440220079523a8a2872d5179beed2c97cb66a6806f43c34ff0312ea80206821c1fda33022026d2d826754b039d6e27d49451b0782e58f043656c3c4c4beefb8405b7fbaa0f"
],
"id": "094c48531fc0e5fb04b6c660e701719b181ec91a6ba9df008c3d7ae67f106374",
"witId": "8d2007905ec63fd9b85cc4aa66caf0e5f156a2443f77e748814a3e5ae6ef6944"
},
"txPtr": {
"height": 15,
"idx": 0
},
"result": "Success"
}
]
# Get State Proof
# Usage
Usage: miyabi-cli getstateproof [Options]
Options:
--help Show help information
-t|--table <name> Table name
-k|--key <hex> Entry key
-h|--hash <hex> Value hash
# Functionality
Return the state proof of entry. The result contains two paths for the existence of table and the existence of table entry. -h
can be used to specify the hash of the value -t
and -k
suggested. The hash should be calculated by RIPEMD160, users can use proof hash to calculate it. If the hash is incorrect, table entry proof will not be generated, however, if the hash is not specified, CLI will automatically calculate it.
# Example
$ ./miyabi-cli.exe --pretty getstateproof -t test_asset_proof -k 02c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5
{
"atHeight": 6,
"proof": {
"tableProof": {
"paths": [
{
"key": "e7513e75f01f2021be16681310dbce1fe2f5d132032f3d6716bfd11e414f2ca7",
"valueHash": "ff9b5284b79855d3e9aff30575c1b17a7561ec70",
"steps": [
1,
1,
1
]
}
],
"neighbours": [
"85f1ff5a478619de21883268271106c4706df582",
"dca624650264e26ed49b6cfa8367f50e098260ed",
"4c9718bebe26fb37930a1782cd0b14670f4d66f5"
]
},
"tableEntryProof": {
"paths": [
{
"key": "02c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5",
"valueHash": "9ff885df94c7d3b743211dbd8e3a262b1e18517d",
"steps": [
0,
1
]
}
],
"neighbours": [
"6fe61cb6684e92f1b59bca53c7695748b371bb38",
"c2c394bfebdfd9dc8891920311c6a14774af564a"
]
}
},
"proofRoot": "48a68eff365ef486954640ce75f2bac165faa56d"
}