Shows the last block in the chain.

Command syntax:

block last 
-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 - 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

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

CLI Example

Command:

cellframe-node-cli block last 
-net raiden 
-chain main

Response:

Last block num: 16511
 
Last block hash: 0x31770B9BA8B838067EDA6ABA5A0C2B88FEF611945E249C9AEB3640AE873E0E4E
ts_created: Thu, 20 Jun 2024 06:09:41 -0400
 
raiden.main has blocks: 16511

JSON-RPC Example

JSON-RPC Request - BLOCK LAST

Shows the last block in the chain.

Request Structure

JSON object:

{
  "method": "block",
  "subcommand": "last",
  "arguments": {
    "net": "network_name",
    "chain": "chain_name"
  },
  "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)

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

Curl Example

Request:

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

Response:

{
  "type": 2,
  "result": [
    {
      "Last block num": 17744,
      "Last block hash": "0x2104906B96D43F545A32950B1C1E59CF3AF7E9850F32F620454862B2544FC000",
      "ts_created": "Wed, 16 Apr 2025 09:41:26 +0000",
      "riemann.main has blocks": 17744
    }
  ],
  "id": 1
}
Link to original