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:
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.
{
"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
}
}
Steem to the Moonπ!
- You can rent Steem Power via rentsp!
- You can swap the TRON:TRX/USDT/USDD to STEEM via tron2steem!
- You can swap the STEEM/SBD to SUI via steem2sui!
- 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 Block Explorer
- ChatGPT/Steem Integration: You can type !ask command to invoke ChatGPT
- Steem Witness Table and API
- Other Steem Tools
–EOF (The Ultimate Computing & Technology Blog) —
358 wordsLast Post: Differences (Responsibilities, Skills and Tools) Among Engineering Roles
Next Post: How to PyArg_ParseTuple the bytearray in Python to C ?