MCPcopy Create free account
hub / github.com/canopy-network/canopy / get_height

Function get_height

plugin/python/tutorial/rpc_test.py:106–110  ·  view source on GitHub ↗

Get the current blockchain height.

(rpc_url: str)

Source from the content-addressed store, hash-verified

104
105
106def get_height(rpc_url: str) -> int:
107 """Get the current blockchain height."""
108 resp_body = post_raw_json(f"{rpc_url}/v1/query/height", "{}")
109 result = json.loads(resp_body)
110 return result.get('height', 0)
111
112
113def get_account_balance(rpc_url: str, address: str) -> int:

Callers 1

test_plugin_transactionsFunction · 0.85

Calls 2

post_raw_jsonFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected