Skip to main content
Prerequisites

Make sure the Inery Node is set up on your server or machine and you have terminal access.

Create on Ledger Commands

Creates various items on the ledger.


Create Keypair

Create a keypair
 cline create key --to-console
Expected output:
Private key: 5JfDwUpADzN5pN9NCSvx9mtfVFdsFLMLQXaUKB5DAKG1rA1Qbg8
Public key: INE8ax1GprXbTxjeAWE5bXGsl8cTin89xdekTRSvYwRUFpD1uK5ZnE

Save keypair to file

instead of --to-console provide --file or -f flag followed by name of the file where generated keypair will be saved

cline create key -f mynewkeypair.txt

Create Database

Create a new database on the ledger
 cline system opendb <creator_database> <database_name> OwnerKey [ActiveKey]
Positionals:
  creator_database  # REQUIRED The name of the database creating the new database
database_name # REQUIRED The name of the new database
OwnerKey # REQUIRED The owner public key or permission level for the new database
ActiveKey # The active public key or permission level for the new database
Example Command
 cline system opendb createacc inery.test2 INE65kTQsHjpMgW6XYUxm66gFFzcGTcRp5F4uk9Le4sDNpibBwZ6X
Output:
executed transaction: 318067ed94c8089da99acad2bdbf0e21676448847e3d4e98b19fa865697f2e36  336 bytes  3169 us

Get Ledger Commands

Retreive various items from the ledger.


Get cline version

Retrieves version information.

client

Retrieve basic version information about the cline
 cline version client
Expected output

v2.0.7

full

 cline version full
Expected output

v2.0.7-0d87dff8bee56179aa01472dd00a089b2aa7b9fa-dirty

Get Ledger Info

Get current ledger status
 cline get info
Expected Output:
{
"server_version": "0d87dff8",
"chain_id": "54aaf66ac6bc5ce7cd1f035976401749542eaadf63ec36312889414e1dc272ed",
"head_block_num": 2527198,
"last_irreversible_block_num": 2527189,
"last_irreversible_block_id": "00268fd5e53d42ae81731344073513a67d4b44ff0677f249906e9db8b20e8b91",
"head_block_id": "00268fde7fa0cf788032efa1a87b6c7235a37877acf24e7f0c1868d6830bd08e",
"head_block_time": "2022-03-28T09:59:29.000",
"head_block_master": "master.prime",
"virtual_block_cpu_limit": 200000000,
"virtual_block_net_limit": 1048576000,
"block_cpu_limit": 197998,
"block_net_limit": 1047968,
"server_version_string": "v2.0.7",
"fork_db_head_block_num": 2527198,
"fork_db_head_block_id": "00268fde7fa0cf788032efa1a87b6c7235a37877acf24e7f0c1868d6830bd08e",
"server_full_version_string": "v2.0.7-0d87dff8bee56179aa01472dd00a089b2aa7b9fa-dirty"
}

Retrieve Block

Retrieve a full block from the ledger
 cline get block <block_number>
Positionals:
`block_number` # Block number (e.g.`123`) of block you want to retireve
Output:
{
"timestamp": "2022-03-28T10:03:31.500",
"master": "master.prime",
"confirmed": 5,
"previous": "002691c1ed0f788ca15ab4ec0bc4d72efa5955a3e7bce8f7621b80d50a9dcfeb",
"transaction_mroot": "0000000000000000000000000000000000000000000000000000000000000000",
"action_mroot": "23bcb8a32dcf18076e967d06adf9c03139ccaea3a3b84b53de1b75be1f087d93",
"schedule_version": 10,
"new_masters": null,
"master_signature": "SIG_K1_KdDUTsU1VZKfWQ4MpBk4kSx4kR9GHuFzMbcEMFZDtNVrvaikFkoYxkHMt5EkrpBoJJgvZeHxD2KZFNTSV1JbaVxutXWmuD",
"transactions": [],
"id": "002691c246daac1923b1c0e80ae23d39b30d3fbadb0459bf06270b86ed0b92e4",
"block_num": 2527682,
"ref_block_prefix": 3904942371
}

