2021-06-28 07:48:36 +02:00
|
|
|
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
|
|
|
|
"""
|
2021-06-28 07:48:36 +02:00
|
|
|
j = JSONRPCRequest(id_generator=id_generator)
|
|
|
|
o = j.template()
|
|
|
|
o['method'] = 'net_version'
|
|
|
|
return j.finalize(o)
|