chainlib-eth/chainlib/eth/chain.py

16 lines
420 B
Python
Raw Normal View History

from chainlib.jsonrpc import JSONRPCRequest
def network_id(id_generator=None):
2021-08-21 09:27:40 +02:00
"""Generate json-rpc query to retrieve network id from node
:param id_generator: JSON-RPC id generator
:type id_generator: JSONRPCIdGenerator
:rtype: dict
:returns: rpc query object
"""
j = JSONRPCRequest(id_generator=id_generator)
o = j.template()
o['method'] = 'net_version'
return j.finalize(o)