There is a list of commands to interact with the MEMPOOL:

  • MEMPOOL LIST - lists datums in the mempool
  • MEMPOOL CHECK - looks for the datum hash presence in the mempool or chains
  • MEMPOOL PROC - processes a datum with the specified hash for the selected chain in the specified network
  • MEMPOOL PROC ALL -  processes all datums for the selected chain of the network
  • MEMPOOL DELETE - deletes datum for the selected chain in the network
  • MEMPOOL DUMP - outputs an information about a datum in the mempool
  • MEMPOOL ADD CA - adds datum with the public certificate into the mempool
  • MEMPOOL COUNT - displays the number of elements in the mempool for a given network

JSON-RPC Request - MEMPOOL LIST

Lists datums in the mempool (all/for selected chain/briefly)  

CLI Example

Command syntax:

mempool list 
-net <net_name> 
[-chain <chain_name>] 
[-addr <addr>] 
[-brief]

Options:

-net - name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network folder or received by The Cellframe-Node-CLI using command - net list
-chain - name of the chain (optional)
-addr - address of the wallet (optional)
-brief - shows only hashes and creation time (optional)

Example:

Command:

cellframe-node-cli mempool list 
-net riemann 
-chain main

Response:

        net: riemann
        chains:
                name: main
                removed: 0
                datums:
                        hash: 0xC203EA5BB6C5C4297B3885549771C2C1526D7475AE6449668BC512B4E119966A
                        type: DATUM_TX
                        created:
                            time_stamp: 1711528352
                            str: Wed, 27 Mar 2024 01:32:32 -0700
                        main_ticker: tKEL
                        ledger_rc: DAP_LEDGER_TX_CHECK_OK
                        from: o9z3wUTSTicckJuoweZoQPfSUnWPDGPUEAXWZyVyfpkzVBFKMYP1jcyY8Tx7CG4odjL7pyy1uBy3Ei1xsVsBEGUcR6XuUSJCV8w2YwtL
                        to:
 
                                money:
                                    value: 50000000000000000
                                    coins: 0.05
                                    token: tKEL
                                addr: o9z3wUTSTicckJuoyMFzCwUAokuvhzFvrbcKJreH1UJhfuTUxYSKFLwhKjE5E1TmsPGzPgohexjwXZKUFf12R8Pt66GjAMvtyULgr3Pc
 
                                money:
                                    value: 2500000000000000
                                    coins: 0.0025
                                    token: tKEL
                                addr: o9z3wUTSTicckJuoxkLc5q1CwaYs23474GbBm8ebgSZd1WmB7EhkPDpsoZPGX3hmhGa1wCqTDKgPjirbp3H45bg3tc6U5k8wCEJX575X
                        change:
                                money:
                                    value: 28197624999999999996
                                    coins: 28.197624999999999996
                                    token: tKEL
                        fee:
                                value: 50000000000000000
                                coins: 0.05
                                token: tKEL
                total: riemann.main: 1

JSON-RPC Example

Command:

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

Response:

