There is a list of commands to interact with LEDGER.

Node Command - LEDGER LIST COINS

Shows list of all coins in the net

CLI Example

Command syntax:

ledger list coins 
-net <net_name>

Options:

-net - name of the Cellframe network. The list of networks can be found in the <Config_dir> \ etc \ network folder folder or received by the Cellframe-Node-Cli Net List command

Example:

Command:

cellframe-node-cli ledger list coins 
-net foobar 

Response:

Found 2 tokens in foobar ledger

-->Token name 'BUZ', type CF20, flags: NO_FLAGS, description: 'The token description is not set'
    Supply (current/total) 0/0
    Decimals: 18
    Auth signs (valid/total) 1/1
TSD and Signs:
signatures:
1) 0xE08FD473071933D50FEF761BB47C4F9C1FAE392BC5138E7BE991E53F03C9C0EF, sig_dil, 2096 bytes
    Total emissions 1
___

-->Token name 'mBUZ', type CF20, flags: NO_FLAGS, description: 'The token description is not set'
    Supply (current/total) 0/0
    Decimals: 18
    Auth signs (valid/total) 1/1
TSD and Signs:
ticker_token_from: BUZ
emission_rate: 0.001
signatures:
1) 0xE08FD473071933D50FEF761BB47C4F9C1FAE392BC5138E7BE991E53F03C9C0EF, sig_dil, 2096 bytes
    Total emissions 0

___

JSON-RPC Example

Command:

curl -X POST http://rpc.cellframe.net/connect -d '{"method":"ledger", "params":["ledger;list;coins;-net;foobar"], "id":"1"}'

Response:

{
"type": 0,
"result": "Found 2 tokens in foobar ledger\n-->Token name 'BUZ', type CF20, flags: NO_FLAGS, description: 'The token description is not set'\n\tSupply (current\/total) 0\/0\n\tDecimals: 18\n\tAuth signs (valid\/total) 1\/1\nTSD and Signs:\nsignatures: \n1) 0xE08FD473071933D50FEF761BB47C4F9C1FAE392BC5138E7BE991E53F03C9C0EF, sig_dil, 2096 bytes\n\tTotal emissions 1\n___\n-->Token name 'mBUZ', type CF20, flags: NO_FLAGS, description: 'The token description is not set'\n\tSupply (current\/total) 0\/0\n\tDecimals: 18\n\tAuth signs (valid\/total) 1\/1\nTSD and Signs:\nticker_token_from: BUZ\nemission_rate: 0.001\nsignatures: \n1) 0xE08FD473071933D50FEF761BB47C4F9C1FAE392BC5138E7BE991E53F03C9C0EF, sig_dil, 2096 bytes\n\tTotal emissions 0\n___\n",
"errors": null,
"id": 1
}
Link to original

Node Command - LEDGER LIST THRESHOLD

Shows threshold list

CLI Example

Command syntax:

ledger list threshold 
[-hash <tx_threshold_hash>] 
-net <net_name>

Options:

-net - name of the Cellframe network. The list of networks can be found in the <Config_dir> \ etc \ network folder folder or received by the Cellframe-Node-Cli Net List command
-hash - hash of the transaction in the threshold (optional)

Example:

Command:

cellframe-node-cli ledger list threshold 
-net foobar

Response:

0 items in ledger tx threshold

0 items in ledger emission threshold

JSON-RPC Example

Command:

curl --unix-socket /opt/cellframe-node/var/run/node_cli 
-X POST http://localhost/connect 
-d '{"method":"ledger", "params":["ledger;list;threshold;-net;foobar"], "id":"1"}'

Response:

{
"type": 0,
"result": "0 items in ledger tx threshold\n0 items in ledger emission threshold\n",
"errors": null,
"id": 1
}
Link to original

Node Command - LEDGER LIST BALANCE

Shows balance list

CLI Example

Command syntax:

ledger list balance 
-net <net_name>

Options:

-net - name of the Cellframe network. The list of networks can be found in the <Config_dir> \ etc \ network folder folder or received by the Cellframe-Node-Cli Net List command

Example:

Command:

cellframe-node-cli ledger list balance 
-net foobar

