class NetEnode implements JsonRpcMethod {

  @Override
  public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {
    if (!p2pNetwork.isP2pEnabled()) {
      return p2pDisabledResponse(requestContext);
    }

    final Optional<EnodeURL> enodeURL = p2pNetwork.getLocalEnode();
    if (!enodeURL.isPresent()) {
      return enodeUrlNotAvailable(requestContext);
    }

    return new JsonRpcSuccessResponse(
        requestContext.getRequest().getId(), enodeURL.get().toString());
  }

  public  NetEnode(final P2PNetwork p2pNetwork);

}