Retrieve Database Info

Retrieve an account from the ledger:
 cline get account [option] <database_name>
Positionals:
`database_name` # Name of the existing account on ledger
Output:
created: 2022-02-18T15:43:25.000
permissions:
owner 1: 1 INE5z1ZD4rHSCDaiXREDGMgAAQm1pgAkmkc8Mj6hMNgHwcpmFQwbP
active 1: 1 INE6dH8EstohYdqVxgJLuBv9oNsHBwT8ACGr8wJHvgh9nJc3b9eau
memory:
quota: 1.001 MiB used: 3.365 KiB

INR balances:
liquid: 50000.0000 INR
staked: 2.0000 INR
unstaking: 0.0000 INR
total: 50002.0000 INR

GET MORE INFO

Provide --json or -j flag at the end of command to have detail info

cline get account inery --json

Get Value Contract

Retrieve Full Database
 cline get code <database_name> --code <database_name>.wasm --abi <database_name>.abi --wasm
Options:
--code  TEXT # The name of the file to save the contract .wast/wasm to.
--abi TEXT # The name of the file to save the contract .abi to.
--wasm # Save code as wasm.
Output:
code hash: 86b610153cc930302d266bcd7d861a3ebebab73fa9a6120d88d0159eddbf59d1
saving wasm to <database_name>.wasm
saving abi to <database_name>.abi
tip

Files saved in <database_name>.wasm and .abi can be set to another database

Get Database Structure

ABI is JSON like format object with declaration of strutures, tables and actions of databases.

Retrieve the ABI for an account
 cline get abi <database_name>
Example Output:
{
"version": "inery::abi/1.1",
"structs": [{
"name": "create",
"base": "",
"fields": [{
"name": "name",
"type": "string"
},{
"name": "email",
"type": "string"
},{
"name": "number",
"type": "int32"
}
]
},{
"name": "user",
"base": "",
"fields": [{
"name": "id",
"type": "uint64"
},{
"name": "name",
"type": "string"
},{
"name": "email",
"type": "string"
},{
"name": "number",
"type": "int32"
}
]
}
],
"actions": [{
"name": "create",
"type": "create",
"ricardian_contract": ""
}
],
"tables": [{
"name": "users",
"index_type": "i64",
"key_names": [],
"key_types": [],
"type": "user"
}
],
}
Save abi as file

To save abi directly to file you can provide --file or -f followed by name of file

Command Example
cline get abi <database_name> -f <database_name>.abi

Retrieve Compositions

Retrieve the contents of a database composition:
 cline get table <database_name> <scope> <composition> [options]
Positionals
  • database: Specifies the database from which the data will be retrieved.

  • scope: Specifies the scope from which the data will be retrieved. Defaults to the database name.

  • composition: Specifies the name of the databses composition from which the data will be retrieved.

Get Composition Options
--limit <value> # The maximum number of rows to return.
--lower <value># lower bound value of primary index, defaults to first.
--upper <value># upper bound value of primary index, defaults to last.
--reverse # Iterate in reverse order.
--key-type # The key type of index.
Example:
 cline get table inery.test inery.test users
Output:
{
"rows": [{
"id": 0,
"name": "Inery Test",
"email": "[email protected]",
"number": 9725569843369
}
],
"more": false,
"next_key": ""
}

Get Database Scopes

Retrieve a list of scopes and tables owned by a database
 cline get scope [options] database
Positionals

database The contract who owns the table.

Options:
--table # The name of the table as filter.
--limit # The maximum number of rows to return.
--lower # lower bound of scope.
--upper # upper bound of scope.
--reverse # Iterate in reverse order.
Example:
 cline get scope inery.test
Output:
{
"rows": [{
"code": "inery.test",
"scope": "inery.test",
"table": "users",
"payer": "inery.test",
"count": 1
}],
"more": ""
}

Get Currency Info

Retrieve information related to standard currencies.

Get Databse Balance

Retrieve the balance of an database for a given currency:
 cline get currency balance inery.token <database_name>
Positionals

database_name : The database to query balances for.

