# CLI Command Types
The miyabi-cli tool offers a wide range of commands. The commands can be generally categorized on whether:
- The command needs access to a running Miyabi instance
- The command is by default provided as part of miyabi-cli
- The command can update the World State of Miyabi
- The command is available for node admins only
These categories are defined and differentiated below.
# Offline and Online Commands
# Offline Commands
Offline commands can be executed locally on the client machine in isolation. The Miyabi nodes need not be reachable from the client machine for executing any offline command.
# Example
$ ./miyabi-cli createtransaction createassettable -t bFBC_coin -o 034cdae9dd567b23d29c9affef3ce7ff5c1d16d35512bb72a9008ac32839116118 -p 10425b7e6ebf5e0d5918717f77ce8a66aaf92bc64b65996f885ff12bd94ef529
d2c03300020196d7ffcaefb2605e900724d7ffcaefb2605e900724d7ffcaefb2605e90153491c446d2c03304010191d2a55e00210197a9624642435f636f696ec2c291c421034cdae9dd567b23d29c9affef3ce7ff5c1d16d35512bb72a9008ac3283911611893000102c401009091c42102e3c13b6862eda179ac49d03b334ef17cf654c05bd3fa6dc0cf6078fefe82aea291c44730450221009a06118ccfd63d011520caf16fdfb99e3499c5981cc578ffdc401b95e21d066b0220106415ed6245f220f06659828ace4fed5b8f7913c3e9bab93db7669c5ee79c7f
# Online Commands
Online commands require connecting to an actively running Miyabi node. The host information can be provided by any of the following methods:
- Specifying the IP Address/Port in the --host input parameter
- Specifying the configuration file containing the host information, with --config input parameter
- Keeping the above-mentioned configuration file with default name
config.json
in the miyabi-cli execution directory
If the host information cannot be found using the methods above, the default value (https://localhost:9010) will be used.
# Example
$ ./miyabi-cli --config config.json sendtransaction createassettable -t bFBC_coin -o 034cdae9dd567b23d29c9affef3ce7ff5c1d16d35512bb72a9008ac32839116118 -p 10425b7e6ebf5e0d5918717f77ce8a66aaf92bc64b65996f885ff12bd94ef529
9a5c098f99674fed94213909542bab4bc963c9c916669aa862eca6e5631331cd
$ ./miyabi-cli --host https://10.0.0.8:9010 sendtransaction createassettable -t bFBC_coin -o 034cdae9dd567b23d29c9affef3ce7ff5c1d16d35512bb72a9008ac32839116118 -p 10425b7e6ebf5e0d5918717f77ce8a66aaf92bc64b65996f885ff12bd94ef529
9a5c098f99674fed94213909542bab4bc963c9c916669aa862eca6e5631331cd
# Refresh Cache
# Notation
-rcm|--refreshconfigmetadata
# Functionality
The CLI online command stores server metadata information into a local cache to enhance performance.
This cache is automatically refreshed after a specific time interval, as defined in the blockchainConfigCacheExpiryInterval
mentioned in the configuration file.
Additionally, it's possible to manually refresh the metadata cache using the -rcm option.
Please note that this option is only available with sendtransaction
command. (See Transaction Creation Commands.)
# Example
$ ./miyabi-cli sendtransaction -rcm deletetable -t DummyTable
# Core and Module Commands
The miyabi-cli tool is extensible. Miyabi provides a core set of commands out of the box. The Miyabi modules can extend this core set of CLI commands by defining their own new commands. These module-provided sets of commands are referred to as module commands.
# Core Commands
Commands that come out of the box with miyabi-cli.
# Example
$ ./miyabi-cli --config config.json getinfo
{"value":{"name":"026beca06739461a20249fd4b24cf27542013624d18710bc418e8de10d6ef68568","version":"3.2.1","status":"Running","startTime":"2024-01-11T05:48:52.8022838Z","height":22,"mempoolSize":0,"identity":"026beca06739461a20249fd4b24cf27542013624d18710bc418e8de10d6ef68568","networkIdentity":"03ea7014d880a711d82cb41a53f2df6138739f4fb904aca2fa22998d4efe9db7be","role":"Consensus","connections":[],"dbStats":"\n** DB Stats **\nUptime(secs): 89.6 total, 28.3 interval\nCumulative writes: 23 writes, 620 keys, 23 commit groups, 1.0 writes per commit group, ingest: 0.00 GB, 0.00 MB/s\nCumulative WAL: 23 writes, 0 syncs, 23.00 writes per sync, written: 0.00 GB, 0.00 MB/s\nCumulative stall: 00:00:0.000 H:M:S, 0.0 percent\nInterval writes: 7 writes, 168 keys, 7 commit groups, 0.9 writes per commit group, ingest: 0.02 MB, 0.00 MB/s\nInterval WAL: 7 writes, 0 syncs, 7.00 writes per sync, written: 0.00 MB, 0.00 MB/s\nInterval stall: 00:00:0.000 H:M:S, 0.0 percent\n","extensions":["Miyabi.BLS","Miyabi.Binary","Miyabi.Asset","Miyabi.Entity","Miyabi.Contract","Miyabi.NFT","Miyabi.PrivateData"],"txErrorCacheCapacity":8000,"txErrorCacheCount":0},"atHeight":22}
# Module Commands
These commands are supported by specific modules. To execute these commands, modules are either specified by -m|--module or registered inside the configuration file.
# Example
$ ./miyabi-cli --module contract getassemblies
{"value":["09e87e0921869507bec81e0578d26f5b3338ba42cad0cf3713eadb1e9a356ac3","0f71271c032c653b1aee757641c005003d20956f742213a63a862dc9bbcff80f"],"atHeight":1221}
# Query and Update Commands
Query commands and update commands are two classifications of online commands.
# Query Commands
Query commands are used to query Miyabi without modifying its World State.
# Example
$ ./miyabi-cli --config config.json getinfo
{"value":{"name":"026beca06739461a20249fd4b24cf27542013624d18710bc418e8de10d6ef68568","version":"3.2.1","status":"Running","startTime":"2024-01-11T05:48:52.8022838Z","height":22,"mempoolSize":0,"identity":"026beca06739461a20249fd4b24cf27542013624d18710bc418e8de10d6ef68568","networkIdentity":"03ea7014d880a711d82cb41a53f2df6138739f4fb904aca2fa22998d4efe9db7be","role":"Consensus","connections":[],"dbStats":"\n** DB Stats **\nUptime(secs): 89.6 total, 28.3 interval\nCumulative writes: 23 writes, 620 keys, 23 commit groups, 1.0 writes per commit group, ingest: 0.00 GB, 0.00 MB/s\nCumulative WAL: 23 writes, 0 syncs, 23.00 writes per sync, written: 0.00 GB, 0.00 MB/s\nCumulative stall: 00:00:0.000 H:M:S, 0.0 percent\nInterval writes: 7 writes, 168 keys, 7 commit groups, 0.9 writes per commit group, ingest: 0.02 MB, 0.00 MB/s\nInterval WAL: 7 writes, 0 syncs, 7.00 writes per sync, written: 0.00 MB, 0.00 MB/s\nInterval stall: 00:00:0.000 H:M:S, 0.0 percent\n","extensions":["Miyabi.BLS","Miyabi.Binary","Miyabi.Asset","Miyabi.Entity","Miyabi.Contract","Miyabi.NFT","Miyabi.PrivateData"],"txErrorCacheCapacity":8000,"txErrorCacheCount":0},"atHeight":22}
# Update Commands
Update commands can be used to update Miyabi's World State. For a non-admin user, only sendtransaction can be used to update Miyabi's World State by sending transactions which are generated from subcommands.
# Example
$ ./miyabi-cli --config config.json sendtransaction createassettable -t bFBC_coin -o 034cdae9dd567b23d29c9affef3ce7ff5c1d16d35512bb72a9008ac32839116118 -p 10425b7e6ebf5e0d5918717f77ce8a66aaf92bc64b65996f885ff12bd94ef529
9a5c098f99674fed94213909542bab4bc963c9c916669aa862eca6e5631331cd
# General and Admin Commands
# General Commands
General commands are those commands which can be used by any non-admin users. Most of Miyabi CLI commands are general commands.
# Example
$ ./miyabi-cli --config config.json getinfo
{"value":{"name":"026beca06739461a20249fd4b24cf27542013624d18710bc418e8de10d6ef68568","version":"3.2.1","status":"Running","startTime":"2024-01-11T05:48:52.8022838Z","height":22,"mempoolSize":0,"identity":"026beca06739461a20249fd4b24cf27542013624d18710bc418e8de10d6ef68568","networkIdentity":"03ea7014d880a711d82cb41a53f2df6138739f4fb904aca2fa22998d4efe9db7be","role":"Consensus","connections":[],"dbStats":"\n** DB Stats **\nUptime(secs): 89.6 total, 28.3 interval\nCumulative writes: 23 writes, 620 keys, 23 commit groups, 1.0 writes per commit group, ingest: 0.00 GB, 0.00 MB/s\nCumulative WAL: 23 writes, 0 syncs, 23.00 writes per sync, written: 0.00 GB, 0.00 MB/s\nCumulative stall: 00:00:0.000 H:M:S, 0.0 percent\nInterval writes: 7 writes, 168 keys, 7 commit groups, 0.9 writes per commit group, ingest: 0.02 MB, 0.00 MB/s\nInterval WAL: 7 writes, 0 syncs, 7.00 writes per sync, written: 0.00 MB, 0.00 MB/s\nInterval stall: 00:00:0.000 H:M:S, 0.0 percent\n","extensions":["Miyabi.BLS","Miyabi.Binary","Miyabi.Asset","Miyabi.Entity","Miyabi.Contract","Miyabi.NFT","Miyabi.PrivateData"],"txErrorCacheCapacity":8000,"txErrorCacheCount":0},"atHeight":22}
# Admin Commands
Admin commands are those commands which require being signed by the private key of the corresponding node's admin and specify the IP/port of the admin endpoint. These commands are online commands.
# Example
$ ./miyabi-cli --host https://10.0.0.8:8000 -cc admin.p12 getnodeconfig
{"value": {"bindings":["0.0.0.0:3820"],"initialNodes":[],"nodeAdmin":"03046bf1185537b4fc97fd8eab74c5e08cbe306aa7c394de812a8c1b6abcc2e5a4","sslKeyStorePath":"c:\\ssl.p12","consensusKeyStorePath":"c:\\consensuskey.p12","dbConfig":{"baseLocation":"c:\\_configs\\node_000","storageCacheSizeMb":64,"storageCompressedCacheSizeMb":64,"storagePointLookupBlockCacheSizeMb":8},"generalWebApiConfig":{"webApiEndPoint":"https://+:9010/","serverKeyStorePath":"c:\\server.p12"},"adminWebApiConfig":{"webApiEndPoint":"https://+:8000/","serverKeyStorePath":"c:\\server.p12"},"consensus":{"timeout":"00:00:10","interval":"00:00:04"},"busyWaitTransactions":false,"waitForTx":"00:00:00","memoryPoolCapacity":1048576,"maxGetBlockSize":5,"maxBlockDepth":100,"extensions":[]}, "atHeight":566}