{
  "type": 2,
  "result": [
    {
      "net": "riemann",
      "chains": [
        {
          "name": "main",
          "removed": 0,
          "datums": [
            {
              "hash": "0xC203EA5BB6C5C4297B3885549771C2C1526D7475AE6449668BC512B4E119966A",
              "type": "DATUM_TX",
              "created": {
                "time_stamp": 1711528352,
                "str": "Wed, 27 Mar 2024 01:32:32 -0700"
              },
              "main_ticker": "tKEL",
              "ledger_rc": "DAP_LEDGER_TX_CHECK_OK",
              "from": "o9z3wUTSTicckJuoweZoQPfSUnWPDGPUEAXWZyVyfpkzVBFKMYP1jcyY8Tx7CG4odjL7pyy1uBy3Ei1xsVsBEGUcR6XuUSJCV8w2YwtL",
              "to": [
                {
                  "money": {
                    "value": "50000000000000000",
                    "coins": "0.05",
                    "token": "tKEL"
                  },
                  "addr": "o9z3wUTSTicckJuoyMFzCwUAokuvhzFvrbcKJreH1UJhfuTUxYSKFLwhKjE5E1TmsPGzPgohexjwXZKUFf12R8Pt66GjAMvtyULgr3Pc"
                },
                {
                  "money": {
                    "value": "2500000000000000",
                    "coins": "0.0025",
                    "token": "tKEL"
                  },
                  "addr": "o9z3wUTSTicckJuoxkLc5q1CwaYs23474GbBm8ebgSZd1WmB7EhkPDpsoZPGX3hmhGa1wCqTDKgPjirbp3H45bg3tc6U5k8wCEJX575X"
                }
              ],
              "change": [
                {
                  "money": {
                    "value": "28197624999999999996",
                    "coins": "28.197624999999999996",
                    "token": "tKEL"
                  }
                }
              ],
              "fee": [
                {
                  "value": "50000000000000000",
                  "coins": "0.05",
                  "token": "tKEL"
                }
              ]
            }
          ],
          "total": "riemann.main: 1"
        }
      ]
    }
  ],
  "errors": null,
  "id": 1
}
Link to original

 

JSON-RPC Request - MEMPOOL CHECK

Looks for the datum hash presence in the mempool or chains

CLI Example

Command syntax:

mempool check 
-net <net_name> 
[-chain <chain_name>] 
-datum <datum_hash>

Options:

-net - name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network folder or received by The Cellframe-Node-CLI using command - net list
-datum - hash of the datum
-chain - name of the chain (optional)

Example:

Command:

cellframe-node-cli mempool check 
-net riemann 
-chain main 
-datum 0xC203EA5BB6C5C4297B3885549771C2C1526D7475AE6449668BC512B4E119966A

Response:

        hash: 0xC203EA5BB6C5C4297B3885549771C2C1526D7475AE6449668BC512B4E119966A
        net: riemann
        chain: main
        find: true
        source: mempool

JSON-RPC Example

Command:

curl --unix-socket /opt/cellframe-node/var/run/node_cli 
-X POST http://localhost/connect 
-d '{"method":"mempool", "params":["mempool;check;-net;riemann;-chain;main;-datum;0xC203EA5BB6C5C4297B3885549771C2C1526D7475AE6449668BC512B4E119966A"], "id":"1"}'

Response:

{
  "type": 2,
  "result": [
    {
      "hash": "0xC203EA5BB6C5C4297B3885549771C2C1526D7475AE6449668BC512B4E119966A",
      "net": "riemann",
      "chain": "main",
      "find": true,
      "source": "mempool"
    }
  ],
  "errors": null,
  "id": 1
}
Link to original

 

JSON-RPC Request - MEMPOOL PROC

Processes a datum with the specified hash for the selected chain in the specified network. Also starts a consensus round for a provided datum

warning

  • If datum data doesn’t satisfy consensus requirements, it will be discarded.
  • Function “PROC” is available only for Root Nodes in zerochain and Master Nodes in mainchain.
  • This command will process transaction with any comission! Parameter minimum_comission will not be taken into account!