Example Command
 cline get currency balance inery.token inery.test
Output:
4000000 BYTE

Currency Stats

Retrieve the stats of for a given currency:
 cline get currency stats contract symbol
Positionals:
contract # The contract that operates the currency.
symbol # The symbol for the currency.
Example:
 cline get currency stats inery.token BYTE
Output:
{
"BYTE": {
"supply": "4285429560 BYTE",
"max_supply": "128000000000 BYTE",
"issuer": "inery.mem"
}
}

Get Accounts by Public Key

Retrieve databases associated with a public key:
 cline get accounts [options] public_key
Positionals:
public_key # The public key to retrieve accounts for.
Options:
--json # Output in JSON format.
Example:
 cline get accounts INE5z1ZD4rHSCDaiXREDGMgAAQm1pgAkmkc8Mj6hMNgHwcpmFQwbP
Output:
{
"account_names": [
"createacc",
"inery.test",
"inery.test1",
"inery.test2"
]
}

Get Transaction Info

Retrieve a transaction from the ledger:
 cline get transaction [options] id
Positionals:
id  TEXT # ID of the transaction to retrieve.
Options:
-b, --block-hint    UINT # The block number this transaction may be in.
Example:
 cline get transaction 824f248f65e38bf282636418a86b9a3b6e4b8636c45a4c6ef7ec21636cef4641 -b 1694783
Output:
{
"id": "824f248f65e38bf282636418a86b9a3b6e4b8636c45a4c6ef7ec21636cef4641",
"trx": {
"receipt": {
"status": "executed",
"cpu_usage_us": 357,
"net_usage_words": 18,
"trx": [
1,{
"signatures": [
"SIG_K1_K8dzy7qy8z5CT5qNmdTEMEDbaH2gY5oeQD8kVNij8rbzz4BeYoSUpf3HSDxJT5nmL7WnNJLtGWDFyhw3f1YvnRbFvLE2zk"
],
"compression": "none",
"packed_context_free_data": "",
"packed_trx": "14921c623ddcab91ad760000000001000000000435694400000000a86cd44501000000000435694400000000a8ed32323211537264616e205374616d656e6b6f7669631b737264616e7374616d656e6b6f7669633436407a6f686f2e636f6dabcc7c2600"
}
]
},
"trx": {
"expiration": "2022-02-28T09:12:52",
"ref_block_num": 56381,
"ref_block_prefix": 1991086507,
"max_net_usage_words": 0,
"max_cpu_usage_ms": 0,
"delay_sec": 0,
"context_free_actions": [],
"actions": [{
"account": "inery.test",
"name": "create",
"authorization": [{
"actor": "inery.test",
"permission": "active"
}
],
"data": {
"name": "Inery DLS",
"email": "[email protected]",
"number": 97166726398304472
},
"hex_data": "11537264616e205374616d656e6b6f7669631b737264616e7374616d656e6b6f7669633436407a6f686f2e636f6dabcc7c26"
}
],
"transaction_extensions": [],
"signatures": [
"SIG_K1_K8dzy7qy8z5CT5qNmdTEMEDbaH2gY5oeQD8kVNij8rbzz4BeYoSUpf3HSDxJT5nmL7WnNJLtGWDFyhw3f1YvnRbFvLE2zk"
],
"context_free_data": []
}
},
"block_time": "2022-02-28T09:12:22.500",
"block_num": 1694783,
"last_irreversible_block": 1694881,
"traces": []
}

Transfer Tokens


Transfer tokens from account to account:
 cline transfer [options] sender recipient amount [memo]
Positionals:
  sender TEXT(required) # The account sending tokens.
recipient TEXT(required) # The account receiving tokens.
amount TEXT(required) # The amount of tokens to send.
memo TEXT # The memo for the transfer.

Set Commands


Set Value Contract

Create or update the contract on an account:
 cline set contract [options] account [contract-dir] [wasm-file] [abi-file]
Positionals:
account TEXT(required) # The account to publish a contract for.
contract-dir TEXT # The path containing the .wasm and .abi.
wasm-file TEXT # The file containing the contract WASM.
abi-file TEXT # The ABI for the contract.
Options:
 transaction_options**