Response:

Ledger balance key: ptV4n68gTebdUTcbmp9YLvesZ9v4pddjDbHYz24CGH5mfirNynRPCqKHajj5M5ahtx6uTZpkyEqi9rcPExfSGZwrzCkkVdQuzeEzKRVj BUZ, token_ticker:BUZ, balance:9999999999999999999999999999998999999800000000000000000

Ledger balance key: ptV4n68gTebdUTcbnNyQuXcUJAhJJs2TUZeVAD9Hb67c6iqvZigSukS87WB8hNH9PfvmGUdNj22tBQ9uWxUJaAX2PpDhAqTKSuWBhXcj BUZ, token_ticker:BUZ, balance:997999800000000000000000

Ledger balance key: ptV4n68gTebdUTcbnNyQuXcUJAhJJs2TUZeVAD9Hb67c6iqvZigSukS87WB8hNH9PfvmGUdNj22tBQ9uWxUJaAX2PpDhAqTKSuWBhXcj mBUZ, token_ticker:mBUZ, balance:0

JSON-RPC Example

Command:

curl -X POST http://rpc.cellframe.net/connect -d '{"method":"ledger", "params":["ledger;list;balance;-net;foobar"], "id":"1"}'

Response:

{
"type": 0,
"result": "Ledger balance key: ptV4n68gTebdUTcbmp9YLvesZ9v4pddjDbHYz24CGH5mfirNynRPCqKHajj5M5ahtx6uTZpkyEqi9rcPExfSGZwrzCkkVdQuzeEzKRVj BUZ, token_ticker:BUZ, balance:9999999999999999999999999999998999999800000000000000000\nLedger balance key: ptV4n68gTebdUTcbnNyQuXcUJAhJJs2TUZeVAD9Hb67c6iqvZigSukS87WB8hNH9PfvmGUdNj22tBQ9uWxUJaAX2PpDhAqTKSuWBhXcj BUZ, token_ticker:BUZ, balance:997999800000000000000000\nLedger balance key: ptV4n68gTebdUTcbnNyQuXcUJAhJJs2TUZeVAD9Hb67c6iqvZigSukS87WB8hNH9PfvmGUdNj22tBQ9uWxUJaAX2PpDhAqTKSuWBhXcj mBUZ, token_ticker:mBUZ, balance:0\n",
"errors": null,
"id": 1
}
Link to original

Node Command - LEDGER INFO

Shows ledger information

CLI Example

Command syntax:

ledger info 
-hash <tx_hash> 
-net <net_name> 
[-unspent]

Options:

-net - name of the Cellframe network. The list of networks can be found in the <Config_dir> \ etc \ network folder folder or received by the Cellframe-Node-Cli Net List command
-hash - hash of the transaction
-unspent - extra parameter which shows transactions with unspent OUT's (optional)

Example:

Command:

cellframe-node-cli ledger info 
-hash 0x31BC6C8DB3B00A719824182743554865B9AB38C0D1CCD6A85AC8075ECD6075C5 
-net foobar

Response:

transaction: hash 0x31BC6C8DB3B00A719824182743554865B9AB38C0D1CCD6A85AC8075ECD6075C5
 TS Created: Thu Jan 25 06:38:11 2024
 Token ticker: BUZ
 Items:
     IN:
Tx_prev_hash: 0xDAF48202160FF9C703FBF502E379B4BA98BF359E3BD71BE5318D06605646438E
              Tx_out_prev_idx: 2
     OUT:
              Value: 10000000.0 (10000000000000000000000000)
              Address: ptV4n68gTebdUTcbpMWKhfpsGuugvEdK6bwKS8P1q9gkUCKHKKo6t2ed41FPz1CTWVyKwZqRXZYLngxzFTErgdei8QuGdS3Bpv72HGVt
     OUT COND:
     Header:
              ts_expires: never
              value: 1.0 (1000000000000000000)
              subtype: DAP_CHAIN_TX_OUT_COND_SUBTYPE_FEE
              uid: 0x0000000000000000
     OUT:
              Value: 9999999999999999999999999999988999998.8 (9999999999999999999999999999988999998800000000000000000)
              Address: ptV4n68gTebdUTcbmp9YLvesZ9v4pddjDbHYz24CGH5mfirNynRPCqKHajj5M5ahtx6uTZpkyEqi9rcPExfSGZwrzCkkVdQuzeEzKRVj