You can also use enable auto-processing function in general configuration file - [[Cellframe Node General Config#Section [mempool|mempool section]]

CLI Example

Command syntax:

mempool proc 
-net <net_name> 
-chain <chain_name> 
-datum <datum_hash>

Options:

-net - name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network folder or received by The Cellframe-Node-CLI using command - net list
-datum - hash of the datum
-chain - name of the chain

Example:

Command:

cellframe-node-cli mempool proc 
-net foobar 
-chain main 
-datum 0x68960FE80F5A31328EC15AAF117F4A4C24573BC3B965877FA840FE7A13EC2BDC

Response:

        datum:
            hash: 0x68960FE80F5A31328EC15AAF117F4A4C24573BC3B965877FA840FE7A13EC2BDC
            type: DATUM_CA
            ts_created:
                time_stamp: 1711531774
                str: Wed Mar 27 09:29:34 2024
            data_size: 1285

        verify:
            isProcessed: true
            notice: Removed datum from mempool.

JSON-RPC Example

Command:

curl --unix-socket /opt/cellframe-node/var/run/node_cli 
-X POST http://localhost/connect 
-d '{"method":"mempool", "params":["mempool;proc;-net;foobar;-chain;main;-datum;0x68960FE80F5A31328EC15AAF117F4A4C24573BC3B965877FA840FE7A13EC2BDC"], "id":"1"}'

Response:

{
  "type": 2,
  "result": [
    {
      "datum": {
        "hash": "0x68960FE80F5A31328EC15AAF117F4A4C24573BC3B965877FA840FE7A13EC2BDC",
        "type": "DATUM_CA",
        "ts_created": {
          "time_stamp": 1711531823,
          "str": "Wed Mar 27 09:30:23 2024\n"
        },
        "data_size": 1285
      },
      "verify": {
        "isProcessed": true,
        "notice": "Removed datum from mempool."
      }
    }
  ],
  "errors": null,
  "id": 1
}
Link to original

 

JSON-RPC Request - MEMPOOL PROC ALL

Processes all datums for the selected chain of the network.

CLI Example

Command syntax:

mempool proc_all 
-net <net_name> 
-chain <chain_name>

Options:

-net - name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network folder or received by The Cellframe-Node-CLI using command - net list
-chain - name of the chain

Example:

Command:

cellframe-node-cli mempool proc_all 
-net foobar 
-chain main

Response:

The entire mempool has been processed in foobar.main.

JSON-RPC Example

Command:

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

Response:

{
  "type": 2,
  "result": [
    "The entire mempool has been processed in foobar.main."
  ],
  "errors": null,
  "id": 1
}
Link to original

 

JSON-RPC Request - MEMPOOL DELETE

Deletes datum for the selected chain in the network.

CLI Example

Command syntax:

mempool delete 
-net <net_name> 
-chain <chain_name> 
-datum <datum_hash>

Options:

-net - name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network folder or received by The Cellframe-Node-CLI using command - net list
-chain - name of the chain
-datum - hash of the datum

Example:

Command:

cellframe-node-cli mempool delete 
-net foobar 
-chain main 
-datum 0x68960FE80F5A31328EC15AAF117F4A4C24573BC3B965877FA840FE7A13EC2BDC

Response:

Datum 0x68960FE80F5A31328EC15AAF117F4A4C24573BC3B965877FA840FE7A13EC2BDC deleted

JSON-RPC Example

Command:

curl --unix-socket /opt/cellframe-node/var/run/node_cli 
-X POST http://localhost/connect 
-d '{"method":"mempool", "params":["mempool;delete;-net;foobar;-chain;main;-datum;0x68960FE80F5A31328EC15AAF117F4A4C24573BC3B965877FA840FE7A13EC2BDC"], "id":"1"}'

Response:

{
  "type": 2,
  "result": [
    "Datum 0x68960FE80F5A31328EC15AAF117F4A4C24573BC3B965877FA840FE7A13EC2BDC deleted"
  ],
  "errors": null,
  "id": 1
}
Link to original

 

JSON-RPC Request - MEMPOOL DUMP

Outputs an information about datum in the mempool

See also:

CLI Example

Command syntax:

mempool dump 
-net <net_name> 
-chain <chain_name> 
-datum <datum_hash>

Options:

-net - name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network folder or received by The Cellframe-Node-CLI using command - net list
-chain - name of the chain
-datum - hash of the datum

Example:

Command:

cellframe-node-cli mempool dump 
-net riemann 
-chain main 
-datum 0xC203EA5BB6C5C4297B3885549771C2C1526D7475AE6449668BC512B4E119966A

Response:

        hash: 0xC203EA5BB6C5C4297B3885549771C2C1526D7475AE6449668BC512B4E119966A
        data_size: 4036
        version: 0
        ts_create: Wed Mar 27 01:32:32 2024
        type: DATUM_TX
        items:
 
                type: TX_ITEM_TYPE_IN
                data:
                    prev_idx: 3
                    prev_hash: 0x9DDCD0BBFD424CBC3688B33061DF3A71B920AED1FE2EEB8D0B36C8BFC73030F9
                type: TX_ITEM_TYPE_OUT
                data:
                    value: 0.05
                    value_datoshi: 50000000000000000
                    address: o9z3wUTSTicckJuoyMFzCwUAokuvhzFvrbcKJreH1UJhfuTUxYSKFLwhKjE5E1TmsPGzPgohexjwXZKUFf12R8Pt66GjAMvtyULgr3Pc
                type: TX_ITEM_TYPE_OUT
                data:
                    value: 0.0025
                    value_datoshi: 2500000000000000
                    address: o9z3wUTSTicckJuoxkLc5q1CwaYs23474GbBm8ebgSZd1WmB7EhkPDpsoZPGX3hmhGa1wCqTDKgPjirbp3H45bg3tc6U5k8wCEJX575X
                type: TX_ITEM_TYPE_OUT_COND
                data:
                    ts_expires: never
                    subtype: DAP_CHAIN_TX_OUT_COND_SUBTYPE_FEE
                    value: 0.05
                    value_datoshi: 50000000000000000
                    uid: 0x0000000000000000
                type: TX_ITEM_TYPE_OUT
                data:
                    value: 28.197624999999999996
                    value_datoshi: 28197624999999999996
                    address: o9z3wUTSTicckJuoweZoQPfSUnWPDGPUEAXWZyVyfpkzVBFKMYP1jcyY8Tx7CG4odjL7pyy1uBy3Ei1xsVsBEGUcR6XuUSJCV8w2YwtL
                type: TX_ITEM_TYPE_SIG
                data:
                    sign_size: 3306
                    sign:
                        type: sig_dil
                        pkeyHash: 0x2C93EF6F9A535C44B90F3148686E350ADF7EF252B121CF572877ED09D3736B27
                        signPkeySize: 1196
                        signSize: 2096

JSON-RPC Example

Command:

curl --unix-socket /opt/cellframe-node/var/run/node_cli 
-X POST http://localhost/connect 
-d '{"method":"mempool", "params":["mempool;dump;-net;riemann;-chain;main;-datum;0xC203EA5BB6C5C4297B3885549771C2C1526D7475AE6449668BC512B4E119966A"], "id":"1"}'

Response:


    "type": 2,
    "result": [
        {
            "hash": "0xC203EA5BB6C5C4297B3885549771C2C1526D7475AE6449668BC512B4E119966A",
            "data_size": 4036,
            "version": 0,
            "ts_create": "Wed Mar 27 01:32:32 2024",
            "type": "DATUM_TX",
            "items": [
                {
                    "type": "TX_ITEM_TYPE_IN",
                    "data": {
                        "prev_idx": 3,
                        "prev_hash": "0x9DDCD0BBFD424CBC3688B33061DF3A71B920AED1FE2EEB8D0B36C8BFC73030F9"
                    }
                },
                {
                    "type": "TX_ITEM_TYPE_OUT",
                    "data": {
                        "value": "0.05",
                        "value_datoshi": "50000000000000000",
                        "address": "o9z3wUTSTicckJuoyMFzCwUAokuvhzFvrbcKJreH1UJhfuTUxYSKFLwhKjE5E1TmsPGzPgohexjwXZKUFf12R8Pt66GjAMvtyULgr3Pc"
                    }
                },
                {
                    "type": "TX_ITEM_TYPE_OUT",
                    "data": {
                        "value": "0.0025",
                        "value_datoshi": "2500000000000000",
                        "address": "o9z3wUTSTicckJuoxkLc5q1CwaYs23474GbBm8ebgSZd1WmB7EhkPDpsoZPGX3hmhGa1wCqTDKgPjirbp3H45bg3tc6U5k8wCEJX575X"
                    }
                },
                {
                    "type": "TX_ITEM_TYPE_OUT_COND",
                    "data": {
                        "ts_expires": "never",
                        "subtype": "DAP_CHAIN_TX_OUT_COND_SUBTYPE_FEE",
                        "value": "0.05",
                        "value_datoshi": "50000000000000000",
                        "uid": "0x0000000000000000"
                    }
                },
                {
                    "type": "TX_ITEM_TYPE_OUT",
                    "data": {
                        "value": "28.197624999999999996",
                        "value_datoshi": "28197624999999999996",
                        "address": "o9z3wUTSTicckJuoweZoQPfSUnWPDGPUEAXWZyVyfpkzVBFKMYP1jcyY8Tx7CG4odjL7pyy1uBy3Ei1xsVsBEGUcR6XuUSJCV8w2YwtL"
                    }
                },
                {
                    "type": "TX_ITEM_TYPE_SIG",
                    "data": {
                        "sign_size": 3306,
                        "sign": {
                            "type": "sig_dil",
                            "pkeyHash": "0x2C93EF6F9A535C44B90F3148686E350ADF7EF252B121CF572877ED09D3736B27",
                            "signPkeySize": 1196,
                            "signSize": 2096
                        }
                    }
                }
            ]
        }
    ],
    "errors": null,
    "id": 1
}
}
Link to original

 