Example:
  cline set contract -j inery.test ./contracts cloning.wasm cloning.abi

Set WASM

Create or update the code on an account:
 cline set code [options] account [code-file]
Positionals:
account TEXT REQUIRED # The account to set code for.
code-file TEXT # The path containing the contract WASM.
Options:
 transaction_option**
Example:
 cline set code -j inery.test cloning.wasm

Set ABI

Create or update the abi on an account:
 cline set abi [options] account [abi-file]
Positionals:
account TEXT (required) # The account to set the ABI for.
abi-file TEXT # The path containing the contract ABI.
Options:
  transaction_option**
Example:
 cline set abi -j inery.test cloning.abi

Set Account Permission

Set parameters dealing with account permissions:
 cline set account permission [options] account permission [authority] [parent]
Positionals:
account TEXT(required) # The account to set/delete a permission authority for.
permission TEXT(required) # The permission name to set/delete an authority for.
authority TEXT [delete] NULL, [create/update] public key, JSON string or filename defining the authority, [code] contract name
parent TEXT [create] # The permission name of this parents permission, defaults to 'active'.
Example:
 cline set account permission -j inery.test mypermission INE5UQf4BcmPZ5vFQ68TFUjk994hCbFEDvJvJEUdrdTPVkvPE2Hv5

Network


Connect to Peer

Start a new connection to a peer:
 cline net connect  host
Positionals:
host TEXT REQUIRED # The hostname:port to connect to.
Example:
 cline net connect master1.blockchain-servers.world:9010
Output:
"added connection"

Disconnect from peer

Close an existing connection:
 cline net disconnect host
Positionals:
host TEXT REQUIRED # The hostname:port to disconnect from.
Example:
 cline net disconnect master1.blockchain-servers.world:9010
Output:
"connection removed"

Show Peer Status

Status of existing connection:
 cline net status host
Positionals:
host TEXT REQUIRED # The hostname: port to query status of connection.
``

