Gets list of the blocks using filtration; by definite blocks from block to block, by time from time to time, signed, with unspent coins, etc.

Command syntax:

block list 
-net <net_name> 
-chain <chain_name>  
[{signed | first_signed}] 
[-from_hash <block_hash>] 
[-to_hash <block_hash>] 
[-from_date <YYMMDD>] 
[-to_date <YYMMDD>] 
[{-cert <signing_cert_name> | -pkey_hash <signing_cert_pkey_hash>} 
[-unspent]]

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 - the name of Chain. The list of chains can be found in the directory <Config_dir> \ etc \ network \ <network_name> or by the Cellframe-Node-CLI using command - net list chains
-[{signed | first_signed}] - list of blocks, which were signed by the master node, and this signature is not necessarily on the first place / list of blocks, which were signed by the master node first (optional)
-[-from_hash <block_hash>] [-to_hash <block_hash>] - list filtration from definite block to block (optional)
-[-from_date <YYMMDD>] [-to_date <YYMMDD>] - block list filtration by date from time to time (optional)
-[{-cert | -pkey_hash ] filtration by certificate or public key which was used to sign block (optional)
-unspent - if you add this parameter, the recieved list will have information about blocks with unspent coins (in other case list will include all blocks with spent and unspent coins, optional)

If you request command in the Cellframe network, use parameter -chain main.

CLI Example

Example without filtration:

Command:

cellframe-node-cli block list 
-net Backbone 
-chain main

Response:

 
0x7B5448B8CED12781175A7801414A5F7177054D4D17E24707CAAE02CFB3C795F7: ts_create=Tue, 16 Jan 2024 08:30:48 +0000
        0xFF0010EFE8DCF3860F24EC31374AC5688E09F30AEC690ADEEFDE0FEC94CBFE9C: ts_create=Tue, 16 Jan 2024 10:00:05 +0000
        0xCF7BD1996E25A9383B2FB133B9A0C99B0093830D30DFA201EDCD71FAA893842B: ts_create=Tue, 16 Jan 2024 11:15:48 +0000
        0x747388E2058D6A8DB1C5D45703B1B8D478E40EFD47CE3CCDD6EEE96414F6E89B: ts_create=Tue, 16 Jan 2024 11:16:39 +0000
        0x15DB786A389741FC0DF104984E2B3315E4221DAB251AE1D5E3E727245218D7E6: ts_create=Tue, 16 Jan 2024 11:20:24 +0000
        0x9B505F6E0FA0BFEF54DBAED9B14EEF5639004558966756E09E826B1703FEA702: ts_create=Tue, 16 Jan 2024 11:21:29 +0000
 
Backbone.main: Have 24180 blocks

Example with filtration:

Command:

cellframe-node-cli block list signed 
-net Backbone 
-chain main 
-pkey_hash 0x84AF956B4B14612A952CBE3C19A9ECC39856FD7CB23259993F3D9043D9104968

Response:

0x20ABE51DC7E9D64D76359DE28E1ADA6A8DA9DF5D29269B3E562A2CF6354BDE43: ts_create=Mon, 15 Jan 2024 20:06:14 +0000
        0x40BF0883AED5FCA6920206DBD273651962E7CB71527D0119C03D198317412FA3: ts_create=Tue, 16 Jan 2024 08:30:18 +0000
        0x7B5448B8CED12781175A7801414A5F7177054D4D17E24707CAAE02CFB3C795F7: ts_create=Tue, 16 Jan 2024 08:30:48 +0000
        0xFF0010EFE8DCF3860F24EC31374AC5688E09F30AEC690ADEEFDE0FEC94CBFE9C: ts_create=Tue, 16 Jan 2024 10:00:05 +0000
        0x15DB786A389741FC0DF104984E2B3315E4221DAB251AE1D5E3E727245218D7E6: ts_create=Tue, 16 Jan 2024 11:20:24 +0000
        0xAEB3E829666CFE80EE32767FE281A038B2833954509AD02B2E0A86ED2F1D0B6A: ts_create=Tue, 16 Jan 2024 12:16:00 +0000
        0xBD691ECD523B501C0AF7AE027873163902A6F24CCA12A26FFE6C01392A3C2F62: ts_create=Tue, 16 Jan 2024 12:21:33 +0000
 
Backbone.main: Have 7 blocks filtered according to the specified criteria

JSON-RPC Example

JSON-RPC Request - BLOCK LIST FILTRE

Gets list of the blocks using filtration; by definite blocks from block to block, by time from time to time, signed, with unspent coins, etc.

Request Structure

JSON object:

{
  "method": "block",
  "subcommand": ["list"],
  "arguments": {
    "net": "network_name",
    "chain": "chain_name",
    "signed | first_signed": "null",
    "from_hash": "block_hash",
    "to_hash": "block_hash",
    "from_date": "YYMMDD",
    "to_date": "YYMMDD",
    "cert | pkey_hash": "signing_cert_name | signing_cert_pkey_hash",
    "unspent": "null"
  },
  "id": "1"
}

Parameters: net - name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network folder or received using - Node Command - NET LIST chain - the name of chain (main or zerochain) [{signed | first_signed}] - list of blocks, which were signed by the master node, and this signature is not necessarily on the first place / list of blocks, which were signed by the master node first optional [from_hash <block_hash>][to_hash <block_hash>] - list filtration from definite block to block optional [from_date <YYMMDD>][to_date <YYMMDD>] - block list filtration by date from time to time in the RCF822 format optional [{cert <signing_cert_name> | pkey_hash <signing_cert_pkey_hash>}] - filtration by certificate or public key which was used to sign block optional [unspent] - shows information only about blocks with unspent coins optional

If you make a request in the Cellframe network, use parameter chain:main.

Curl Example

Let’s see blocks from the date “250415” with unspent coins.

Request:

curl --unix-socket /opt/cellframe-node/var/run/node_cli -X POST http://localhost/connect -d '
{
  "method": "block",
  "subcommand": ["list"],
  "arguments": {
    "net": "riemann",
    "chain": "main",
    "from_date": "250415",
    "unspent": "null"
  },
  "id": "1"
}'

Response:

{
  "type"2,
  "result": [
    [
      {
        "block number"17737,
        "hash""0xA074C476141D2F04332762E9EA653F8FA2071687BBEB359AC745DC7E4E1660F9",
        "ts_create""Tue, 15 Apr 2025 09:41:20 +0000"
      },
      {
        "block number"17736,
        "hash""0xC5F7159E6BACF736B56E1D4D62B4D663DC0AE7E6A4926B9069352975151743D0",
        "ts_create""Tue, 15 Apr 2025 08:11:51 +0000"
      },
      {
        "block number"17735,
        "hash""0x15ABBE1CA3304CB70784D99A31D18A148495BA42E5162E3B5DED96CB5E4C1748",
        "ts_create""Tue, 15 Apr 2025 08:07:36 +0000"
      },
      {
        "block number"17734,
        "hash""0x886DD61FB2FDD661B84E59164AE61C792CA5CB4035F1E49A6336A6EB54013EAA",
        "ts_create""Tue, 15 Apr 2025 08:06:51 +0000"
      },
      {
        "block number"17733,
        "hash""0x75966EAE5386B0C0FB7EEDC0FB52273DD15F2495DC0E33204DAABB16BBC38DFB",
        "ts_create""Tue, 15 Apr 2025 08:04:54 +0000"
      },
      {
        "block number"17732,
        "hash""0x09462848068425CAAC7405D4CF9DB51612B3A856D903B776FE9F9D4E9A5BD6C9",
        "ts_create""Tue, 15 Apr 2025 08:00:19 +0000"
      },
      {
        "block number"17731,
        "hash""0xBF3A2F7A318DF3F8A07D807BBBFC1916529701A484A5E4C33FA9C91EC4DA23BB",
        "ts_create""Tue, 15 Apr 2025 07:52:51 +0000"
      },
      {
        "block number"17730,
        "hash""0x58BFD6067AD0DAA264098D7622FC8B5E98C69754EA26C37B845DF874AC9D9515",
        "ts_create""Tue, 15 Apr 2025 07:47:10 +0000"
      },
      {
        "limit""unlimit"
      }
    ],
    {
      "riemann.main with filter -  filtered according to the specified criteria, have blocks"8
    }
  ],
  "id"1
}
Link to original