JSON-RPC Request - MEMPOOL ADD CA

Adds datum with the public certificate into the mempool. Datum type - DAP_CHAIN_DATUM_CA

CLI Example

Command syntax:

mempool add_ca 
-net <net_name> 
[-chain <chain_name>] 
-ca_name <pub_cert_name>

Options:

-net - name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network folder or received by The Cellframe-Node-CLI using command - net list
-chain - name of the chain (optional)
-ca_name - name of the public certificate

Example:

Command:

cellframe-node-cli mempool add_ca 
-net foobar 
-chain main 
-ca_name foo0-cert.pub

Response:

Datum 0x68960FE80F5A31328EC15AAF117F4A4C24573BC3B965877FA840FE7A13EC2BDC was successfully placed to mempool

JSON-RPC Example

Command:

curl --unix-socket /opt/cellframe-node/var/run/node_cli 
-X POST http://localhost/connect 
-d '{"method":"mempool", "params":["mempool;add_ca;-net;foobar;-chain;main;-ca_name;foo0-cert.pub"], "id":"1"}'

Response:

{
  "type": 2,
  "result": [
    "Datum 0x68960FE80F5A31328EC15AAF117F4A4C24573BC3B965877FA840FE7A13EC2BDC was successfully placed to mempool"
  ],
  "errors": null,
  "id": 1
}
Link to original

 

JSON-RPC Request - MEMPOOL COUNT

Displays the number of elements in the mempool for a given network.

CLI Example

Command syntax:

mempool count 
-net <net_name> 
[-chain <chain_name>]

Options:

-net - name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network folder or received by The Cellframe-Node-CLI using command - net list
-chain - name of the chain (optional)

Example:

Command:

cellframe-node-cli mempool count 
-net riemann 
-chain main

Response:

     net: riemann
        chains:
                name: main
                count: 1

JSON-RPC Example

Command:

curl --unix-socket /opt/cellframe-node/var/run/node_cli 
-X POST http://localhost/connect 
-d '{"method":"mempool", "params":["mempool;count;-net;riemann;-chain;main"], "id":"1"}'

Response:

{
  "type": 2,
  "result": [
    {
      "net": "riemann",
      "chains": [
        {
          "name": "main",
          "count": 1
        }
      ]
    }
  ],
  "errors": null,
  "id": 1
}
Link to original