Signature:
    Type: sig_dil
    Public key hash: 0x70E9CCE59EB345DD9E5B8E0CBF1F18C2C9072B021A9B12C3AD4FC6577091F200
    Public key size: 1196
    Signature size: 2096
    Sender addr: ptV4n68gTebdUTcbmp9YLvesZ9v4pddjDbHYz24CGH5mfirNynRPCqKHajj5M5ahtx6uTZpkyEqi9rcPExfSGZwrzCkkVdQuzeEzKRVj

Spent OUTs:
    all OUTs yet unspent

JSON-RPC Example

Command:

curl -X POST http://rpc.cellframe.net/connect -d '{"method":"ledger", "params":["ledger;info;-hash;0x31BC6C8DB3B00A719824182743554865B9AB38C0D1CCD6A85AC8075ECD6075C5;-net;foobar"], "id":"1"}'

Response:

{
"type": 0,
"result": "same as cli response",
"errors": null,
"id": 1
}
Link to original

Node Command - LEDGER DEFINITE TRANSACTIONS

Shows all ledger information belonged to this address/wallet/transaction

CLI Example

Command syntax:

ledger tx 
{-addr <addr> | -w <wallet_name> | -tx <tx_hash>} 
-net <net_name>

Options:

-net - name of the Cellframe network. The list of networks can be found in the <Config_dir> \ etc \ network folder folder or received by the Cellframe-Node-Cli Net List command
-addr/-w/-tx - shows information using address hash, hash of the wallet or transaction hash

Example:

Command:

cellframe-node-cli ledger tx 
-addr ptV4n68gTebdUTcbpMWKhfpsGuugvEdK6bwKS8P1q9gkUCKHKKo6t2ed41FPz1CTWVyKwZqRXZYLngxzFTErgdei8QuGdS3Bpv72HGVt 
-net foobar

Response:

history for addr ptV4n68gTebdUTcbpMWKhfpsGuugvEdK6bwKS8P1q9gkUCKHKKo6t2ed41FPz1CTWVyKwZqRXZYLngxzFTErgdei8QuGdS3Bpv72HGVt:

TX hash 0x31BC6C8DB3B00A719824182743554865B9AB38C0D1CCD6A85AC8075ECD6075C5 

    Thu Jan 25 06:38:11 2024

    recv 10000000000000000000000000 BUZ from ptV4n68gTebdUTcbmp9YLvesZ9v4pddjDbHYz24CGH5mfirNynRPCqKHajj5M5ahtx6uTZpkyEqi9rcPExfSGZwrzCkkVdQuzeEzKRVj

JSON-RPC Example

Command:

curl -X POST http://rpc.cellframe.net/connect -d '{"method":"ledger", "params":["ledger;tx;-addr;ptV4n68gTebdUTcbpMWKhfpsGuugvEdK6bwKS8P1q9gkUCKHKKo6t2ed41FPz1CTWVyKwZqRXZYLngxzFTErgdei8QuGdS3Bpv72HGVt;-net;foobar"], "id":"1"}'

Response:

{
"type": 0,
"result": "history for addr ptV4n68gTebdUTcbpMWKhfpsGuugvEdK6bwKS8P1q9gkUCKHKKo6t2ed41FPz1CTWVyKwZqRXZYLngxzFTErgdei8QuGdS3Bpv72HGVt:\nTX hash 0x31BC6C8DB3B00A719824182743554865B9AB38C0D1CCD6A85AC8075ECD6075C5  \n\tThu Jan 25 06:38:11 2024\n\trecv 10000000000000000000000000 BUZ from ptV4n68gTebdUTcbmp9YLvesZ9v4pddjDbHYz24CGH5mfirNynRPCqKHajj5M5ahtx6uTZpkyEqi9rcPExfSGZwrzCkkVdQuzeEzKRVj\n\n",
"errors": null,
"id": 1
}
Link to original