Skip to content

Instantly share code, notes, and snippets.

@emre
Created August 1, 2018 09:50
Show Gist options
  • Save emre/77406f40f4dfa96c29f67bc179ed6c34 to your computer and use it in GitHub Desktop.
Save emre/77406f40f4dfa96c29f67bc179ed6c34 to your computer and use it in GitHub Desktop.
last_head_test
import requests
def test_last_head():
appbase_node = "https://api.steemit.com"
global_properties = requests.post(
appbase_node,
json={
"jsonrpc": "2.0",
"method": "condenser_api.get_dynamic_global_properties",
"params": [], "id": 1
}
).json()
head_block_number = global_properties["result"]["head_block_number"]
print("Last head block number", head_block_number)
ops_in_block = requests.post(
appbase_node,
json={
"jsonrpc": "2.0",
"method": "condenser_api.get_ops_in_block",
"params": [head_block_number, False], "id": 1
}
).json()
print(ops_in_block)
test_last_head()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment