code: def jsonrpc_request(method, identifier, params=None):
      
      return '{}\r\n'.format(json.dumps({
          'id': identifier,
          'method': method,
          'params': params or {},
          'jsonrpc': '2.0'
      })).encode()
docs: Produce a JSONRPC request.