chain.py (420B)
1 from chainlib.jsonrpc import JSONRPCRequest 2 3 4 def network_id(id_generator=None): 5 """Generate json-rpc query to retrieve network id from node 6 7 :param id_generator: JSON-RPC id generator 8 :type id_generator: JSONRPCIdGenerator 9 :rtype: dict 10 :returns: rpc query object 11 """ 12 j = JSONRPCRequest(id_generator=id_generator) 13 o = j.template() 14 o['method'] = 'net_version' 15 return j.finalize(o)