Retrieve the Latest Block Information from Steem Blockchain


To retrieve the latest block information from the Steem blockchain using the curl command, you can make use of the Steem API. Here’s a command that you can use in your terminal:

1
curl -s --data '{"jsonrpc":"2.0", "method":"condenser_api.get_dynamic_global_properties", "params":[], "id":1}' https://api.steemit.com | jq
curl -s --data '{"jsonrpc":"2.0", "method":"condenser_api.get_dynamic_global_properties", "params":[], "id":1}' https://api.steemit.com | jq

This curl command sends a POST request to the Steemit API, specifically the condenser_api.get_dynamic_global_properties method, which returns information about the latest block on the Steem blockchain. The -s flag is used to make the curl command run silently without showing progress information, and –data is used to send a JSON-RPC request.

The response will contain various information, including the latest block number. You can parse the JSON response to extract the block number, see below example JSON response from this Steem API.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "head_block_number": 78366282,
    "head_block_id": "04abc64ae3f83a4c22f8918ea543c6f19c34cda9",
    "time": "2023-09-22T13:14:51",
    "current_witness": "pennsif.witness",
    "total_pow": 514415,
    "num_pow_witnesses": 172,
    "virtual_supply": "493750242.825 STEEM",
    "current_supply": "444375217.278 STEEM",
    "confidential_supply": "0.000 STEEM",
    "init_sbd_supply": "0.000 SBD",
    "current_sbd_supply": "12449278.882 SBD",
    "confidential_sbd_supply": "0.000 SBD",
    "total_vesting_fund_steem": "177786765.557 STEEM",
    "total_vesting_shares": "310881156227.487402 VESTS",
    "total_reward_fund_steem": "0.000 STEEM",
    "total_reward_shares2": "0",
    "pending_rewarded_vesting_shares": "945849320.913775 VESTS",
    "pending_rewarded_vesting_steem": "499171.571 STEEM",
    "sbd_interest_rate": 0,
    "sbd_print_rate": 0,
    "maximum_block_size": 65536,
    "required_actions_partition_percent": 0,
    "current_aslot": 78851097,
    "recent_slots_filled": "340282366920938463463374607431768211455",
    "participation_count": 128,
    "last_irreversible_block_num": 78366266,
    "vote_power_reserve_rate": 10,
    "delegation_return_period": 432000,
    "reverse_auction_seconds": 300,
    "available_account_subsidies": 23802832,
    "sbd_stop_percent": 1000,
    "sbd_start_percent": 900,
    "next_maintenance_time": "2023-09-22T13:28:03",
    "last_budget_time": "2023-09-22T12:28:03",
    "content_reward_percent": 6500,
    "vesting_reward_percent": 1500,
    "sps_fund_percent": 1000,
    "sps_interval_ledger": "72.930 SBD",
    "downvote_pool_percent": 2500
  }
}
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "head_block_number": 78366282,
    "head_block_id": "04abc64ae3f83a4c22f8918ea543c6f19c34cda9",
    "time": "2023-09-22T13:14:51",
    "current_witness": "pennsif.witness",
    "total_pow": 514415,
    "num_pow_witnesses": 172,
    "virtual_supply": "493750242.825 STEEM",
    "current_supply": "444375217.278 STEEM",
    "confidential_supply": "0.000 STEEM",
    "init_sbd_supply": "0.000 SBD",
    "current_sbd_supply": "12449278.882 SBD",
    "confidential_sbd_supply": "0.000 SBD",
    "total_vesting_fund_steem": "177786765.557 STEEM",
    "total_vesting_shares": "310881156227.487402 VESTS",
    "total_reward_fund_steem": "0.000 STEEM",
    "total_reward_shares2": "0",
    "pending_rewarded_vesting_shares": "945849320.913775 VESTS",
    "pending_rewarded_vesting_steem": "499171.571 STEEM",
    "sbd_interest_rate": 0,
    "sbd_print_rate": 0,
    "maximum_block_size": 65536,
    "required_actions_partition_percent": 0,
    "current_aslot": 78851097,
    "recent_slots_filled": "340282366920938463463374607431768211455",
    "participation_count": 128,
    "last_irreversible_block_num": 78366266,
    "vote_power_reserve_rate": 10,
    "delegation_return_period": 432000,
    "reverse_auction_seconds": 300,
    "available_account_subsidies": 23802832,
    "sbd_stop_percent": 1000,
    "sbd_start_percent": 900,
    "next_maintenance_time": "2023-09-22T13:28:03",
    "last_budget_time": "2023-09-22T12:28:03",
    "content_reward_percent": 6500,
    "vesting_reward_percent": 1500,
    "sps_fund_percent": 1000,
    "sps_interval_ledger": "72.930 SBD",
    "downvote_pool_percent": 2500
  }
}

whale-300x200 Retrieve the Latest Block Information from Steem Blockchain API blockchain STEEM

Steem to the Moon🚀!

  • You can swap the STEEM/SBD to SOL (Solana) via steem2sol!
  • You can swap the STEEM/SBD to ETH (Ethereum) via steem2eth!
  • You can swap the STEEM/SBD to Tether USDT (TRC-20) via steem2usdt!
  • You can swap the STEEM/SBD to TRX (TRON) via steem2trx!
  • You can swap the STEEM/SBD to BTS (BitShares) via steem2bts!
  • Register a free STEEM account at SteemYY!
  • Steem Blockchain Explorer!

–EOF (The Ultimate Computing & Technology Blog) —

GD Star Rating
loading...
375 words
Last Post: Differences (Responsibilities, Skills and Tools) Among Engineering Roles
Next Post: How to PyArg_ParseTuple the bytearray in Python to C ?

The Permanent URL is: Retrieve the Latest Block Information from Steem Blockchain

Leave a Reply