```shell title='Example:'
cline net status master1.blockchain-servers.world:9010
Output:
{
"peer": "master1.blockchain-servers.world:9010",
"connecting": false,
"syncing": false,
"last_handshake": {
"network_version": 1206,
"chain_id": "54aaf66ac6bc5ce7cd1f035976401749542eaadf63ec36312889414e1dc272ed",
"node_id": "fdaee14abbecdeddf0bd607a47c9c3cbdbb6e139e6275b180d200d3244a4cda2",
"key": "INE1111111111111111111111111111111114T1Anm",
"time": "1646053423273766570",
"token": "0000000000000000000000000000000000000000000000000000000000000000",
"sig": "SIG_K1_111111111111111111111111111111111111111111111111111111111111111116uk5ne",
"p2p_address": "master1.blockchain-servers.world:9010 - fdaee14",
"last_irreversible_block_num": 1721998,
"last_irreversible_block_id": "001a468ec25df0806fa3d816af9908467b869bd564148dface2109865a656b8d",
"head_num": 1721999,
"head_id": "001a468fa902b9582f3fa453c2c8e727bb84e0086910e97811df9569850db22c",
"os": "linux",
"agent": "\"INE Test Agent\"",
"generation": 1
}

Show Connected Peers

Status of all existing peers:
 cline net peers
Positionals:
account TEXT # The account to set/delete a permission authority for.
permission TEXT # The permission name to set/delete an authority for.
authority TEXT [delete] NULL, [create/update] public key, JSON string or filename defining the authority, [code] contract name
parent TEXT [create] # The permission name of this parents permission, defaults to 'active'.
Example:
 cline net peers

Push Database Transaction


Push single action

Push a transaction with a single action:
 cline push action account action data
Positionals:
account TEXT REQUIRED # The account providing the contract to execute.
action TEXT REQUIRED # A JSON string or filename defining the action to execute.
data TEXT REQUIRED # The arguments to the contract.

Push transaction with multiple actions

Push an arbitrary JSON transaction:
 cline push transaction trx
Positionals:
trx TEXT REQUIRED # The JSON string or filename defining the transaction to push.

Master


Bind as Master

Register database as a master node
   cline system bind [options] account master_key [url] [location]
Positionals:
  account TEXT REQUIRED       The account to register as a master
master_key TEXT REQUIRED The masters public key
url TEXT The master node url
Options:
  transaction_options**
Example:
 cline master bind master.elite INE7pnGzN3J44T83WVkJ4uHxXwy8VmTt5gysN4m31jWSvnJKe6hfg master1.blockchain-servers.world
Output:
executed transaction: 03b0b947866b0c441b2bddf0501460f6cce5c8049e56a6eff0639d97f99fdd27  160 bytes  907 us
warning: transaction executed locally, but may not be confirmed by the network yet

Unbind Master

Unregister an existing master
 cline master unbind [options] account
Positionals:
  account TEXT REQUIRED       The account to unregister as a master
Options:
  transaction_options**
Example:
   cline master unbind master.elite
Output:
executed transaction: d010b3c4c0b7eec8d5f1232617deb8de52da45d479eb44aa2f4bcb8c9e7980cb  104 bytes  608 us
warning: transaction executed locally, but may not be confirmed by the network yet

Approve Master

Approve master in consensus
  cline master approve  master
Positionals:
  master TEXT REQUIRED      The account to be approved
Example:
   cline master approve master.elite
Output:
executed transaction: 46c50bcced294d2b9b0b8370a1e44e3a2cd40b2fa58708def80de81e2a601f43  120 bytes  1006 us
warning: transaction executed locally, but may not be confirmed by the network yet

Unapprove Master

Remove master from schedule
 cline master unapprove master
Positionals:
  master TEXT REQUIRED      The account to remove from voted masters
Example:
   cline master unapprove master.elite
Output:
executed transaction: f14c182ff0c8bdd821f24ab8c47567ef3ab836f8def0d074589b9d9ab1940418  112 bytes  1123 us
warning: transaction executed locally, but may not be confirmed by the network yet

Show Masters

Show active masters

Positionals:
   cline system listmasters [OPTIONS]
Options:
  -h,--help                   Print this help message and exit
-j,--json Output in JSON format
-l,--limit UINT The maximum number of rows to return
-L,--lower TEXT lower bound value of key, defaults to first

Example:
   cline system listmasters
Output:
Master        Master key                                                Url
master.prime INE6gcMFo6qUmcxDD3HFD6h3VkjEmfUevKWxYPf3wwBFiT8KSTn45 0.0.0.0:9010
master.elite INE7pnGzN3J44T83WVkJ4uHxXwy8VmTt5gysN4m31jWSvnJKe6hfg 0.0.0.0:9010
master.drop INE7rJAPUvuwENKYiM8ipu26kJsedRJgLyhvsA8sSh1qkvgh9jhUm 0.0.0.0:9010
master.supreme INE8Teu4vqwa2LLHSNFDMYtb6WVc9KGoeaYJzpQB8RJH5nbnq2jHa 0.0.0.0:9010

Memory


Buy Memory

Buy Memory from system market
   cline memory buy owner quantity
Positionals:
  owner TEXT REQUIRED         The database exchanging INR
quantity TEXT REQUIRED The quantity of INR for exchange
Example:
   cline memory buy inery.test "400 INR"
Output:
executed transaction: 2ec326e33a22f34d671d25d46809b4b9606313498578f9eb6caad34a34462a16  128 bytes  1503 us
warning: transaction executed locally, but may not be confirmed by the network yet

Allocate Memory

Alllocate memory for Database
   cline memory allocate  payer receiver amount
Positionals:
  payer TEXT REQUIRED         The account paying with BYTE
receiver TEXT REQUIRED The account receiving bytes
amount TEXT REQUIRED The amount BYTE token for bytes
Example:
   cline memory allocate inery inery.test "1048576 BYTE"
Output:
executed transaction: 2ec326e33a22f34d671d25d46809b4b9606313498578f9eb6caad34a34462a16  128 bytes  1503 us
warning: transaction executed locally, but may not be confirmed by the network yet